Definition
SAT to Independent Set
There is a polynomial-time many-one reduction from the SAT problem to the Independent Set problem:
Construction
Take a SAT instance in conjunctive normal form
Construct an independent set instance as follows:
- Create one vertex for every occurrence of a literal . Occurrences of the same literal in different clauses are distinct vertices.
- For each clause , join all of its vertices pairwise, making them a clique. An independent set can therefore contain at most one vertex from each clause.
- Join two vertices from different clauses whenever their literals are complementary: one represents and the other represents . An independent set therefore cannot choose incompatible truth values for one variable.
- Set
The graph is covered by clause cliques. Hence every independent set has size at most , and an independent set of size at least must choose exactly one literal-vertex from every clause.
Correctness
The formula is satisfiable if and only if the constructed graph has an independent set of size at least .
Correctness
Forward
Suppose that an assignment satisfies . Every clause then contains a true literal. Choose one such literal-vertex from each clause clique. No two chosen vertices lie in the same clique. Moreover, two complementary literals cannot both be true under one assignment, so no two chosen vertices are joined by a conflict edge. The chosen vertices therefore form an independent set of size .
Backward
Suppose that has an independent set with . Since contains at most one vertex from each of the clause cliques, it follows that and contains exactly one vertex from every clause. No selected literals are complementary because every complementary pair is joined by a conflict edge. Assign each variable according to its selected occurrences and assign all remaining variables arbitrarily. This assignment makes every selected literal true, so every clause contains a true literal and is satisfiable.
Running time
Let
be the number of literal occurrences in . The construction creates vertices and at most edges, so both its running time and its output size are polynomial in the input size. For a SAT input not already in CNF, a polynomial-size equisatisfiable CNF can first be obtained by introducing names for subformulas.
NP-completeness
SAT is NP-hard, so the reduction proves that Independent Set is NP-hard. Together with membership in NP, this proves that Independent Set is NP-complete.
Example
Four clauses
Consider
The reduction creates four three-vertex clause cliques and sets . It also adds conflict edges between every pair of occurrences labelled and , and , and , or and .
Using subscripts to identify clauses,
is an independent set of size : it chooses one vertex from each clause and contains no complementary pair. The corresponding assignment satisfies all four clauses; may be assigned arbitrarily.