typically used to prove their NP-completeness The
Cook–Levin theorem states that the
Boolean satisfiability problem is NP-complete, establishing for the first time that such problems do exist. In 1972,
Richard Karp proved that several other problems were also NP-complete (see
Karp's 21 NP-complete problems); thus, there is a class of NP-complete problems, besides Boolean satisfiability. Since these 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 . The easiest way to prove that some new problem is NP-complete is first to prove that it is in NP, and then to reduce some known NP-complete problem to it. Therefore, it is useful to know a variety of NP-complete problems. The list below contains some well-known problems that are NP-complete when expressed as decision problems. •
Boolean satisfiability problem (SAT) •
Knapsack problem •
Hamiltonian path problem •
Travelling salesman problem (decision version) •
Subgraph isomorphism problem •
Subset sum problem •
Clique problem •
Vertex cover problem •
Independent set problem •
Dominating set problem •
Graph coloring problem •
Sudoku To the right is a diagram of some of the problems and the
reductions typically used to prove their NP-completeness. In this diagram, problems are reduced from bottom to top. Note that this diagram is misleading as a description of the mathematical relationship between these problems, as there exists a
polynomial-time reduction between any two NP-complete problems; but it indicates where demonstrating this polynomial-time reduction has been easiest. There is often only a small difference between a problem in P and an NP-complete problem. For example, the
3-satisfiability problem, a restriction of the Boolean satisfiability problem, remains NP-complete, whereas the slightly more restricted
2-satisfiability problem is in P (specifically, it is
NL-complete), but the slightly more general max. 2-sat. problem is again NP-complete. Determining whether a graph can be colored with 2 colors is in P, but with 3 colors is NP-complete, even when restricted to
planar graphs. Determining if a graph is a
cycle or is
bipartite is very easy (in
L), but finding a maximum bipartite or a maximum cycle subgraph is NP-complete. A solution of the
knapsack problem within any fixed percentage of the optimal solution can be computed in polynomial time, but finding the optimal solution is NP-complete.
Intermediate problems An interesting example is the
graph isomorphism problem, the
graph theory problem of determining whether a
graph isomorphism exists between two graphs. Two graphs are
isomorphic if one can be
transformed into the other simply by renaming
vertices. Consider these two problems: • Graph Isomorphism: Is graph G1 isomorphic to graph G2? • Subgraph Isomorphism: Is graph G1 isomorphic to a subgraph of graph G2? The Subgraph Isomorphism problem is NP-complete. The graph isomorphism problem is suspected to be neither in P nor NP-complete, though it is in NP. This is an example of a problem that is thought to be
hard, but is not thought to be NP-complete. This class is called
NP-Intermediate problems and exists if and only if P≠NP. == Solving NP-complete problems ==