Version 1
Dec 2, 2026. Compare with the current version · Version history
P versus NP is the open question in computer science of whether every problem whose proposed answer can be checked quickly can also be solved quickly.[2]

Via Wikimedia Commons: Complexity classes sr en by AlphaNPOmega, CC BY-SA 3.0.
It is one of the seven Millennium Prize Problems of the Clay Mathematics Institute, and as of December 2026 the Institute lists it as unsolved.[2][4] The question matters beyond theory: most of the cryptography used on the Internet rests on the assumption that some problems with quickly checkable answers cannot be solved quickly.[1][3]
The question
Computer scientists measure how hard a problem is by how the number of steps an algorithm needs grows with the size of the input. The class P holds the decision problems (questions with a yes-or-no answer) that some algorithm can solve within a number of steps bounded by a fixed polynomial in the length of the input.[1] The standard formal model of a computer for this purpose is the Turing machine, introduced by Alan Turing in 1936.[1] Other computer models, such as machines with many tapes or with unbounded random-access memory, can generally be simulated by a Turing machine at the cost of at most squaring or cubing the running time, so P does not depend on which of these models is used.[1]
The class NP holds the problems whose yes-answers can be confirmed quickly when someone supplies a suitable proof, called a certificate. Formally, a problem is in NP if there is a checking procedure that runs in polynomial time and accepts exactly the yes-instances, each with some certificate of at most polynomial length.[1] The name stands for "nondeterministic polynomial time", because NP was first defined with nondeterministic machines, which may have more than one possible move from a given configuration. Defining it by a checking relation is now customary, and the two definitions are equivalent.[1]
Every problem in P is also in NP, since a procedure that can solve a problem can ignore the certificate and decide the answer itself.[1] The P versus NP question asks whether the reverse also holds, so that P = NP, or whether NP contains problems that no polynomial-time algorithm can solve.[1]
Two examples show the difference. The set of composite numbers is in NP: a divisor of the number is a certificate that anyone can check by division.[1] That set has since been shown to be in P as well, by a 2004 result of Agrawal, Kayal and Saxena.[1] The Clay Mathematics Institute's own page poses the question with the Hamiltonian path problem: given a number of cities, find a route that visits each of them without visiting any city twice. If someone gives a route, it is easy to check, but finding one is not easy. The page adds a second illustration, choosing which 100 of 400 university students receive dormitory places when some pairs of students are incompatible, and notes that checking every combination by brute force is impractical.[2]
The word "quickly" carries a caveat. A polynomial-time algorithm is not literally fast in every case: Cook points out that a program needing n to the power 100 steps could never run even on an input of size 10. The working assumption in the field, which he calls the feasibility thesis, is that a natural problem has a feasible algorithm exactly when it has a polynomial-time one.[1] The question also concerns the worst case over all inputs of a given size.[1] Computer scientist Scott Aaronson adds that it is not about whether heuristic methods, such as programs that solve satisfiability problems, often do well in practice.[3]
Origins and NP-completeness
The idea of polynomial-time computation as a mark of an efficient algorithm was introduced in the 1960s by Alan Cobham and Jack Edmonds, and Edmonds called polynomial-time algorithms "good algorithms". John von Neumann had distinguished polynomial-time from exponential-time algorithms in 1953.[1]
The question was posed in its modern form in 1971. The Clay Institute credits Stephen Cook and Leonid Levin with formulating it independently that year.[2] Aaronson notes that earlier writers had stated versions of it. In a 1955 letter to the United States National Security Agency, the mathematician John Nash conjectured that for sufficiently complex ciphers the time needed to find the key grows exponentially with the key's length, and wrote that he could not prove it.[3] In a 1956 letter to John von Neumann, Kurt Gödel asked about a machine that would decide yes-or-no mathematical questions in time proportional to the input length or its square, and observed that this would let machines replace much of a mathematician's mental effort on such questions, apart from choosing the axioms.[3]
Cook's 1971 paper introduced the notion of NP-completeness. A problem is NP-complete if it is in NP and every problem in NP can be converted into it by a polynomial-time translation, so that a fast algorithm for it would give a fast algorithm for all of NP.[1] The paper showed that several natural problems are NP-complete, among them satisfiability of logical formulas (whether some assignment of true and false to the variables makes a formula true), its restricted form 3-SAT, and subgraph isomorphism.[1] A year later Richard Karp showed that 20 other natural problems are NP-complete, which demonstrated how widely the theory applied. Karp also introduced the notation P and NP and the now-standard form of the definition.[1] Levin, working independently, defined a "universal search problem" that is similar to NP-completeness and gave six examples, including satisfiability.[1]

Via Wikimedia Commons: Hamiltonian Dodecahedron Graph by Zorgit, CC BY-SA 3.0.
Cook's description reports that many hundreds of NP-complete problems have been identified, among them SubsetSum (whether some of a set of positive integers add up to a target), finding a Hamiltonian cycle in a graph, and colouring a graph's vertices with three colours so that adjacent vertices differ. They give rise to scheduling and routing problems of industrial importance, and the 1979 book by Garey and Johnson lists 300 of them.[1] Because a fast algorithm for any one of them would settle the question in favour of P = NP, Cook cites the failure of a vast number of programmers and engineers to find one over the preceding 30 years as one of the reasons most complexity theorists believe that P and NP differ.[1]
Why the answer matters
If P = NP and the algorithm were efficient in practice, essentially all cryptography now used on the Internet, for example to send credit card numbers, would be broken. In most cryptography, finding the decryption key is an NP search problem, because it is known how to check whether a candidate key is right. The exceptions are systems such as the one-time pad and quantum key distribution, which do not rely on computational assumptions.[3] Cook gives a concrete figure: an algorithm that solved 3-SAT in n squared steps could be used to factor 200-digit numbers in a few minutes. An efficient factoring algorithm would break the RSA public-key scheme, and Cook's description lists integer factoring as an example of a problem in NP that seems unlikely to be either in P or NP-complete.[1]
A fast algorithm for NP-complete problems would also have positive consequences. Cook points out that it would let a computer find a formal proof of any theorem that has a proof of reasonable length, since a formal proof can be recognised in polynomial time, and that such theorems may include all of the Clay Institute's prize problems.[1] Aaronson draws the same conclusion: a person with an efficient algorithm of this kind could in principle solve all seven Millennium Prize Problems by having a computer search for formal proofs of the other six. If P is different from NP, as most computer scientists believe, a proof of that would have no such world-changing practical effect.[3]
The seven Millennium Prize Problems were announced on 24 May 2000 at the Collège de France in Paris, with a prize of $1 million for each from a $7 million fund. As of December 2026 the Institute's page lists one of the seven, the Poincaré conjecture, as solved.[4]
Sources
- Stephen Cook, "The P versus NP Problem", official problem description, Clay Mathematics Institute (2000). claymath.org/wp-content/uploads/2022/06/pvsnp.pdf
- "P vs NP", Clay Mathematics Institute, Millennium Prize Problems (page read December 2026). claymath.org/millennium/p-vs-np/
- Scott Aaronson, "P =? NP", survey, University of Texas at Austin (2017). scottaaronson.com/papers/pnp.pdf
- "Millennium Problems", Clay Mathematics Institute (page read December 2026). claymath.org/millennium-problems/