Attic › Computer science › P versus NP problem
The P versus NP problem asks whether a computer can quickly solve any problem whose answer it can quickly check
The P versus NP problem is the most important unsolved question in computer science. It asks a basic question about computation: if a computer can quickly check that an answer to a problem is correct, can it also quickly find that answer from scratch?
Computer scientists measure the difficulty of a problem by its time complexity, which is how the number of steps needed to solve it grows as the input size n gets larger. A problem is fast to solve if an algorithm can finish in polynomial time, meaning the number of steps is at most n raised to a fixed power, such as n² or n³.
1. P (polynomial time) is the class of problems that a standard computer can solve in polynomial time. For example, sorting a list of names is in P. Even for millions of names, a computer sorts them quickly.
2. NP (nondeterministic polynomial time) is the class of problems where a computer can check a proposed solution in polynomial time. A Sudoku puzzle on an n² × n² grid is in NP. Finding the solution to a giant Sudoku grid can take a computer an extremely long time, because the number of possibilities grows explosively. However, if someone gives you a completed grid, a computer can quickly check each row, column, and box to see if the answer is correct.
Every problem in P is also in NP, because if you can quickly solve a problem from scratch, you can verify a proposed answer simply by solving the problem yourself and comparing the results. The P versus NP problem asks whether the reverse is true: is every problem that is easy to check also easy to solve (P = NP), or are there problems in NP that are inherently hard to solve (P ≠ NP)?
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