how to establish np -hardness
DESCRIPTION
How to establish NP -hardness. Lemma : If L 1 is NP - hard and L 1 ≤ L 2 then L 2 is NP - hard. SAT. SAT is in NP . Cook’s theorem (1972): SAT is NP -hard. SAT. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/1.jpg)
1
How to establish NP-hardness
•Lemma: If L1 is NP-hard and L1 ≤ L2 then L2 is NP-hard.
![Page 2: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/2.jpg)
2
SAT
•SAT is in NP.
•Cook’s theorem (1972): SAT is NP-hard.
![Page 3: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/3.jpg)
3
SAT•SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?•SAT: Given a CNF, is it true that it does not represent the constant-0 function?
•Input: (¬x1 ∨ ¬x2) ∧ (x1 ∨ x2)•Output: Yes.•Input: (¬x1 ∨ ¬x2) ∧ (x1 ∨ x2) ∧ (x1 ∨ ¬x2 ) ∧ (¬x1 ∨ x2)•Output: No.
![Page 4: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/4.jpg)
4
Cooks’ theorem: SAT is NP-hard
•Proof of Cook’s theorem:– CIRCUIT SAT is NP-hard.– CIRCUIT SAT reduces to SAT.– Hence, SAT is NP-hard.
![Page 5: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/5.jpg)
5
CIRCUIT SAT
•CIRCUIT SAT: Given a Boolean circuit, is there a way to assign truth values to the input gates, so that the output gate evaluates to true?
•Generalizes SAT, as CNFs are formulas and formulas are circuits.
![Page 6: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/6.jpg)
6
Circuits vs. Turing Machines
•We consider Circuits also as computational devices themselves.
•Like Turing Machines, circuits C: {0,1}n {0,1} solve decision problems on {0,1}n.
•Unlike Turing machines, circuits takes inputs of a fixed input length n only.
![Page 7: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/7.jpg)
7
CIRCUIT SAT is NP-hard
•Given an arbitrary language L in NP we must show that L reduces to CIRCUIT SAT.
•This means: We must construct a polynomial time computable map r mapping instances of L to circuits, so that
∀x: x ∈ L ⇔ r(x) ∈ CIRCUIT SAT
•The only thing we know about L is that there is a language L’ in P and a polynomial p, so that:
![Page 8: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/8.jpg)
8
Theorem
•Given Turing Machine M for L’ running in time at most q(n) on inputs of length n, where q is a polynomial.
•For every n, there is a circuit Cn with at most O(q(n)2) gates so that
∀x ∈ {0,1}n: Cn(x)=1 iff M accepts x.
•The map 1n Cn is polynomial time computable.
![Page 9: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/9.jpg)
9
The Tableau Method
Time 0
Time 1
Time t
…
s21
Can be replaced byacyclic Booleancircuit of size ≈ s
![Page 10: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/10.jpg)
10
Cell state vectors
•Given a Turing Machine computation, an integer t and an integer i let cti {0,1}s be a Boolean representation of the following information, a cell state vector:
–The symbol in cell i at time t–Whether or not the head is pointing to cell i at time t–If the head is pointing to cell i, what is the state of the finite control of the Turing machine at time t?
•The integer s depends only on the Turing machine (not the input to the computation, nor t,i).
•To make cti defined for all t, we let c(t+1)i = cti if the computation has already terminated at time t.
![Page 11: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/11.jpg)
11
Crucial Observation
•If we know the Turing machine and •ct-1,i-1, ct-1,i, ct-1, i+1, we also can determine ct,i.
•In other words, there is a Boolean function h depending only on the Turing machine so that ct,i = h(ct-1,i-1, ct-1,i, ct-1,i+1).
•A circuit D for h is the central building block in a circuit computing all cell state vectors for all times for a given input.
![Page 12: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/12.jpg)
122 t(n)
t(n)
x1 xn
![Page 13: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/13.jpg)
13
Cooks’ theorem: SAT is NP-hard
•Proof of Cook’s theorem:– CIRCUIT SAT is NP-hard.– CIRCUIT SAT reduces to SAT.– Hence, SAT is NP-hard.
![Page 14: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/14.jpg)
14
SAT
ILPMILP
MAX INDEPENDENT SET
MIN VERTEX COLORING
HAMILTONIAN CYCLE TSP
TRIPARTITE MATCHING
SET COVER
KNAPSACK
BINPACKING
![Page 15: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/15.jpg)
15
![Page 16: How to establish NP -hardness](https://reader035.vdocuments.us/reader035/viewer/2022062309/56815265550346895dc097e6/html5/thumbnails/16.jpg)
16
Remarks on Papadimitriou’s terminology
•When Papadimitriou writes “log space reduction”, just substitute “polynomial time reduction”.
•When Papadimitriou writes NL, just substitute P.
•Papadimtriou’s concepts are more restrictive, but the more restrictive definitions will play no role in this course.