Complexity 8 1 Cooks Theorem Complexity Andrei Bulatov
Complexity 8 -1 Cook’s Theorem Complexity Andrei Bulatov
Complexity Cook – Levin Theorem Definition A language L is said to be NP-complete if, L NP and for any A NP, A L Theorem (Cook – Levin) Satisfiability is NP-complete 8 -2
Complexity 8 -3 Proof (Main Idea) Let A be a language from NP Then there is a polynomial time nondeterministic Turing Machine N For every input x for NT, we build a propositional formula encoding the computation NT(x) such that satisfying assignments to correspond exactly to paths in NT(x) If is short enough and can be constructed in polynomial time, we get the required polynomial time reduction
Complexity 8 -4 Assumptions about NT Assume that NT uses: • h+1 symbols • k+1 states • l instructions (where is the blank symbol) is the accepting state) — distinct possible transitions Assume that every path in NT(x) has length (We can extend every shorter path assuming that no further acti is taken. We can cut longer paths, because they make no difference whet x is going to be accepted or not) Assume that the tape head never moves to the left from the leftmos symbol of the input
Complexity 8 -5 Variables We use Boolean variables to specify exactly the possible configurat of the machine at each time : • is true if and only if s-th cell contains symbol (there are • • at time t of them) is true if and only if tape head on s-th cell at time t (there are • of them) is true if and only if NT in state (there at ti of them) is true if and only if the machine implements instructi at time t (there are of them)
Complexity 8 -6 Formula Now we write the formula • A says each cell at each time contains exactly one symbol (Remember that (there are ) in A)
Complexity 8 -7 • B says the tape head scans exactly one cell at each time • 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 ta the head is at position 1, and the state is If then
Complexity Define F, G, H and J as follows for each instruction • F says that is a valid transition or equivalently in CNF • G specifies the effect on the state 8 -8
Complexity 8 -9 • H specifies that the correct symbol is written • J specifies that the correct movement is made where d(L) = – 1, d(R) = 1, d(S) = 0 • Finally, K says that the accepting state is entered
Complexity 8 -10 Conclusions • We can construct formula in polynomial time (Note that the construction is only possible “in principle”, since the a will not necessarily be known) • If formula is satisfiable then the values of the variables spec 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 • Hence, • QED
- Slides: 10