Professional Documents
Culture Documents
Computational Complexity The Class NP: Reducing One Language To Another Reducing One Language To Another
Computational Complexity The Class NP: Reducing One Language To Another Reducing One Language To Another
Computational Complexity
Cooks Theorem
In polynomial time
Instance
of P1
Conversion
TM
Runs in Ptime
Corresponding
Instance of P2
TM
recognizing
L2
Runs in Ptime
YES
NO
Key facts:
INSTANCE
L NP
For every other language L1 NP
L1 p L
Cooks Theorem
SATISFIABILITY is NP-Complete
variables xi
logical connectors &, |, and !
PROBLEM
Satisfiability (SAT)
If L1 is reducable to L2 then
Steven Cook
A local boy
Cooks Theorem
SATISFIABILITY is NP-Complete
To prove:
b. Buffalo, NY.
Contents of
tape before
tape head
(nonblank)
xqy
If M accepts an input w,
Contents of
tape at and
after tape
head (nonblank)
x1x2xnqy1y2ym
Configuration of a TM
Semi-infinite Tape
Configuration
i = Xi0 X i1 Xip(n)
S = y00q0 & y01a1 & & y0nan & y0n+1B & & y0p(n)B
At start state
W on tape
Expressing Ni
(q1,b) = (q2, a, R)
Example:
After
Expressing Ni
a a q2 a b b a
Xij is a state
Xij-1, Xij, Xij+1 is transformed to Xi+1j-1, Xi+1j, Xi+1j+1
Before: a
After
q1 b
a a
a b b a
q2 a
b b a
State is at
position j & valid
move
State is
nowhere near
position j
Expressing Ni
Expressing Ni
Expressing Ni
Must assure
(q1,b) = (q2, a, R)
Example:
After
a a q2 a b b a
j-1
j j+1
yij-1D & yijq & yij+1A & yi+1j-1p & y i+1jD & yi+1j+1C
i+1
SAT is in NP-Complete
S&N&F
Conversion from TM -> boolean expression can be
done in polynomial time (w.r.t. size of input to
TM)
Instance
of P1
Conversion
TM
Runs in Ptime
Corresponding
Instance of P2
TM
recognizing
L2
Runs in Ptime
YES
NO
Key facts:
If L1 is reducable to L2 then
Reduction
Assume Problem M is in P
YES
Known
NP-c
problem
Reduction
machine
(runs in
Ptime)
M TM
(runs on
Ptime)
NO
SAT!