Graph decision problems and NP-hardness
Lax762056.GraphProblems · concepts/Lax762056/GraphProblems.lean · lax-762056
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Independent Set asks whether a graph has an independent set of size at least . Max Cut asks whether it has a cut with at least crossing edges.
A graph problem is NP-hard on a class if every language in NP has a polynomial-time many-one reduction to the problem whose output graph always belongs to . Instances use the adjacency-matrix encoding.
Concept map
Lean source view on GitHub
| 1 | import Lax762056.MaxCut |
| 2 | import Lax434930.NondeterministicPolynomialTime |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Graph decision problems and NP-hardness |
| 7 | type: definition |
| 8 | --- |
| 9 | Independent Set asks whether a graph has an independent set of size at least |
| 10 | . Max Cut asks whether it has a cut with at least crossing edges. |
| 11 | |
| 12 | A graph problem is NP-hard on a class if every language in NP |
| 13 | has a polynomial-time many-one reduction to the problem whose output graph |
| 14 | always belongs to . Instances use the adjacency-matrix encoding. |
| 15 | -/ |
| 16 | |
| 17 | namespace Lax762056.GraphProblems |
| 18 | |
| 19 | open GraphEncoding MaxCut Turing |
| 20 | open Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime |
| 21 | |
| 22 | abbrev GraphClass := ∀ {n : ℕ}, SimpleGraph (Fin n) → Prop |
| 23 | abbrev DecisionProblem := Instance → Prop |
| 24 | |
| 25 | def IndependentSet (I : Instance) : Prop := I.threshold ≤ I.graph.indepNum |
| 26 | |
| 27 | def MaxCut (I : Instance) : Prop := I.threshold ≤ maxCut I.graph |
| 28 | |
| 29 | def NPHard (problem : DecisionProblem) : Prop := |
| 30 | ∀ A : Language, A ∈ NP → |
| 31 | ∃ f : Word → Instance, |
| 32 | Nonempty (TM2ComputableInPolyTime id encode f) ∧ |
| 33 | ∀ x, x ∈ A ↔ problem (f x) |
| 34 | |
| 35 | def NPHardOn (problem : DecisionProblem) (graphs : GraphClass) : Prop := |
| 36 | ∀ A : Language, A ∈ NP → |
| 37 | ∃ f : Word → Instance, |
| 38 | Nonempty (TM2ComputableInPolyTime id encode f) ∧ |
| 39 | ∀ x, graphs (f x).graph ∧ (x ∈ A ↔ problem (f x)) |
| 40 | |
| 41 | end Lax762056.GraphProblems |
| 42 |
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments