Satisfiability continues a conversation on NP-completeness. To prove some problem B is NP-complete:
- Prove by showing that it is verifiable in polynomial time.
- Prove is NP-hard; . For this, choose some known which is NP-complete, then give some reduction computable in polynomial time such that for every :
In order to prove that a problem :is NP-complete, another NP-complete problem must exist. However, Cook and Levin proved SAT is NP-complete without a predecessor; .
SAT
A variable is one of . A literal is a variable or its negation; or . A clause is an OR of several literals. A formula in CNF form is an AND of several clauses. For example, is unsatisfiable.
Definition: such that is a formula in CNF form and is satisfiable.
Cook and Levin proved SAT. So if . SAT is like an elected representative of the entire NP set. This is why we don’t believe there exists a polynomial time algorithm for SAT.
3SAT
We prove that 3SAT is NP-complete by reduction. First, we show . Our witness is the assignment of variables for the problem instance solution. All of these computations can be done in polynomial time. For all , check if or not.
Now we prove . For a general SAT formula, we convert it to a 3SAT instance such that is satisfiable iff is satisfiable. An input of every SAT formula has some max clause size . If then is in both SAT and 3SAT. Now suppose has a max clause size less than 3. We convert a clause size of to a pair of clauses, one of size and the other of size . We add a variable as follows:
Note, if the clause is true, at least one of the literals is true, so there is a selection in to make the two clauses true. If is always false, the two clauses are false for any . Repeat this process, adding dummy variables, until only has clauses of size 3. This reduction occurs in polynomial time. , so is NP-complete.
Cook and Levin showed that . We found that . We could repeat this reduction for any SAT variant with .
2SAT
, so if and . This equivalence is intuitively false though; , so every clause of size two is an implication.
Create a graph with two vertices for each literal and two edges for each clause. If is a clause, add edge . Implication is transitive, and a formula is unsatisfiable iff , so there exists a path in our graph from to and vice versa.
CircuitSAT
Let cSAT be defined as the set cSAT = { | is boolean circuit}. We prove that cSAT is NP-complete.
First, we show that cSAT . The verifier takes as input and a witness of bits, and runs on the inputs. The size of the input is intuitively polynomial (more depth, more gates).
Now we show that . Let be a formula. We create a boolean circuit with variables and additional input wires for negated literals. We add one root gate on the next layer. For each clause, add a sub-circuit for the appropriate three. Then, add an AND gate to AND the clauses together.
If , this circuit . If , this circuit is also unsatisfiable. Construction of this circuit takes polynomial time. so is NP-complete.