[英]How can some NP-Complete problems be also NP-Hard?
I'm trying wrap my heard around P, NP, NP-Complete and NP-Hard in an intuitive way so that I don't have to remember their definitions. 我正在尝试以一种直观的方式围绕P,NP,NP-Complete和NP-Hard听到我的声音,这样我就不必记住它们的定义了。
In the following image (the left hand scenario, P != NP), there's an overlapping area between NP-Complete and NP-Hard. 在下图中(左手的情况,P!= NP),在NP-Complete和NP-Hard之间存在重叠区域。 Does it mean that some problems are both NP-Complete and NP-Hard? 这是否意味着NP-Complete和NP-Hard都存在一些问题? I find that contradictory, according to this particular answer: What are the differences between NP, NP-Complete and NP-Hard? 根据这个特定答案,我发现这是矛盾的: NP,NP-Complete和NP-Hard有什么区别? . 。
The table in the above link says an NP-Complete problem is verifiable in polynomial time and an NP-Hard problem is not. 上面链接中的表格说,NP完全问题可以在多项式时间内验证,而NP硬问题则不能。 So how can there be an overlap? 那么怎么会有重叠呢?
Part of the definition of NP-completeness is being NP hard. NP完整性的部分定义是NP困难。 Therefore, every NP-complete problem is NP-hard. 因此,每个NP完全问题都是NP难的。 This is also reflected by both of your graphs. 这两个图也反映了这一点。
The table you linked to was wrong until I fixed it a few hours ago. 您链接到的表是错误的,直到几小时前我将其修复。 NP-Complete problems are a subset of NP problems, and all NP problems are verifiable in polynomial time by definition. NP-完全问题是NP问题的子集,并且所有NP问题根据定义都可以在多项式时间内验证。 NP-hard problems are those problems which are at least as hard as any other NP problem (which is sort of unintuitive, because problems not in NP can be NP-hard). NP难题是至少与任何其他NP问题一样困难的问题(这是不直观的,因为NP之外的问题可能是NP难题)。
To be NP-Complete a problem must be 要成为NP-Complete,必须解决一个问题
to be complete in a specific complexity class, a problem must be 要在特定的复杂性类别中完整,必须解决一个问题
We have to define "at least as hard". 我们必须定义“至少一样困难”。 Suppose we have a problem A in NP. 假设我们在NP中有一个问题A。 To prove it is NP-hard (and therefore NP-Complete), we show that all problems in NP can be converted to A in polynomial time. 为了证明它是NP难的(因此是NP完全的),我们证明NP中的所有问题都可以在多项式时间内转换为A。 Because A takes at least polynomial time to solve, and polynomials are closed under addition, the conversion is now negligible, and the runtime is the same as the runtime of A (in terms of it being polynomial or not). 因为A至少需要多项式时间来求解,并且多项式在加法之后被关闭,所以转换现在可以忽略不计,并且运行时间与A的运行时间相同(就其是否为多项式而言)。
Once you have one NP-Complete problem, you can prove a problem A in NP is NP-hard (and therefore NP-Complete) by taking another NP-Complete problem B and converting it to A in polynomial time. 一旦遇到一个NP完全问题,就可以通过采用另一个NP完全问题B并在多项式时间内将其转换为A来证明NP中的问题A是NP难的(因此是NP完全的)。
I hope this makes it clear that NP-Complete is a subset of NP-hard (and that the table you linked to was wrong). 我希望这可以清楚地表明NP-Complete是NP-hard的子集(并且链接到的表是错误的)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.