Def. Algorithm A runs in polynomial time if for every string s, A(s)
terminates in ≤ p( ?s?) “steps,” where p(?) is some polynomial function.
在多项式时间内可以求解的问题就是P类问题。
Def. Algorithm C(s, t) is a certifier for problem X if for every string s : s ∈ X iff there exists a string t such that C(s, t) = yes.
NP = set of decision problems for which there exists a poly-time certifier.
?C(s, t) is a poly-time algorithm.
?Certificate t is of polynomial size: ?t? ≤ p(?s?) for some polynomial p(?)
在多项式时间内可以验证一个解的问题就是NP问题。
关于NP举一个例子:
可满足性问题和三元可满足性问题都属于NP问题,我们不一定在多项式时间里找到全部解但是我们可以在多项式时间内验证一个解的成立!
验证步骤是这样的:
HAMILTON-PATH: Given an undirected graph G = (V, E), does there exist a
simple path P that visits every node?
Certificate: A permutation π of the n nodes.
Certifier: Check that π contains each node in V exactly once,
and that G contains an edge between each pair of adjacent nodes
哈密尔顿圈问题是一个NP问题,我们可以很容易找到一个解比如包含全部结点的路径并在多项式时间内验证解成立!
ps:简单路径:指图G(V,E)中路径上的顶点都不相同的路径。
P. Decision problems for which there exists a poly-time algorithm.
NP. Decision problems for which there exists a poly-time certifier.
EXP. Decision problems for which there exists an exponential-time algorithm.
EXP是指一个问题在指数级时间内存在解。
Does P = NP? [Cook 1971, Edmonds, Levin, Yablonski, G?del]
Is the decision problem as easy as the certification problem?
If yes… Efficient algorithms for 3-SAT, TSP, VERTEX-COVER, FACTOR, …
If no… No efficient algorithms possible for 3-SAT, TSP, VERTEX-COVER, …
原文:https://www.cnblogs.com/xhj928675426/p/13973151.html