В чем разница между «Решением» и «Проверкой» в теории сложности?


16

В « Теории вычислений Майкла Сипсера» на странице 270 он пишет:

P = класс языков, для которых членство может быть решено быстро.
NP = класс языков, для которых членство может быть проверено быстро.

В чем разница между «решено» и «проверено»?


1
Кстати, я уверен, что кавычки не являются формальными определениями P и NP Sipser использует. Определения (или некоторые из первых результатов) должны касаться вопроса.
Рафаэль

Ответы:


12

Задача определения членства такова: для любого входного значения определить, будет ли x L , т.е. вычислить следующую функцию:xxL

χL(x)={1xL0xL

С другой стороны, задача проверки членства заключается в следующем: учитывая любые входные данные и (предлагаемое) доказательство (или свидетельство ) членства, быстро проверить, является ли x L этим доказательствомxxL ¹.

nNn(n,{i1,,ik})j=1kij=n. Which is easier?

G=(V,E)k(G,(v1,,vn)), verify wether the path v1vn visits all nodes exactly once and has weight at most k. Which is harder?


  1. So you will say "no" if xL but the proof is wrong. That is fine, though, as we consider nondeterministic machines in this context; it is only important that we can guess the correct proof and verify it (quickly).

Actually, if you can verify membership in polynomial time with a deterministic Turing machine M, it's quite easy to build a non-deterministic TM M' which decides membership: just enumerate non-deterministically all the possible inputs and then compose with M.
Romuald

8

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 e 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).

Используя наш сайт, вы подтверждаете, что прочитали и поняли нашу Политику в отношении файлов cookie и Политику конфиденциальности.
Licensed under cc by-sa 3.0 with attribution required.