Algorithms · NP-Completeness: P, NP, NP-Hard, Reductions and the Standard Problems
The Venn diagrams
7.1 Under the (widely believed) assumption
+---------------------------------------------+
| NP |
| +-------------------+ |
| | P | |
| | | NP-complete |
| | sorting, MST, | +-------------+ |
| | shortest path, | | SAT, 3-SAT | |
| | 2-SAT, matching, | | clique, VC | |
| | primality, LP | | HC, TSP(d) | |
| +-------------------+ | subset sum | |
| +-------------+ |
+---------------------------------------------+
NP and co-NP are two overlapping regions.
Their intersection contains P (and problems such as
primality, factoring, which are in NP ∩ co-NP).
NP-complete problems lie in NP but, unless NP = co-NP,
outside co-NP.
Under : P is a proper subset of NP and NP-complete problems lie in . They are also outside co-NP unless (a separate open question: alone does not settle it).
7.2 Under the hypothetical
+---------------------------------------------+
| |
| P = NP = co-NP |
| (everything collapses into one class; |
| NP-complete problems are in P too) |
| |
+---------------------------------------------+
If , then every NP-complete problem has a polynomial-time algorithm, and . NP-hard problems that are not in NP (like the halting problem) remain outside.
7.3 What each statement implies — a table
| Statement | Implication |
|---|---|
| Some NP-complete problem is in P | |
| Some NP-complete problem is not in P | |
| Some problem in NP is not in P | No NP-complete problem is in P |
| ; every NP-complete problem is in P | |
| NP-complete problems are outside P (they are outside co-NP only if also ) | |
| Some NP-complete problem is in co-NP | |
| Every NP-hard problem that is in NP is in P | |
| NP-hard problems in NP are not in P |