Graph bandwidth
AbbreviationBANDWIDTH instances#✓fully proved
An instance of BANDWIDTH is a triple \((n, E, K)\) of a natural number \(n\) (the number of vertices), a list \(E\) of ordered pairs of natural numbers (the edges) and a natural number \(K\) (the bound).
abbrev BandwidthInstance := ℕ × List (ℕ × ℕ) × ℕ
Used by 3
DefinitionWell-formed BANDWIDTH instances#✓fully proved
A BANDWIDTH instance \((n, E, K)\) is well formed when the list \(E\) has no repeated entries and every pair \((u, v)\) in \(E\) satisfies \(u < n\), \(v < n\) and \(u \ne v\), and its reverse \((v, u)\) does not occur in \(E\). Thus \(E\) lists the edges of a loopless undirected graph on the vertices \(0, \dots, n-1\), each edge exactly once.
def WellFormed (i : BandwidthInstance) : 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 BandwidthInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/BandwidthWanted.lean:47
Uses 1 · Used by 1
DefinitionBANDWIDTH feasibility#✓fully proved
A BANDWIDTH instance \((n, E, K)\) is feasible when there is an ordering of the numbers \(0, \dots, n-1\) such that \(|p(u) - p(v)| \le K\) for every pair \((u, v)\) in \(E\), where \(p(m)\) is the position of \(m\) in the ordering, counting from \(0\), and \(p(m) = n\) when \(m\) is not among \(0, \dots, n-1\).
def BandwidthFeasible
(i : BandwidthInstance) : Prop :=
∃ perm : List ℕ, perm.Perm (List.range i.1) ∧
∀ e ∈ i.2.1, Nat.dist (perm.idxOf e.1) (perm.idxOf e.2) ≤ i.2.2
abbrev BandwidthInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/BandwidthWanted.lean:47
Uses 1 · Used by 1
DefinitionThe BANDWIDTH decision problem#✓fully proved
BANDWIDTH accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of triples \((n, E, K)\) of a natural number, a list of pairs of natural numbers and a natural number, to a BANDWIDTH instance that is both well formed and feasible. Bitstrings that do not decode to such a triple are rejected.
noncomputable def bandwidthDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := BandwidthInstance) x with
| some i => decide (WellFormed i ∧ BandwidthFeasible 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 BandwidthInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/BandwidthWanted.lean:47
def WellFormed (i : BandwidthInstance) : 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/BandwidthWanted.lean:50
def BandwidthFeasible
(i : BandwidthInstance) : Prop :=
∃ perm : List ℕ, perm.Perm (List.range i.1) ∧
∀ e ∈ i.2.1, Nat.dist (perm.idxOf e.1) (perm.idxOf e.2) ≤ i.2.2
WantedExt/Complexity/NPComplete/BandwidthWanted.lean:54
Uses 12 · Used by 1
TheoremBANDWIDTH is NP-complete#●ready to prove
The BANDWIDTH decision problem belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted bandwidth_npComplete :
bandwidthDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L bandwidthDec
noncomputable def bandwidthDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := BandwidthInstance) x with
| some i => decide (WellFormed i ∧ BandwidthFeasible i)
| none => false
WantedExt/Complexity/NPComplete/BandwidthWanted.lean:61
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), BANDWIDTH; C. H. Papadimitriou, "The NP-completeness of the bandwidth minimization problem" (1976).
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.