NP verifier-based definition

让人想犯罪 __ 提交于 2020-01-16 08:13:01

问题


i'm a computer science student and i'm having some problem understanding the verifier based definition of NP problems.

The definition says that a problem is in NP if can be verified in polinomial time by a deterministic turing machine, given a "certificate".

But what happens, if the certificate is exactly the problem solution? It's only a bit, and it's obviuosly polinomially limited by the input size, and it's obviously verifiable in constant, thus polinomial time.

Therefore, each decision problem would belong to NP.

Where am i wrong?


回答1:


But what happens, if the certificate is exactly the problem solution? It's only a bit, and it's obviuosly polinomially limited by the input size, and it's obviously verifiable in constant, thus polinomial time.

Why "obviously"? You might have to spend an exponential amount of time verifying the solution, in which case the problem need not be in NP. The point is that, even though the certificate is a single bit for a decision problem, you don't know whether that bit should be zero or one to solve the problem. (If you always did know that, then any decision problem in P or in NP would be solvable in constant time.)




回答2:


Not all problems can be verified in polynomial time even though the solution is polynomial in length. Lets consider the Travelling Salesman Problem. Given a solution you can only verify whether the given solution is a tour of the cities but you cannot tell whether it is the minimum length tour, unless you explore all possible tours.

Hence, in most of the cases the decision problem is NP-Complete (e.g. to find whether the set of cities contain a tour) while the optimization problems are NP-Hard (e.g. finding the minimum length tour)



来源:https://stackoverflow.com/questions/6574796/np-verifier-based-definition

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!