0% found this document useful (0 votes)
34 views1 page

3SAT

The document discusses the 3SAT problem, demonstrating that it is NP-Complete by showing it is in NP and providing a reduction from the SAT problem. It details the input transformation process for clauses with more than three literals and explains how to derive a satisfying assignment for SAT from a solution to 3SAT. The correctness proof confirms that if a solution exists for 3SAT, it also satisfies the original SAT problem, and vice versa.

Uploaded by

saeb2saeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

3SAT

The document discusses the 3SAT problem, demonstrating that it is NP-Complete by showing it is in NP and providing a reduction from the SAT problem. It details the input transformation process for clauses with more than three literals and explains how to derive a satisfying assignment for SAT from a solution to 3SAT. The correctness proof confirms that if a solution exists for 3SAT, it also satisfies the original SAT problem, and vice versa.

Uploaded by

saeb2saeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

The 3SAT problem is as follows: given a boolean formula f in CNF, with n variables

and m clauses, where each clause has at most 3 literals, output a satisfying assignment
for f if one exists, or report No if no such assignment exists. Given that SAT is known
to be NP-Complete, prove that the 3SAT problem is NP-Complete.

3SAT is in NP
We first demonstrate that 3SAT is in the class NP. Given an input I to 3SAT, and a candidate
solution S, we can check if each clause in I is satisfied by checking the True/False assignment
from S. As each clause has at most three literals, it is O(1) to check each clause, and there
are m clauses, so it takes O(m) time to verify a candidate solution, which is polynomial.
SAT → 3SAT reduction
We now demonstrate that 3SAT is at least as hard as a problem known to be NP-Complete
by reducing SAT → 3SAT.
Input Transformation:
Let c ∈ C be clauses in the input I to SAT, and c′ ∈ C ′ be clauses in our input to 3SAT.
For each c ∈ C, there are two possibilities. If c has k ≤ 3 literals, simply add c as clause
c′ to C ′ . If, however, c has k > 3 literals,we create c′ as follows: create k − 3 new variables
as Y1 , Y2 , . . . , Yk−3 . Using these new variables, create c′ = (X1 ∨ X2 ∨ Y1 ) ∧ (!Y1 ∨ X3 ∨
Y2 ) . . . (!Yk−4 ∨ Xk−2 ∨ Yk−3 ) ∧ (!Yk−3 ∨ Xk−1 ∨ Xk ) There are m clauses to transform. Each
clause can contain at most n literals, giving a O(mn) runtime which is polynomial.
Output Transformation:
If 3SAT returns NO, we return NO for SAT - there is no satisfying assignment. If 3SAT returns
a satisfying assignment, then we remove the True/False assignments for the added variables
and return the remaining truth assignment as the solution to SAT. There will be at most
n − 3 new variables, removing them takes O(n) linear time.
Correctness Proof:
First we demonstrate that if 3SAT finds a solution, then a solution must exist for SAT. We
note that for any clause c′ that is set to the original clause c, no logic is changed - a truth
assignment which satisfies one will satisfy the other. Now, for each clause c′ that is a con-
version of c, consider each clause c′i . If c′i has all false assignments for those literals X ∈ C
(the original literals), then Yi must be set to true to satisfy c′i . So then !Yi in c′i+1 (the next
clause) will evaluate to false - this forces either X ∈ C or Yi+1 to be true in order to satisfy
c′i+1 . This patterns ensures that the added variables Y1 . . . Yk−3 cannot be used to satisfy all
the c′ clauses - at least one clause must be satisfied by some literal X ∈ C. Therefore, if
3SAT finds a satisfying assignment, then all the original c clauses in SAT will be satisfied.

Now, consider the situation where no assignment can be found to satisfy 3SAT. As we demon-
strated that the additional Y variables cannot be used to satisfy C ′ , this means that no truth
assignment for the literals X ∈ C could be found to satisfy C ′ . Therefore, no assignment
exists which satisfies the original SAT formula.

You might also like