Connected dominating set
AbbreviationInstances of CONNECTED DOMINATING SET#✓fully proved
An instance of CONNECTED DOMINATING SET is a triple \((n, E, K)\) of a natural number \(n\) (the number of vertices), a list \(E\) of pairs of natural numbers (the edges) and a natural number \(K\) (the bound).
abbrev ConnectedDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of a CONNECTED DOMINATING SET instance#✓fully proved
For an instance \((n, E, K)\) of CONNECTED DOMINATING SET, its graph is the simple graph on the vertex set \(\{0, \dots, n - 1\}\) in which distinct vertices \(i\) and \(j\) are adjacent when \((i, j)\) or \((j, i)\) belongs to \(E\).
def Graph (i : ConnectedDominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev ConnectedDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:46
def edgeGraph (n : ℕ) (es : List (ℕ × ℕ)) : SimpleGraph (Fin n) :=
SimpleGraph.fromRel fun i j => ((i : ℕ), (j : ℕ)) ∈ es
CSLibExt/Computability/Complexity/Karp/Color.lean:51
Uses 2 · Used by 1
DefinitionWell-formed CONNECTED DOMINATING SET instances#✓fully proved
An instance \((n, E, K)\) of CONNECTED DOMINATING SET is well formed when the list \(E\) has no repeated entries and every pair \((u, v)\) in \(E\) has \(u < n\), \(v < n\) and \(u \ne v\), with the reversed pair \((v, u)\) not in \(E\).
def WellFormed (i : ConnectedDominatingSetInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.1
abbrev ConnectedDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:46
Uses 1 · Used by 1
DefinitionFeasible CONNECTED DOMINATING SET instances#✓fully proved
An instance \((n, E, K)\) of CONNECTED DOMINATING SET is feasible when there is a set \(S\) of vertices of its graph \(G\) with at most \(K\) elements such that every vertex of \(G\) lies in \(S\) or is adjacent in \(G\) to a vertex of \(S\), and the subgraph of \(G\) induced by \(S\) is connected (in particular, \(S\) is nonempty).
def ConnectedDominatingSetFeasible
(i : ConnectedDominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
(∀ v : Fin i.1, v ∈ S ∨ ∃ u ∈ S, (Graph i).Adj u v) ∧
((Graph i).induce (↑S : Set (Fin i.1))).Connected
abbrev ConnectedDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:46
def Graph (i : ConnectedDominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:49
Uses 2 · Used by 1
DefinitionThe decision problem CONNECTED DOMINATING SET#✓fully proved
CONNECTED DOMINATING SET accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an instance of CONNECTED DOMINATING SET that is well formed and feasible. Bitstrings that do not decode to an instance are rejected.
noncomputable def connectedDominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := ConnectedDominatingSetInstance) x with
| some i => decide (WellFormed i ∧ ConnectedDominatingSetFeasible 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 ConnectedDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:46
def WellFormed (i : ConnectedDominatingSetInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.1
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:54
def ConnectedDominatingSetFeasible
(i : ConnectedDominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
(∀ v : Fin i.1, v ∈ S ∨ ∃ u ∈ S, (Graph i).Adj u v) ∧
((Graph i).induce (↑S : Set (Fin i.1))).Connected
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:58
Uses 12 · Used by 1
TheoremCONNECTED DOMINATING SET is NP-complete#●ready to prove
The decision problem CONNECTED DOMINATING SET belongs to NP, and every decision problem in NP reduces to it by a polynomial-time many-one reduction.
public theorem_wanted connectedDominatingSet_npComplete :
connectedDominatingSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L connectedDominatingSetDec
noncomputable def connectedDominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := ConnectedDominatingSetInstance) x with
| some i => decide (WellFormed i ∧ ConnectedDominatingSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/ConnectedDominatingSetWanted.lean:66
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), CONNECTED DOMINATING SET.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.