Victor Farazdagi

Victor Farazdagi

Computer science and applied mathematics

14 Dec 2018

Practice Problem: Almost-SAT

1. Problem Statement

Consider the Almost-SAT problem defined as following:

Input: A CNF formula ff with nn variables x1,,xnx_1, … , x_n and mm clauses.

Output: An assignment that satisfies exactly m1m - 1 clauses, or NO if no such assignment exists.

Now, our aim is to prove that Almost-SAT problem is NP-Complete.

2. Attack Plan

In order to prove that Almost-SAT \in NP-Complete, we need to show two things:

  1. First of all, we need to make sure that Almost-SAT is a search (or decision) problem, i.e. Almost-SAT NP\in NP
  2. Second, we want to make sure that Almost-Sat is NP-Hard (at least as hard as any of NP-Complete problems).

3. Proof

3.1 Almost-SAT \in NP

Being a search/decision problem, means we have a polynomial time algorithm that can verify validity of a solution.

Thus, given input ff for Almost-SAT and an assignment SS (which is a proposed solution):

  • in O(n)O(n) we can verify that any particular clause is satisfied or not

  • we have mm clauses, so O(mn)O(mn) time to check that exactly m1m - 1 clauses are satisfied

3.2 SAT \to Almost-SAT

Consider some problem BB which is NP-Complete. Being NP-Complete means AB,ANPA \to B, \forall A \in NP That’s BB is as hard as any problems in NP.

From this, notice that (AB)(BC)    AC(A \to B) \land (B \to C) \implies A \to C

This means, given a known NP-Complete problem (BB above), it is enough to reduce that problem to Almost-SAT, to prove that Almost-SAT is NP-Complete too.

By Cook-Levin Theorem we know that SAT is NP-Complete.

Let’s reduce SAT to Almost-SAT, to complete the proof.

  • Consider input for SAT problem: a CNF formula ff of nn variables and mm clauses.
  • Create a new variable vv, and use it to define a new formula f=f(v)(vˉ)f’ = f \land (v) \land(\bar{v}).
  • Note that m=m+2m’ = m + 2 (where mm’ is number of clauses in ff’, and mm is number of clauses in ff)

Claim: ff is satisfiable     \iff ff’ has an assignment satisfying m1m’ - 1 clauses

Forward implication: take any satisfying assignment for ff, then set v=Truev = True, implication follows immediately.

Reverse implication: for a given satisfying assignment of ff’, only one of clauses (v)(v) or (vˉ)(\bar{v}) can be satisfied. So, in the whole formula ff’, m1m’ - 1 clauses are satisfiable at most. Now, given such an assignemnt, drop variable vv from it, and we have satisfactory assignment for ff.

Since, both transforming ff to ff’ and transforming satisfying assignment for ff’ to that of ff takes polynomial time, SAT \to Almost-SAT. \blacksquare