CS 126 Lecture T6: NP-Completeness
CS 126 Lecture T6: NP-Completeness
CS 126 Lecture T6: NP-Completeness
NP-Completeness
Outline
• Introduction: polynomial vs. exponential time
• P vs. NP: the holy grail
• NP-Completeness: Cook’s Theorem
• NP-Completeness: Reduction
• Conclusions
• Who cares?
- How long does it take to do TSP(1000)?
- How big is 1000!?
• (A note)
- We have seen that any logic formula can be expressed as a
sum-of-products form
- Any logic formula can also be expressed as a product-of-sums
form
CS126 19-26 Randy Wang
Transforming SAT to CLIQUE
x’ y z
x’ x
y’ y’
z’ z
y z
‘
CS126 19-27 Randy Wang
Solution to CLIQUE = SOLUTION to SAT
x’ y z
x’ x
y’ y’
z’ z
y z
(x’+y+z)(x+y’+z)(y+z)(x’+y’+z)
• Solution to SAT ==> solution to CLIQUE
• Solution to CLIQUE ==> solution to SAT
• So, CLIQUE is NP-Complete
CS126 19-28 Randy Wang
More NP-Complete Problems