To read this article, it is necessary to understand that the SAT problem is NP-complete, which is mainly proven by the Cook-Levin theorem. There are many excellent resources that have proven the NP-completeness of SAT, but I will omit them here, please refer to them yourself. If I have time in the future, I will add a proof of the SAT problem as I understand it.
The description of 3-SAT (3-CNF-SAT) is: Determine whether there exists a Boolean expression , where , such that . That is, determine whether there exists a Boolean expression that is true.
To prove the NP-completeness of 3-SAT, we need to 1) prove that it is an NP problem. 2) prove that it is NP-hard. 3-SAT is similar to the SAT problem, and when we obtain a set of solutions, we only need to substitute them into the Boolean expression to determine the correctness of the solution. So 3-SAT is obviously an NP problem. To prove its NP-hardness, we will reduce SAT to 3-SAT.
For each SAT problem, for example:
Each consists of a certain number of variables. We will perform the following operations on each group of variables.
- If , that is, only one variable is involved in the composition of , for example, . We transform it into .
- If , for example, . We transform it into .
- If , we keep it unchanged.
- If , for example, . We transform it into . Where is a new variable.
- And so on.
The above operations can obviously be done in polynomial time. Therefore, given a SAT problem, we can convert it to a 3-SAT problem in polynomial time. And when SAT has a solution, 3-SAT must also have a solution; and when 3-SAT has a solution, since 3-SAT is a subclass of SAT, SAT also has a solution. Therefore, 3-SAT is NP-complete.