COMS W3261
Computer Science Theory
Lecture 22: December 5, 2011
SAT is NP-Complete
Outline
- Review
- The Cook-Levin theorem: SAT is NP-complete
- Some other NP-complete problems
1. Review
- The satisfiability problem
- A truth assignment for a boolean expression assigns either
the value true (1) or the value false (0)
to each of the variables in the expression.
- The value E(T) of an expression E given a truth assignment T is
the result of evaluating E with each variable x in E replaced
by T(x).
- A truth assignment T satisfies E if E(T) = 1.
- An expression E is satisfiable if there exists a truth assignment T
that satisfies E.
- The satisfiability problem (SAT) is to determine whether a given
boolean expression is satisfiable.
- SAT is the set of (encoded) boolean expressions that are satisfiable.
2. The Cook-Levin Theorem: SAT is NP-Complete
- We first show SAT is in NP:
- Given a boolean expression E of length n, a
multitape nondeterministic
Turing machine can guess a truth assignment T for E
in O(n) time.
- The NTM can then evaluate E using the truth assignment
T in O(n2) time.
- If E(T) = 1, then the NTM accepts E.
- We must also show that if L is any language in NP,
then there is a polynomial-time reduction of L to SAT:
- If a NTM M accepts an input w of length n in p(n) time, then M has a
sequence of moves such that
- α0 is the initial ID of M with input w.
- α0 |– α1 |– …
|– αk where k ≤ p(n).
- αk is an ID with an accepting state.
- Each αi consists only of nonblanks unless
αi ends in a state and a blank, and extends
from the initial head position to the right.
- From M and w we can construct in polynomial time a boolean expression EM,w
that is satisfiable iff M accepts w within p(n) moves.
See HMU, Sect. 10.2.3, pp. 440-446 for details.
3. Some Other NP-complete Problems
- There are thousands of known NP-complete problems.
Here are some notable ones:
- Satisfiability
- CSAT
- 3SAT
- Independent set
- Node cover
- Directed Hamiltonian circuit
- Undirected Hamiltonian circuit
- Traveling salesman problem
4. Practice Problems
- Show that 1SAT and 2SAT are solvable in linear time.
- Show that 3SAT is NP-complete.
- Show that CSAT is NP-complete.
5. Reading Assignment
aho@cs.columbia.edu