Minimum equivalent digraph
AbbreviationInstances of MINIMUM EQUIVALENT DIGRAPH#✓fully proved
An instance of MINIMUM EQUIVALENT DIGRAPH is a triple \((n, E, K)\) consisting of a natural number \(n\) (the number of vertices), a finite list \(E\) of ordered pairs of natural numbers (the arcs) and a natural number \(K\) (the bound on the number of arcs).
abbrev MinimumEquivalentDigraphInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionDirected adjacency for MINIMUM EQUIVALENT DIGRAPH#✓fully proved
For a finite list \(E\) of ordered pairs of natural numbers and natural numbers \(u\) and \(v\), the directed adjacency test of \(E\) at \((u, v)\) returns true when the pair \((u, v)\) occurs in \(E\), and false otherwise.
Used by 1
DefinitionBounded reachability in a digraph#✓fully proved
Let \(E\) be a finite list of ordered pairs of natural numbers, read as the arcs of a directed graph, and let \(n\), \(u\) and \(v\) be natural numbers. Then \(v\) is reachable from \(u\) within \(n\) steps along \(E\) when there are natural numbers \(w_0, w_1, \dots, w_k\) with \(k \le n\), \(w_0 = u\) and \(w_k = v\) such that \((w_j, w_{j+1})\) occurs in \(E\) for every \(j < k\).
def Reachable (n : ℕ) (E : List (ℕ × ℕ)) (u v : ℕ) : Prop :=
∃ path : List ℕ, path.length ≤ n + 1 ∧ path ≠ [] ∧
path.getD 0 0 = u ∧ path.getD (path.length - 1) 0 = v ∧
∀ j, j + 1 < path.length → DAdj E (path.getD j 0) (path.getD (j + 1) 0)
def DAdj (edges : List (ℕ × ℕ)) (u v : ℕ) : Bool :=
edges.contains (u, v)
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:56
Uses 1 · Used by 1
DefinitionWell-formed MINIMUM EQUIVALENT DIGRAPH instances#✓fully proved
An instance \((n, E, K)\) of MINIMUM EQUIVALENT DIGRAPH is well formed when the list \(E\) has no repeated entries and every pair \((a, b)\) in \(E\) satisfies \(a < n\), \(b < n\) and \(a \ne b\); that is, \(E\) lists distinct arcs without loops between vertices among \(0, \dots, n - 1\).
def WellFormed (i : MinimumEquivalentDigraphInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2
abbrev MinimumEquivalentDigraphInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:52
Uses 1 · Used by 1
DefinitionFeasible MINIMUM EQUIVALENT DIGRAPH instances#✓fully proved
An instance \((n, E, K)\) of MINIMUM EQUIVALENT DIGRAPH is feasible when some sublist \(F\) of \(E\) (obtained by deleting entries of \(E\)) has at most \(K\) entries and, for all vertices \(u < n\) and \(v < n\), \(v\) is reachable from \(u\) within \(n\) steps along \(E\) if and only if \(v\) is reachable from \(u\) within \(n\) steps along \(F\).
def MinimumEquivalentDigraphFeasible
(i : MinimumEquivalentDigraphInstance) : Prop :=
∃ F : List (ℕ × ℕ), F.Sublist i.2.1 ∧ F.length ≤ i.2.2 ∧
∀ u < i.1, ∀ v < i.1, Reachable i.1 i.2.1 u v ↔ Reachable i.1 F u v
abbrev MinimumEquivalentDigraphInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:52
def Reachable (n : ℕ) (E : List (ℕ × ℕ)) (u v : ℕ) : Prop :=
∃ path : List ℕ, path.length ≤ n + 1 ∧ path ≠ [] ∧
path.getD 0 0 = u ∧ path.getD (path.length - 1) 0 = v ∧
∀ j, j + 1 < path.length → DAdj E (path.getD j 0) (path.getD (j + 1) 0)
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:60
Uses 2 · Used by 1
DefinitionMINIMUM EQUIVALENT DIGRAPH as a decision problem#✓fully proved
The decision problem MINIMUM EQUIVALENT DIGRAPH accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an instance of MINIMUM EQUIVALENT DIGRAPH that is well formed and feasible. Bitstrings that do not decode to an instance are rejected.
noncomputable def minimumEquivalentDigraphDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MinimumEquivalentDigraphInstance) x with
| some i => decide (WellFormed i ∧ MinimumEquivalentDigraphFeasible i)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev MinimumEquivalentDigraphInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:52
def WellFormed (i : MinimumEquivalentDigraphInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:67
def MinimumEquivalentDigraphFeasible
(i : MinimumEquivalentDigraphInstance) : Prop :=
∃ F : List (ℕ × ℕ), F.Sublist i.2.1 ∧ F.length ≤ i.2.2 ∧
∀ u < i.1, ∀ v < i.1, Reachable i.1 i.2.1 u v ↔ Reachable i.1 F u v
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:71
Uses 12 · Used by 1
TheoremMINIMUM EQUIVALENT DIGRAPH is NP-complete#●ready to prove
The decision problem MINIMUM EQUIVALENT DIGRAPH belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted minimumEquivalentDigraph_npComplete :
minimumEquivalentDigraphDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L minimumEquivalentDigraphDec
noncomputable def minimumEquivalentDigraphDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MinimumEquivalentDigraphInstance) x with
| some i => decide (WellFormed i ∧ MinimumEquivalentDigraphFeasible i)
| none => false
WantedExt/Complexity/NPComplete/MinimumEquivalentDigraphWanted.lean:78
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- M. R. Garey and D. S. Johnson, Computers and Intractability (1979), MINIMUM EQUIVALENT DIGRAPH; A. V. Aho, M. R. Garey, and J. D. Ullman, "The transitive reduction of a directed graph", SIAM Journal on Computing 1 (1972), 131-137 (distinguishing transitive reduction from the minimum equivalent subgraph and the hardness connection); D. M. Moyles and G. L. Thompson, "An algorithm for finding a minimum equivalent graph of a digraph", Journal of the ACM 16 (1969), 455-460.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.