简单介绍
Loosely speaking, the class P is the class of decision problems that can be solved by a deterministic Turing machine using a polynomial amount of computation time, or polynomial time.
NP (nondeterministic polynomial time) is the class of decision problems solvable in polynomial time by a nondeterministic Turing machine.
The P vs. NP problem is to determine whether every language accepted by some nondeterministic algorithm in polynomial time is also accepted by some (deterministic) algorithm in polynomial time.(是否所有能在多项式时间内验证得出正确解的问题,都是具有多项式时间算法的问题。)
P vs. NP: it is open if problems exist where finding a solution is harder than verifying it.
——即:
P问题:多项式时间算法有解(算法的时间复杂度可用多项式表示),可快速计算。(例:冒泡排序——O())
NP问题:多项式时间内不确定是否有解,但在多项式时间可验证解。(例:环路问题)
/*P问题是NP问题的子集*/
NPC问题(NP-complete问题):若此类问题有多项式解,则所有NP问题都有多项式解。
/*NPC问题由所有NP问题约化得到*/
NP-hard问题:可以不属于NP问题,但若NP-hard问题有多项式解,则NP问题都有多项式解。