Compare versions
Version 1 → Version 2 (current). Removed · Added. This shows the entry's text as it is written, including its formatting marks.
Version 1 · Version 2 (current) · Version history
Side by side · Together
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](https://commons.wikimedia.org/wiki/File:Complexity_classes_sr_en.svg) by AlphaNPOmega, [CC BY-SA 3.0](https://creativecommons.org/licenses/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](https://commons.wikimedia.org/wiki/File:Hamiltonian_Dodecahedron_Graph.svg) by Zorgit, [CC BY-SA 3.0](https://creativecommons.org/licenses/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]
## What researchers believe
Most computer scientists conjecture that P and NP are different, meaning that some problems with quickly checkable answers cannot be solved quickly, although the opinion is not unanimous. Aaronson names Donald Knuth as a prominent computer scientist who has professed a belief that P = NP and Richard Lipton as one who professes agnosticism.[3] He also reports two polls of mathematicians and theoretical computer scientists run by William Gasarch. In the 2002 poll, 61 respondents said P differs from NP and 9 said they were equal; in the 2012 follow-up, 126 said they differ and again 9 said they are equal.[3]
Aaronson argues that many researchers feel about as confident that P differs from NP as they do about the Riemann Hypothesis, another conjecture that most experts believe without proof. One of his reasons is that the existence of any cryptographic one-way function, a transformation that is easy to compute but hard to invert, would already be enough to show that P differs from NP.[3] Cook's description gives a second reason, the long failure to find a fast algorithm for any of the many NP-complete problems.[1]
## Why a proof is hard
Complexity theorists have identified three technical barriers, called relativization, natural proofs and algebrization, that any proof that P differs from NP will need to overcome. Each has been shown to be surmountable in principle, but few results get past all of them at once.[3]
**Relativization.** In 1975 Baker, Gill and Solovay articulated this barrier. An oracle is a hypothetical black box that answers questions about some fixed set at no cost, and a proof "relativizes" if it still works when every machine in it is given access to the same oracle. Most of the standard techniques for comparing complexity classes relativize, but Baker, Gill and Solovay showed that the P versus NP question has "contradictory relativizations": there is an oracle relative to which P = NP and another relative to which P differs from NP. Any proof that settles the question must therefore use techniques that fail relative to some oracles.[3]
**Natural proofs.** The barrier was first stated in print in 1993 by Razborov and Rudich, though Aaronson writes that Michael Sipser and perhaps others knew of it in the 1980s. A lower-bound proof is called natural if it yields an algorithm that is constructive, running in time polynomial in the size of a function's truth table, and large, certifying that a randomly chosen function is hard with reasonable probability. Razborov and Rudich showed that natural proofs run into trouble once a circuit class is powerful enough to express pseudorandom functions, which are believed to exist under plausible hardness assumptions. Aaronson sees this as explaining why progress through circuit complexity stalled where it did, while stressing, as Razborov and Rudich did, that the lesson is not to give up. Diagonalization, the oldest technique in the field, avoids the natural proofs barrier, though it is blocked by relativization.[3]
**Algebrization.** In 2008 Aaronson and Wigderson showed that there is a third barrier. The arithmetic techniques used to prove that the classes IP and PSPACE are equal get around relativization, but they run up against a modified version of it that Aaronson and Wigderson called algebraic relativization, or algebrization. They showed that a proof that P differs from NP would need techniques that evade this barrier as well as natural proofs.[3]
Aaronson adds a more general reason. In case after case, there are surprisingly clever ways to avoid brute-force search, and the variety of those ways rivals the variety of mathematics itself.[3] He also discusses whether the question could turn out to be independent of the standard axioms of mathematics, and notes that the three barriers can be read as proofs of unprovability from systems of axioms capturing the techniques in question. Those axiom systems are known not to capture all of complexity theory, so, in his words, the barriers point to weaknesses in certain techniques rather than in the foundations of mathematics.[3]
## Sources
1. Stephen Cook, "The P versus NP Problem", official problem description, Clay Mathematics Institute (2000). https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf
2. "P vs NP", Clay Mathematics Institute, Millennium Prize Problems (page read December 2026). https://www.claymath.org/millennium/p-vs-np/
3. Scott Aaronson, "P =? NP", survey, University of Texas at Austin (2017). https://www.scottaaronson.com/papers/pnp.pdf
4. "Millennium Problems", Clay Mathematics Institute (page read December 2026). https://www.claymath.org/millennium-problems/