SAT was the first problem known to be
NP-complete, as proved by
Stephen Cook at the
University of Toronto in 1971 and independently by
Leonid Levin at the
Russian Academy of Sciences in 1973. Until that time, the concept of an NP-complete problem did not even exist. The proof shows how every decision problem in the
complexity class NP can be
reduced to the SAT problem for CNF formulas, sometimes called
CNFSAT. A useful property of Cook's reduction is that it preserves the number of accepting answers. For example, deciding whether a given
graph has a
3-coloring is another problem in NP; if a graph has 17 valid 3-colorings, then the SAT formula produced by the Cook–Levin reduction will have 17 satisfying assignments. NP-completeness only refers to the run-time of the worst case instances. Many of the instances that occur in practical applications can be solved much more quickly. See
§Algorithms for solving SAT below.
3-satisfiability . The green vertices form a 3-clique and correspond to the satisfying assignment
x=FALSE,
y=TRUE. Like the satisfiability problem for arbitrary formulas, determining the satisfiability of a formula in conjunctive normal form where each clause is limited to at most three literals is NP-complete also; this problem is called
3-SAT,
3CNFSAT, or
3-satisfiability. To reduce the unrestricted SAT problem to 3-SAT, transform each clause to a conjunction of clauses where are
fresh variables not occurring elsewhere. Although the two formulas are not
logically equivalent, they are
equisatisfiable. The formula resulting from transforming all clauses is at most 3 times as long as its original; that is, the length growth is polynomial. 3-SAT is one of
Karp's 21 NP-complete problems, and it is used as a starting point for proving that other problems are also
NP-hard. This is done by
polynomial-time reduction from 3-SAT to the other problem. An example of a problem where this method has been used is the
clique problem: given a CNF formula consisting of
c clauses, the corresponding
graph consists of a vertex for each literal, and an edge between each two non-contradicting literals from different clauses; see the picture. The graph has a
c-clique if and only if the formula is satisfiable. There is a simple randomized algorithm due to Schöning (1999) that runs in time (4/3)
n where
n is the number of variables in the 3-SAT proposition, and succeeds with high probability to correctly decide 3-SAT. The
exponential time hypothesis asserts that no algorithm can solve 3-SAT (or indeed
k-SAT for any ) in time (that is, fundamentally faster than exponential in
n). Selman, Mitchell, and Levesque (1996) give empirical data on the difficulty of randomly generated 3-SAT formulas, depending on their size parameters. Difficulty is measured in number recursive calls made by a
DPLL algorithm. They identified a phase transition region from almost-certainly-satisfiable to almost-certainly-unsatisfiable formulas at the clauses-to-variables ratio at about 4.26. 3-satisfiability can be generalized to
-satisfiability (
-SAT, also
-CNF-SAT), when formulas in CNF are considered with each clause containing up to literals. However, since for any , this problem can neither be easier than 3-SAT nor harder than SAT, and the latter two are NP-complete, so must be -SAT. Some authors restrict -SAT to CNF formulas with
exactly literals. This does not lead to a different complexity class either, as each clause with fewer than literals can be padded with repeated copies of the same literals. Satisfiability and solution space geometry of -SAT problems with randomly generated clauses have been investigated statistically. As a function of the clause-to-variable ratio (also known as the density), the model exhibits various phase transitions regarding satisfiability and solution space geometry. For satisfiability, there exists a sharp threshold such that with high probability a solution exists if and only if the density remains below this threshold. Well below the satisfiability threshold, the solution space also undergoes a geometric phase transition, namely that it shatters into exponentially many, well-separated clusters. The onset of this phase transition coincides with the known algorithmic threshold, suggesting a link between geometry and algorithmic intractability. == Special instances of 3SAT ==