Docsity

The Cook-Levin Theorem: Proof that SATISFIABILITY is NP-Complete, Slides of Advanced Computational Complexity

Partial preview of the text

Download The Cook-Levin Theorem: Proof that SATISFIABILITY is NP-Complete and more Slides Advanced Computational Complexity in PDF only on Docsity!

Lecture 5: The Cook-Levin Theorem

Matthew Johnson

[email protected]

The Cook-Levin Theorem

Definition A language Lnpc ∈ NP is said to be NP -complete if, for any language L ∈ NP , we have L ≤ Lnpc.

Theorem (Cook-Levin) SATISFIABILITY is NP -complete.

Assumptions about NT

Assume that NT uses: h + 1 symbols, σ 0 , σ 1 ,... , σh (where σ 0 is the blank symbol), k + 1 states q 0 , q 1 ,... , qk (where q 1 is the accepting state), l instructions r 1 ,... , rl — distinct possible transitions. Assume that every path in NT (x) has length xa (the length of an accepting path for input x). For this, extend all shorter paths assuming that no further action is taken, cut all longer paths, since such paths make no difference to whether or not x will be accepted.

Variables

We use Boolean variables to specify exactly the possible configurations of the machine at each time t ≤ t∗^ = xa: Psi,t is TRUE iff s-th cell contains symbol σi at time t — There are at (h + 1 ) · xa · xa of such variables Qit is TRUE iff NT is in state qi at time t — There are (k + 1 ) · xa of them Ss,t is TRUE iff tape head is on s-th cell at time t — There are xa · xa of them Rti is TRUE iff the machine implements instruction ri at time t — There are l · xa of them

Formula continued

B says the tape head scans exactly one cell

B = B 1 ∧ B 2 ∧... ∧ Bt∗ Bt = (S 1 ,t ∨... ∨ St∗,t ) ∧

1 ≤i<j≤t∗

(Si,t ⇒ ¬Sj,t )

C says that NT is in exactly one state D says that NT implements exactly one instruction at each step E says that at time 1, the input x is on the first n cells of the tape, the head is at position 1, and the state is q 0. If x = σs 1 σs 2... σsn then E = Q^01 ∧ S 1 , 1 ∧ (

1 ≤i≤n

P is,i 1 ) ∧ (

n+ 1 ≤i≤t∗

P i^0 , 1 )

Formula continued

Define F , G, H and J as follows for each instruction ru ≡ δ(qi , σj ) = (qi′^ , σj′^ , m)

F says that ru is a valid transition ∧ s,t

((Ss,t ∧ Rut ) ⇒ (Qti ∧ Psj,t ))

or equivalently in CNF ∧ s,t

(¬Ss,t ∨ ¬Rtu ∨ Qit ) ∧ (¬Ss,t ∨ ¬Rut ∨ Sjs,t ))

G specifies the effect on the state: Rtu ⇒ Qi t′+ 1 H specifies the correct symbol is written Rut ⇒ P sj′,t+ 1

Conclusions

We can construct formula Φx in polynomial time (Note that the construction is only possible “in principle", since the the polynomial p will not necessarily be known) If formula Φx is satisfiable then the values of the variables specify an accepting computation for x. Conversely, if there is an accepting computation for x, then the corresponding values of the variables will satisfy the formula Φx. Hence, x ∈ L ⇔ Φx ∈ LSATISFIABILITY QED