The Theory of Computation
Bernard M.E. Moret
Addison-Wesley-Longman, 1998
Detailed Solutions
Chapter 7, Problem 7.1, Part 2
Prove that Positive NAE3SAT is NP-complete.
Instance: a set of clauses written over variables;
each clause contains exactly three uncomplemented variables, with no variable appearing
more than once in any given clause.
Question: is there a truth assignment that makes one or two variables
true in each clause?
Input Encoding and Size:
An instance of this problem can be described by triples of labels,
each label identifying a variable. Since there are variables, it takes
ceiling bits to identify each; thus the input size is
ceiling bits. Note, however, that
and are related: cannot exceed (obviously)
and cannot exceed the binomial coefficient choose 3
(for equally obvious reasons).
Hence is a polynomial function of ,
so that the input size is simply bounded above and below by a polynomial in
; is a safe upper
bound and a safe lower bound.
Certificate Description and Verification:
An obvious choice for the certificate is a truth assignment, which can be
represented by bits. Verifying the certificate is done clause by clause;
for each clause, we check that one or two of the three variables are set to
true. This takes at most time proportional to for each clause (with a
rather clumsy mechanism for reading the certificate) and thus at most
time to verify the certificate. Since
we have , the certificate can be verified in time
, which is polynomial in the input size.
Hence our problem is in NP.
Mapping:
We prove this problem NP-complete by
transforming the known NP-complete problem NAE3SAT to it.
The sole difference between the two problems is that the variables may appear
complemented in clauses of NAE3SAT. We transform clause by clause;
the new instance will have the same variables as the original instance, plus
additional variables. Thus, we have four cases to
consider, according to how many complemented literals the NAE3SAT
clause has. If no complemented literals appear, then we leave
the clause unchanged and place it in the set of clauses for Positive
NAE3SAT. The other three cases require changes.
(We use underlining below to denote complementation, simply because overlining
is not available in HTML.)
-
One complemented literal: . Replace by the clauses
, , ,
, and . The first four clauses
force , so that the last clause becomes exactly the
same as the replaced clause.
-
Two complemented literals: . Simply
replace by the clause with one complemented literal
and apply the replacement given above. (Remember that NAE3SAT is
symmetric.)
-
Three complemented literals: .
Simply replace by the clause . (Remember that NAE3SAT
is symmetric.)
Resource Requirements:
For each clause the transformation takes time linear in the size of the new
clause. At worst, each clause gives rise to five new clauses and four new
variables; thus, from an original instance of size we get a new
instance of size in time linear in the output; but the first
is bounded above and below by a polynomial in and so is the second,
so that we have indeed a polynomial transformation.
Correctness:
Each clause has its own set of new variables. It is easily verified for each
clause (by exhaustion) that the substitute clauses admit a solution iff
the original one does. Since all clauses are transformed independently, it
follows that the entire set of new clauses is satisfiable iff the
original set is. This completes our proof.