-
Notifications
You must be signed in to change notification settings - Fork 3
[Model] MinimumFaultDetectionTestSet #935
Description
Motivation
FAULT DETECTION IN DIRECTED GRAPHS (MS18) from Garey & Johnson, A12. Given a directed acyclic graph (DAG) with designated input vertices (in-degree 0) and output vertices (out-degree 0), find a minimum-size set of input-output paths that covers every vertex in the graph. This models VLSI test generation: each path represents a test that activates a signal from an input to an output, and every component (vertex) must be exercised by at least one test. NP-hard even when there is only one output (Ibaraki, Kameda, Toida). Applications in hardware testing, fault diagnosis, and network monitoring.
Definition
Name: MinimumFaultDetectionTestSet
Reference: Garey & Johnson, Computers and Intractability, A12 MS18
Mathematical definition:
INSTANCE: A directed acyclic graph G = (V, A) with inputs I = {v ∈ V : in-degree(v) = 0} and outputs O = {v ∈ V : out-degree(v) = 0}.
OBJECTIVE: Find a test set T ⊆ I × O of minimum cardinality such that for every vertex v ∈ V, there exists a test (i, o) ∈ T where v lies on some path from i to o in G.
Equivalently: every vertex must be covered by at least one input-to-output path in the selected test set. The objective value is Min(|T|).
Variables
- Count: |I| × |O| (one per input-output pair)
- Per-variable domain: {0, 1}
- Meaning: Whether each input-output pair (i, o) is included in the test set T. The coverage of pair (i, o) is the set of all vertices that lie on some path from i to o. The constraint is that every vertex in V must be covered by at least one selected pair.
Schema
Type name: MinimumFaultDetectionTestSet
Variants: none
| Field | Type | Description |
|---|---|---|
num_vertices |
usize |
Number of vertices |
arcs |
Vec<(usize, usize)> |
Directed arcs A, each (u, v) where u is parent, v is child |
inputs |
Vec<usize> |
Input vertices I (in-degree 0) |
outputs |
Vec<usize> |
Output vertices O (out-degree 0) |
Complexity
- NP-hardness: NP-hard even for |O| = 1 (Ibaraki, Kameda, Toida; G&J cites reduction from X3C).
- Best known exact algorithm: O*(2^(num_inputs * num_outputs)) by brute-force over test-pair subsets. The problem is a special case of SET COVER (vertices are elements, each (i,o) pair covers vertices on paths from i to o).
- Complexity string:
"2^(num_inputs * num_outputs)" - Polynomial special cases: Series-parallel DAGs.
Extra Remark
Full book text:
INSTANCE: Directed acyclic graph G = (V, A), with I = {v ∈ V : in-degree(v) = 0} and O = {v ∈ V : out-degree(v) = 0}, positive integer K.
QUESTION: Is there a set of K or fewer paths, each starting at a vertex of I and ending at a vertex of O, such that every vertex in V lies on at least one of the paths?
Reference: [Ibaraki, Kameda, and Toida]. Transformation from X3C.
Comment: NP-complete even for |O| = 1.
Note: The original G&J formulation asks for K paths covering all vertices. We reformulate equivalently as selecting input-output pairs (each pair implicitly selects a path), and minimize the number of selected pairs. The coverage of pair (i, o) is the set of vertices reachable from i that can also reach o.
How to solve
- It can be solved by (existing) bruteforce. (Precompute coverage sets for each (i,o) pair via forward/backward reachability; enumerate subsets of pairs; find minimum subset covering all vertices.)
- It can be solved by reducing to integer programming.
- Other:
Reduction Rule Crossref
(Planned: ExactCoverBy3Sets → MinimumFaultDetectionTestSet, following G&J)
Example Instance
Input:
DAG with V = {v0, v1, v2, v3, v4, v5, v6} (7 vertices).
Inputs I = {v0, v1}, Outputs O = {v5, v6}.
Arcs: (v0,v2), (v0,v3), (v1,v3), (v1,v4), (v2,v5), (v3,v5), (v3,v6), (v4,v6).
Coverage of each input-output pair:
- (v0, v5): vertices on paths v0→v2→v5 and v0→v3→v5 → covers {v0, v2, v3, v5}
- (v0, v6): vertices on path v0→v3→v6 → covers {v0, v3, v6}
- (v1, v5): vertices on path v1→v3→v5 → covers {v1, v3, v5}
- (v1, v6): vertices on paths v1→v3→v6 and v1→v4→v6 → covers {v1, v3, v4, v6}
Optimal test set T = {(v0, v5), (v1, v6)}, size 2:
- (v0, v5) covers {v0, v2, v3, v5}
- (v1, v6) covers {v1, v3, v4, v6}
- Union = {v0, v1, v2, v3, v4, v5, v6} = V ✓
Why size 1 is impossible: No single pair covers all 7 vertices. The best single pair (v0, v5) covers only 4 vertices, missing v1, v4, v6.
Suboptimal test set: T = {(v0, v5), (v0, v6), (v1, v6)}, size 3 — covers all vertices but uses an unnecessary extra pair.
Expected Outcome
Optimal value: Min(2) — the minimum test set size is 2, achieved uniquely by T = {(v0, v5), (v1, v6)}. Out of 15 possible subsets of 4 pairs, there are 4 feasible test sets with 3 distinct sizes (2, 3, 4).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status