Mathematical Logic And Computation Codexery

P versus NP

Can every quickly verified problem be quickly solved?

P versus NP

The P versus NP problem is a central open question in theoretical computer science. It asks, informally, whether any problem whose correct answer can be checked quickly can also be solved quickly. "Quickly" here means that an algorithm exists which completes the task in polynomial time—that is, the time needed grows no faster than a polynomial function of the input size, as opposed to, say, an exponential function. The set of decision problems solvable in polynomial time is called "P" or "class P." For other problems, no fast solution is known, but if a proposed answer is given, it can be verified in polynomial time. This set of problems is called "NP," which stands for "nondeterministic polynomial time."

Resolving P versus NP would reveal whether problems that can be verified in polynomial time can also be solved in polynomial time. If P ≠ NP—which most researchers believe—then some problems in NP are harder to solve than to verify: they cannot be solved in polynomial time, even though their answers can be checked quickly.

This problem is often called the most important open problem in computer science. Beyond its significance in computational theory, a proof either way would deeply affect mathematics, cryptography, algorithm research, artificial intelligence, game theory, multimedia processing, philosophy, economics, and many other fields. It is one of the seven Millennium Prize Problems chosen by the Clay Mathematics Institute, each offering a US$1,000,000 prize for the first correct solution.

**Example** Consider a yes/no problem: given an incomplete \(n^2 \times n^2\) Sudoku grid, is there at least one legal solution where every row, column, and \(n \times n\) square contains the integers 1 through \(n^2\)? For a candidate solution, it is straightforward to verify a "yes" instance. However, no polynomial-time algorithm is known that can correctly answer "yes" or "no" for all instances of this generalized problem. Thus, generalized Sudoku is in NP (quickly verifiable), but it may or may not be in P (quickly solvable). (A fixed-size Sudoku has only finitely many possible grids, so that specific case is in P, as the answer can be found by table lookup.)

**History** The precise formulation of the P versus NP problem was introduced in 1971 by Stephen Cook in his paper "The complexity of theorem proving procedures," and independently by Leonid Levin in 1973. Earlier hints of the underlying issues existed. In 1955, mathematician John Nash wrote to the National Security Agency, suggesting that the time to crack a sufficiently complex code would grow exponentially with key length. If proven, this would imply what is now called P ≠ NP, since a proposed key can be verified in polynomial time. In a 1956 letter from Kurt Gödel to John von Neumann, Gödel asked whether theorem-proving (now known to be co-NP-complete) could be solved in quadratic or linear time, and noted that if so, the discovery of mathematical proofs could be automated.

**Context** The relationship between P and NP is studied in computational complexity theory, which examines the resources—most commonly time (number of steps) and space (amount of memory)—required to solve a problem. Such analysis requires a model of the computer. Typically, the model assumes a deterministic machine (given its state and inputs, only one action is possible) that is sequential (it performs actions one after another). In this theory, class P consists of all decision problems solvable on a deterministic sequential machine in time polynomial in the input size. Class NP consists of all decision problems whose positive solutions can be verified in polynomial time given the right information—equivalently, whose solution can be found in polynomial time on a nondeterministic machine. More formally, a language \(L\) is in NP if there exists a relation \(R\) decidable in polynomial time and a polynomial \(p\) such that \(x \in L\) if and only if there exists a \(y\) with \(|y| \leq p(|x|)\) and \(R(x, y)\). In this formulation, P versus NP asks whether polynomial-time decidable predicates are closed under polynomially bounded existential quantification.

field
Theoretical computer science
known_for
Central unsolved problem in computational complexity theory
related_classes
P (polynomial time solvable) and NP (nondeterministic polynomial time verifiable)

Lore & Background

The P versus NP problem is a central unsolved question in theoretical computer science. It asks whether every decision problem for which a proposed positive answer can be verified quickly can also be solved quickly. "Quickly" means an algorithm exists that runs in polynomial time, where the time to complete the task is bounded by a polynomial function of the input size. The class of problems solvable in polynomial time is called P. The class of problems whose answers can be verified in polynomial time is called NP, which stands for "nondeterministic polynomial time." If P does not equal NP, which is widely believed, then there exist problems in NP that are harder to compute than to verify: they cannot be solved in polynomial time, though their answers can be verified in polynomial time. The problem is considered the most important open problem in computer science, with profound implications for mathematics, cryptography, artificial intelligence, game theory, and economics. It is one of the seven Millennium Prize Problems, each carrying a one-million-dollar prize for a correct solution. An example of an NP problem is the generalized Sudoku puzzle: given an incomplete grid, verifying a proposed solution is straightforward, but no known polynomial-time algorithm can always determine whether a solution exists. The problem was formally defined in 1971 by Stephen Cook and independently by Leonid Levin. Earlier hints of the problem appeared in a 1955 letter from John Nash to the National Security Agency, speculating that cracking complex codes would take exponential time, and in a 1956 letter from Kurt Gödel to John von Neumann, asking whether theorem-proving could be solved in quadratic or linear time. The classes P and NP are studied in computational complexity theory, which examines the time and space resources required to solve problems. The class P consists of decision problems solvable on a deterministic sequential machine in polynomial time, while NP consists of problems whose positive solutions can be verified in polynomial time given the right information, or equivalently, solved in polynomial time on a nondeterministic machine. It is known that P is a subset of NP. The central question is whether these two classes are equal. Polls of researchers conducted by William Gasarch in 2001, 2011, and 2018 showed increasing belief that P does not equal NP, with 88

Reader's Guide

The P versus NP problem is foundational to computational complexity theory, which studies the resources required during computation to solve a given problem. The class P consists of decision problems solvable on a deterministic sequential machine in polynomial time; the class NP consists of decision problems whose positive solutions are verifiable in polynomial time given the right information. Clearly P ⊆ NP, but whether P equals NP remains unknown. If P ≠ NP, which is widely believed, it would mean there are problems in NP that are harder to compute than to verify. A proof either way would have profound implications for mathematics, cryptography, algorithm research, artificial intelligence, game theory, multimedia processing, philosophy, economics, and many other fields. The concept of NP-completeness is useful in attacking the question: NP-complete problems are those that any other NP problem can be reduced to in polynomial time, and if any NP-complete problem is in P, then P = NP. The Boolean satisfiability problem (SAT) was the first natural problem proven to be NP-complete by the Cook–Levin theorem.

Did You Know?

More in Mathematical Logic And Computation 1-21

Spotted an error? Know more?

This is a living reference — every entry is fact-audited, and reader corrections feed straight into our audit queue. Suggest an edit · See this site's audit record

Comments

Loading…
Open in the interactive codex →