Cook-Levin Theorem
Proof and Illustration
Kwak, Nam-ju
Applied Algorithm Laboratory
KAIST
Contents
NP
NP-complete
SAT Problem
A Characteristic of NP-complete
Cook-Levin Theorem
Proof of Cook-Levin Theorem
Illustration
Corollary: 3SATNPC
Applied Algorithm Lab. KAIST
NP
Definition
NP is the class of languages that have polynomial
time verifiers.
Definition (informal)
A verifier V for a language A is an algorithm which
accepts a given input w to A if a corresponding
certificate or a proof c exists.
NP
Theorem
A language is in NP iff it is decided by some
nondeterministic polynomial time Turing
machine.
NP-complete
Definition
A language B is NP-complete if
BNP, and
ANP, APB.
NP-complete
Examples
SAT, 3SAT, CLIQUE, VERTEX-COVER,
HAMPATH, SUBSET-SUM, and etc.
SAT Problem
Definition
Boolean variables: variables that can take on
the values TRUE and FALSE
Boolean operations: AND, OR, and NOT
Boolean formula: an expression involving
Boolean variable and operations
SAT Problem
Definition
satisfiable: if some assignment of 0s and 1s
to the variables make the formula evaluate to
1
SAT Problem
Definition (SAT Problem)
SAT = {<>| is a satisfiable Boolean
formula}.
A Characteristic of NP-complete
Theorem
If BNPC and BPC for CNP, then CNPC.
10
Cook-Levin Theorem
Cook-Levin Theorem
SATNPC
P1PP2P PPnPSAT
11
Definition
APB if f such that wAf(w)B and f is
polynomial time computable.
Applied Algorithm Lab. KAIST
12
input w
Pick one.
Input
Boolean formula
Lets construct
this Boolean
formula!!
SAT
wA or not?
SAT or not?
13
14
NP Turing machine
given
transformation
Boolean formula
SAT problem
If satisfiable, wA; otherwise, wA.
Applied Algorithm Lab. KAIST
15
16
17
18
q0
w1
w2
wn
start configuration
second configuration
nk
nk
nk th configuration
19
20
##
w
n
wn
##
wn
##
##
qx1
w
q12
#
#
#
#
Proof
Theorem
x
q
of
w Cook-Levin
1
Proof (cont.)
21
22
23
24
25
26
#
#
q0
q1
27
q1
#
q2
a
c
a
a
b
some examples of legal 23 windows
q1
q1
q1
q1
a
a
q2
b
some examples of illegal 23 windows
Applied Algorithm Lab. KAIST
q2
28
29
a2
a3
a4
a5
a6
30
31
Definition (restated)
w, A, and wA
f(w)=, B=SAT, and =f(w)B=SAT
wASAT
APSAT
32
Illustration
N=(Q, , , , q0, qaccept)
33
Illustration
N can decide in n2 steps where n=|w|.
Therefore n2 is 16.
C={q0, q1, qaccept, 0, 1, , #}
#
1616 tableau
Applied Algorithm Lab. KAIST
q0
#
34
Illustration
35
Illustration
36
Illustration
37
Illustration
For move, find out all the legal windows.
q0
q0
q0
q1
q1
q1
q1
q1
q1
q1
q1
q1
q1
q1
q1
q1
q1
qacc
qacc
qacc
38
Illustration
39
Illustration
Now, we get =cellstartmoveaccept.
40
Illustration
41
Corollary: 3SATNPC
CNFs can be converted into CNFs with
three literals per clause (as explained
soon).
At first, convert cell, start, move, and accept
into CNF.
42
Corollary: 3SATNPC
cell, start, and accept are already in CNF.
43
Corollary: 3SATNPC
move is converted into CNF using the
distributive laws.
44
Corollary: 3SATNPC
Examples
(a1a2)(a1a2a2)
(a1a2a3a4)(a1a2z)(za3a4)
(a1a2a3a4a5)
(a1a2z1)(z1a3z2)(z2a4a5 )
45
Corollary: 3SATNPC
Hence, a SAT problem is able to converted
into a equivalent 3SAT problem (in
polynomial time).
That is, SATP3SAT.
Since SATNPC, considering the definition
of NPC, 3SATNPC, too.
46
Conclusion
Theorem (restated)
SATNPC
3SATNPC
47
Q&A
Please, ask questions, if any.
48
Thank you!
Contents covered are based on Introduction to the Theory of Computation, 2nd ed. written by
Michael Sipser.
The slide theme and the background image are from http://www.m62.net/.
Applied Algorithm Lab. KAIST
49