1: // Arguments: |
2: // E = {r1, ..., r|E|}, a collection of rays in ℝn. |
3: // (e.g. j-containing pathway fragments) |
4: // k, a cardinality cutoff (infinite by default). |
5: // R, a subset of N to which the search |
6: // for minimal hitting sets can be limited |
7: // (= N by default) |
8: // Output: |
9: // , a collection of minimal hitting sets for E |
10: // (with cardinality k or less, limited to subsets of R) |
11: = {∅} |
12: for all r ∈ E do |
13: = {} |
14: //Augment non-intersecting sets in to |
15: //"hit" nonzero components of ray r of E |
16: for all H ∈ do |
17: //If the H does not intersect the nonzero |
18: //components of r, then augment H |
19: //and add to |
20: if H ⋂ NZ(r) = ∅ then |
21: for all i ∈ R for which r
i
≠ 0 do |
22: add H ∪ {i} to |
23: end for |
24: else |
25: add H to |
26: end if |
27: end for |
28: //Populate with minimal, non-duplicate, sets |
29: //from that meet the cardinality threshold |
30: = {} |
31: for all H ∈ do |
32: if H ∉ and | ⊂ H and |H| ≤ k then |
33: add H to |
34: end if |
35: end for |
36: = |
37: end for |
38: return |