Attic › Computer science › P versus NP problem
NP-complete problems are the hardest problems in NP, and a fast solution to one would solve them all
About NP-completeness
To find out if P equals NP, researchers do not need to test every problem in NP one by one. Instead, they focus on a special group of the hardest problems in NP, called NP-complete problems. If someone finds a fast algorithm for just one NP-complete problem, that algorithm can be used to quickly solve every other problem in NP.
This connection works through a method called a polynomial-time reduction. A reduction is a fast procedure that translates an instance of one problem into an instance of a second problem. If Problem A can be translated into Problem B in polynomial time, and a computer can solve Problem B in polynomial time, then the computer can also solve Problem A in polynomial time:
1. Take the input for Problem A and translate it into an input for Problem B.
2. Run the fast algorithm for Problem B to get an answer.
3. Translate that answer back into the answer for Problem A.
A problem is NP-complete if it is in NP and every other problem in NP can be translated into it in polynomial time. In 1971, Stephen Cook and, independently, Leonid Levin in 1973 proved that NP-complete problems exist. This result, the Cook–Levin theorem, showed that the Boolean satisfiability problem (SAT) is NP-complete. SAT asks whether there is a way to assign "true" or "false" to a set of variables to make a complex logical formula true. Cook and Levin showed that the step-by-step verification process of any NP problem can be written as a giant SAT formula.
Once SAT was proved to be NP-complete, researchers could prove another NP problem was NP-complete simply by showing that SAT, or another known NP-complete problem, translates into it. More than 3,000 important problems are now known to be NP-complete:
* The travelling salesman problem asks if a delivery driver can visit a list of cities and return home while driving less than a given distance.
* The knapsack problem asks if a set of items with different weights and values can fit into a bag of a given weight limit while reaching a target value.
* Generalized Sudoku (on an n² × n² grid) is also NP-complete.
Because all NP-complete problems can be translated into one another, they share the same fate. If a mathematician finds a polynomial-time algorithm for Sudoku, the travelling salesman problem, or SAT, then P = NP. Conversely, proving that even one NP-complete problem cannot be solved in polynomial time would prove that P ≠ NP.
Next: Most computer scientists think P does not equal NP, and modern cryptography relies on this
Fact-checked against P versus NP problem on Wikipedia
Part of the Computer science syllabus: Computational Complexity
See it on the timeline of Computer science