# Double SAT is NP Complete

** Problem Statement:** Given a formula

*, the problem is to determine if*

**f***has two satisfying assignments.*

**f**** Explanation:** An instance of the problem is an input specified to the problem. An instance of Double Sat problem is a boolean formula

*. Since an NP-complete problem is a problem which is both NP and NP-Hard, the proof or statement that a problem is NP-Complete consists of two parts:*

**f**

- The problem itself is in NP class.
- All other problems in NP class can be polynomial-time reducible to that.

(B is polynomial-time reducible to C is denoted as B ≤ P^{C})

If the 2nd condition is only satisfied then the problem is called** NP-Hard**.

But it is not possible to reduce every NP problem into another NP problem to show its NP-Completeness all the time. Therefore to show a problem is NP-complete, then prove that the problem is in NP and any NP-Complete problem is reducible to that i.e., if B is NP-Complete and B ≤ P^{C }. For C in NP, then C is NP-Complete. Thus, it can be verified that the **Double SAT problem** is NP-Complete using the following propositions:

__Double Sat is in NP__:

If any problem is in NP, then it is given a ‘certificate’, which is a solution to the problem and an instance of the problem(a formula) then it can identify (whether the solution is correct or not) certificate in polynomial time. This can be done by giving a set of satisfying assignments for the variables in**f**, and verify if each clause is satisfied in**f**.**f**__Double Sat is NP-Hard__:

In order to prove double sat is NP-Hard then reduce a known NP-Hard problem, 3-SAT (in this case) to our problem.

This can be done by:

Given a 3-CNF functionthen create a boolean function**g****f**by adding a pair of literals**(x V x’)**to each clause of, where**f****x**is an additional variable. This reduction can work in polynomial time.

Now, the following two propositions hold:- If
**g**is unsatisfiable, then some clause of**g**must be**FALSE**, and therefore,must also be unsatisfiable.**f** - If 3-SAT formula
is satisfiable, then using the same set of assignment variables comprised in**g**, we can have both**g****x=0**and**x=1**as the valid assignments to**g**.

- If

Therefore, **Double-SAT Problem** is NP-Complete.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer **Complete Interview Preparation Course****.**

In case you wish to attend **live classes **with experts, please refer **DSA Live Classes for Working Professionals **and **Competitive Programming Live for Students**.