BU CS 332 – Theory of Computation
Lecture 21:
- NP‐Completeness
- Cook‐Levin Theorem
- Reductions
Reading: Sipser Ch 7.3‐7.5
Mark Bun April 15, 2020
BU CS 332 Theory of Computation Lecture 21: Reading: NP - - PowerPoint PPT Presentation
BU CS 332 Theory of Computation Lecture 21: Reading: NP Completeness Sipser Ch 7.3 7.5 Cook Levin Theorem Reductions Mark Bun April 15, 2020 Last time: Two equivalent definitions of 1) is the class of languages decidable
Reading: Sipser Ch 7.3‐7.5
Mark Bun April 15, 2020
1) is the class of languages decidable in polynomial time
deterministic ‐time algorithm such that iff there exists a string such that accepts Theorem: A language iff there is a polynomial‐time verifier for
4/15/2020 CS332 ‐ Theory of Computation 2
“Is there an assignment to the variables in a logical formula that make it evaluate to ?”
/ (encoded as 0/1)
and operations. Ex:
formula if it makes the formula evaluate to 1
is satisfiable if there exists an assignment that satisfies it
4/15/2020 CS332 ‐ Theory of Computation 3
Ex:
Ex:
Claim:
4/15/2020 CS332 ‐ Theory of Computation 4
“Given a list of cities and distances between them, is there a ‘short’ tour of all of the cities?” More precisely: Given
between each pair of cities
4/15/2020 CS332 ‐ Theory of Computation 5
Question: Does ? Philosophically: Can every problem with an efficiently verifiable solution also be solved efficiently? A central problem in mathematics and computer science
4/15/2020 CS332 ‐ Theory of Computation 6
EXP NP P If P NP If P = NP EXP P = NP
polynomial time ( , , , etc.)
(e.g., given a natural number, find a prime factorization)
time (e.g., find the lowest energy conformation of a protein)
4/15/2020 CS332 ‐ Theory of Computation 7
An NP search problem: Given a ciphertext , find a plaintext and encryption key that would encrypt to
classification rule is an NP search problem
problem: Given a mathematical statement and length bound , is there a proof of with length at most ? General consensus:
4/15/2020 CS332 ‐ Theory of Computation 8
4/15/2020 CS332 ‐ Theory of Computation 9
Believe this to be true, but very far from proving it implies that there is a problem in which cannot be solved in polynomial time, but it might not be a useful one Question: What would allow us to conclude about problems we care about? Idea: Identify the “hardest” problems in NP Find such that iff
4/15/2020 CS332 ‐ Theory of Computation 10
Definition: A function
∗ ∗ is computable if there is a TM
which, given as input any
∗, halts with only
its tape. Definition: Language is mapping reducible to language , written
∗ ∗ such that for
all strings
∗, we have
4/15/2020 CS332 ‐ Theory of Computation 11
Definition: A function
∗ ∗ is polynomial‐time computable if there
is a polynomial‐time TM which, given as input any
∗,
halts with only
Definition: Language is polynomial‐time reducible to language , written
∗ ∗
such that for all strings
∗, we have
4/15/2020 CS332 ‐ Theory of Computation 12
Theorem: If
then Proof: Let decide in poly time, and let be a poly‐ time reduction from to . The following TM decides in poly time:
4/15/2020 CS332 ‐ Theory of Computation 13
Definition: A language is NP‐complete if 1) and 2) Every language is poly‐time reducible to , i.e.,
is NP‐hard”)
4/15/2020 CS332 ‐ Theory of Computation 14
Theorem: Suppose is NP‐complete. Then iff Proof:
4/15/2020 CS332 ‐ Theory of Computation 15
Theorem: Suppose is NP‐complete. Then iff Consequences of being NP‐complete: 1) If you want to show , you just have to show 2) If you want to show , you just have to show 3) If you already believe , then you believe
4/15/2020 CS332 ‐ Theory of Computation 16
4/15/2020 CS332 ‐ Theory of Computation 17
Theorem: (Boolean satisfiability) is NP‐complete Proof: Already know . Need to show every problem in reduces to (later?)
4/15/2020 CS332 ‐ Theory of Computation 18
Stephen A. Cook (1971) Leonid Levin (1973)
Lemma: If
Theorem: If and
language , then is also NP‐complete
4/15/2020 CS332 ‐ Theory of Computation 19
4/15/2020 CS332 ‐ Theory of Computation 20
All problems below are NP‐complete and hence poly‐time reduce to one another!
SAT 3SAT DIR-HAM-CYCLE INDEPENDENT SET VERTEX COVER GRAPH 3-COLOR HAM-CYCLE TSP SUBSET-SUM SCHEDULING PLANAR 3-COLOR SET COVER
by definition of NP‐completeness
Definition(s):
,
Ex.
clause contains exactly 3 literals Ex.
CS332 ‐ Theory of Computation 21
Theorem: is NP‐complete Proof idea: 1) is in NP (why?) 2) Show that
an arbitrary formula into a 3CNF such that is satisfiable iff is satisfiable
4/15/2020 CS332 ‐ Theory of Computation 22