| • Science | • People | • Locations | • Timeline |
| Contents | ||
One example of an NP-complete problem is the subset sum problem which is: given a finite set of integers, determine whether any non-empty subset of them sums to zero. A supposed answer is very easy to verify for correctness, but no-one knows a significantly faster way to solve the problem than to try every single possible subset, which is very slow.
At present, all known algorithms for NP-complete problems require time that is exponential in the problem size. It is unknown whether there are any faster algorithms. Therefore, to solve an NP-complete problem for any nontrivial problem size, one of the following approaches is used:
A decision problem C is NP-complete if
"Reducible" here means that for every problem L, there is a polynomial-time many-one reduction, a deterministic algorithm which transforms instances l ∈ L into instances c ∈ C, such that the answer to c is YES if and only if the answer to l is YES.
A consequence of this definition is that if we had a polynomial time algorithm for C, we could solve all problems in NP in polynomial time.
This definition was given by Stephen Cook in 1971. At first it seems rather surprising that NP-complete problems should even exist, but in a celebrated theorem Cook proved that the Boolean satisfiability problem is NP-complete. Since Cook's original results, thousands of other problems have been shown to be NP-complete by reductions from other problems previously shown to be NP-complete; many of these problems are collected in Garey and Johnson's, 1979 book Computers and Intractability: A Guide to NP-completeness.
A problem satisfying condition 2 but not necessarily condition 1 is said to be NP-hardIn computational complexity theory, NP-hard (Non-deterministic Polynomial-time hard) refers to the class of decision problems that contains all problems H such that for all decision problems L in NP there is a polynomial-time many-one reduction to H''..