先决条件: NP完成
NP问题:
NP问题集的问题很难找到但易于验证,并且可以通过非确定性机器在多项式时间内解决。
NP-Hard问题:
如果存在NP完全问题Y,则问题X为NP-难问题,这样Y可以在多项式时间内还原为X。 NP-Hard问题与NP-Complete问题一样困难。 NP-Hard问题不必在NP类中。
NP完全问题:
如果存在NP问题Y,则问题X是NP完全的,因此Y在多项式时间内可简化为X。 NP问题和NP问题一样困难。如果问题既是NP问题又是NP-Hard问题的一部分,则它是NP-Complete。一台不确定的图灵机可以在多项式时间内解决NP-Complete问题。
NP-Hard和NP-Complete之间的区别:
NP-hard | NP-Complete |
---|---|
NP-Hard problems(say X) can be solved if and only if there is a NP-Complete problem(say Y) that can be reducible into X in polynomial time. | NP-Complete problems can be solved by a annon-deterministic Algorithm/Turing Machine in polynomial time. |
To solve this problem, do not have to be in NP . | To solve this problem, it must be both NP and NP-hard problems. |
Do not have to be a Decision problem. | It is exclusively a Decision problem. |
Example: Halting problem, Vertex cover problem, Circuit-satisfiability problem, etc. | Example: Determine whether a graph has a Hamiltonian cycle, Determine whether a Boolean formula is satisfiable or not, etc. |