В « Теории вычислений Майкла Сипсера» на странице 270 он пишет:
P = класс языков, для которых членство может быть решено быстро.
NP = класс языков, для которых членство может быть проверено быстро.
В чем разница между «решено» и «проверено»?
В « Теории вычислений Майкла Сипсера» на странице 270 он пишет:
P = класс языков, для которых членство может быть решено быстро.
NP = класс языков, для которых членство может быть проверено быстро.
В чем разница между «решено» и «проверено»?
Ответы:
Задача определения членства такова: для любого входного значения определить, будет ли x ∈ L , т.е. вычислить следующую функцию:
С другой стороны, задача проверки членства заключается в следующем: учитывая любые входные данные и (предлагаемое) доказательство (или свидетельство ) членства, быстро проверить, является ли x ∈ L этим доказательством ¹.
. Which is easier?
, verify wether the path visits all nodes exactly once and has weight at most . Which is harder?
If we ignore efficiency issues, there is another example that illustrates the difference by analogy. We know that the halting problem is not decidable: given a code for a Turing machine, there is no effective way to determine whether the machine stops if it is run with no input.
But if a machine does halt, it is not hard to prove to someone else: just tell them how many steps the machine runs before it stops. They can run the machine for that many steps and know if you told the truth (ignoring efficiency, of course).
So the set of halting Turing machines is not decidable, but it is verifiable. Note that no proof has to be given for machines that don't halt. Verification is asymmetric in the sense that only membership in the set has the be verifiable, membership out of the set does not.
The situation with P and NP is analogous. A language is in NP if there is a system of proofs such that each object that is in the language has a short proof (bounded by a polynomial in the size of the object) that can be verified efficiently (with a number of steps bounded by a polynomial in the size of the input).
On the other hand, a language is in P if there is a way to tell whether an arbitrary object is or is not in the language using a number of steps bounded by a polynomial in the size of the object. Now we have to worry about arbitrary inputs, not just objects in the language. But this problem is symmetric: if a language is in P then so is its complement. The question whether the complement of every NP language is also an NP language is unsolved.
(This analogy mught suggest that NP problems are to P problems like r.e. sets are to computable sets. That is somewhat true, but it can be misleading. It is a basic fact that a set that is r.e. and co-r.e. is computable, while it is not known whether every set that is NP and Co-NP is in P).