The relation between the complexity classes P and NP is one of the most important open problems in theoretical computer science and mathematics. It is studied in computational complexity theory, the part of the theory of computation dealing with the resources required during computation to solve a given problem. The most common resources are time (how many steps it takes to solve a problem) and space (how much memory it takes to solve a problem).
In this theory, the class P consists of all those decision problems that can be solved on a deterministic sequential machine in an amount of time that is polynomial in the size of the input; the class NP consists of all those decision problems whose positive solutions can be verified in polynomial time given the right information, or equivalently, whose solution can be found in polynomial time on a non-deterministic machine. Arguably, the biggest open question in theoretical computer science concerns the relationship between those two classes:
An important role in this discussion is played by the set of NP-complete problems (or NPC) which can be loosely described as the hardest problems in NP and therefore they are the least likely to be in P. More precisely, any problem in NP, through some efficient (takes at most a polynomial-bounded number of steps) transformation, can be expressed as a problem in NP-complete. Therefore if one finds an efficient (again, polynomial-bounded) solution to any NP-complete problem, then every problem in NP can be solved efficiently and therefore must be in P, hence proving P = NP. (See NP-complete for the exact definition.) Most theoretical computer scientists currently believe that the relationship among the classes P, NP, and NPC is as shown in the picture, with the P and NPC classes disjoint.
In essence, the P = NP question asks: if positive solutions to a YES/NO problem can be verified quickly, can the answers also be computed quickly? Here is an example to get a feeling for the question. Given a set of integers, does any subset of them sum to 0? For instance, does a subset of the set {-2, -3, 8, 15, -10} add up to 0? The answer is YES, though it may take a little while to find a subset that does - and if the set was larger, it might take a very long time to find a subset that does. On the other hand, if someone claims that the answer is "YES, because {-2, -3, -10, 15} add up to zero", then we can quickly check that with a few additions. Verifying that the subset adds up to zero is much faster than finding the subset in the first place. The information needed to verify a positive answer is also called a certificate. So we conclude that given the right certificates, positive answers to our problem can be verified quickly (i.e. in polynomial time) and that's why this problem is in NP.
The restriction to YES/NO problems doesn't really make a difference; even if we allow more complicated answers, the resulting problem (whether FP = FNP) is equivalent.
Now suppose there is an algorithm A(w,C) which takes two arguments, a string w which is an input string to our decision problem, and a string C which is a "proposed certificate", and such that A produces a YES/NO answer in at most c*nk steps (where n is the length of w and neither c nor k depend on w). Suppose furthermore that
The problem of deciding the truth of a statement in Presburger arithmetic is even harder. Fischer and Rabin proved in 1974 that every algorithm which decides the truth of Presburger statements has a runtime of at least for some constant c. Here, n is the length of the Presburger statement. Hence, the problem is known to need more than exponential run time. Even more difficult are the undecidable problems, such as the halting problem. They cannot be solved in general given any finite amount of time.
It is also intuitively argued that the existence of problems that are hard to solve but for which the solutions are easy to verify matches real-world experience.
On the other hand, some researchers believe that we are overconfident in P ≠ NP and should explore proofs of P = NP as well. For example, in 2002 these statements were made: *
One of the reasons why the problem attracts so much attention are the consequences of the answer.
A proof of P = NP could have stunning practical consequences, if the proof leads to efficient methods for solving every problem in NP. Many NP-complete problems are fundamental in many fields. One negative impact is that many forms of cryptography, notably public-key cryptography, would become trivially easy to "crack" and would therefore be useless. However, there are also enormous positive consequences that would follow from rendering tractable many currently mathematically intractable problems. For instance, many problems in operations research are NP-complete, such as some types of integer programming, and the travelling salesman problem, to name two of the most famous examples. Efficient solutions to these problems would have enormous implications for logistics. But it is by no means the only field that would be profoundly changed. To take one of very many examples, important problems in Protein structure prediction are NP-complete *; if these problems were solvable efficiently it could spur considerable advances in biology.
But such changes may pale into insigificance compared to the revolution an efficient method for solving NP-complete problems would cause in mathematics itself. According to Stephen Cook * (PDF),
Research mathematicians spend their careers trying to prove theorems, and some proofs have taken decades or even centuries to find after problems have been stated - for instance, Fermat's Last Theorem took over three centuries to prove. A method that is guaranteed to find proofs to theorems, should one exist of a "reasonable" size, would essentially end this struggle and transorm mathematics into a search for useful things to prove.
A proof that showed that P ≠ NP would clearly not have such stunning implications, but would represent a massive advance in computational complexity theory.
One of the most frequently-cited is a result involving oracles. Imagine you have a magical machine called an oracle that can solve only one problem, such as determining if a given number is prime, but can solve it in constant time. Our new question is now, if we're allowed to use this oracle as much as we want, are there problems we can verify in polynomial time that we can't solve in polynomial time? It turns out that, depending on the problem that the oracle solves, with certain oracles one has P = NP, while for other oracles one has P ≠ NP. The practical consequence of this is that any proof which can be modified to account for the existence of these oracles cannot solve the problem. Unfortunately, most known methods and nearly all classical methods can be modified in such a way (we say they are relativizing).
Furthermore, a 1993 result by Alexander Razborov and Steven Rudich showed that, given a certain credible assumption, proofs that are "natural" in a certain sense cannot solve the P = NP problem (see natural proof). This demonstrated that some of the most seemingly-promising methods of the time were also unlikely to succeed. As more theorems of this kind are proved, a potential proof of the theorem has more and more traps to avoid.
This is actually another reason why NP-complete problems are useful: if a polynomial-time algorithm, or the lack of one, can be demonstrated for an NP-complete problem, this would solve the P = NP problem in a way which is not excluded by the above results.
// Algorithm that accepts the NP-complete language SUBSET-SUM.
//
// This is a polynomial-time algorithm if and only if P=NP.
//
// "Polynomial-time" means it returns "YES" in polynomial time when
// the answer should be "YES", and runs forever when it's "NO".
//
// Input: S = a finite set of integers
// Output: "YES" if any subset of S adds up to 0.
// Otherwise, it runs forever with no output.
// Note: "Program number P" is the program you get by
// writing the integer P in binary, then
// considering that string of bits to be a
// program. Every possible program can be
// generated this way, though most do nothing
// because of syntax errors.
FOR N = 1...infinity
FOR P = 1...N
Run program number P for N steps with input S
IF the program outputs a list of distinct integers
AND the integers are all in S
AND the integers sum to 0
THEN
OUTPUT "YES" and HALT
If P = NP, then this is a polynomial-time algorithm accepting an NP-Complete language. "Accepting" means it gives "YES" answers in polynomial time, but is allowed to run forever when the answer is "NO".
Perhaps we want to "solve" the SUBSET-SUM problem, rather than just "accept" the SUBSET-SUM language. That means we want it to always halt and return a "YES" or "NO" answer. Does any algorithm exist that can provably do this in polynomial time? No one knows. But if such algorithms do exist, then we already know some of them! Just replace the IF statement in the above algorithm with this:
IF the program outputs a complete math proof AND each step of the proof is legal AND the conclusion is that S does (or does not) have a subset summing to 0 THEN OUTPUT "YES" (or "NO" if that was proved) and HALT
Hubert Chen, PhD, of Cornell University offers this tongue-in-cheek proof that P does not equal NP: "Proof by contradiction. Assume P = NP. Let y be a proof that P = NP. The proof y can be verified in polynomial time by a competent computer scientist, the existence of which we assert. However, since P = NP, the proof y can be generated in polynomial time by such computer scientists. Since this generation has not yet occurred (despite attempts by such computer scientists to produce a proof), we have a contradiction."*
The P = NP problem has also been featured in television:
Complexity classes | Conjectures | Unsolved problems in mathematics | Unsolved problems in computer science | Millennium Prize Problems
P versus NP | P/NP-Problem | Classes de complexité P et NP | P-NP 문제 | Classi di complessità P e NP | P=NP | P≠NP予想 | Равенство классов P и NP | P=NP | กลุ่มความซับซ้อน พี และ เอ็นพี | P ile NP arasındaki ilişki | P/NP问题
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Complexity classes P and NP".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world