简体   繁体   English

NP完整性-还原时需要澄清

[英]Np completeness - Need some clarification in reduction

I wanted some clarification in a concept. 我想对概念进行一些澄清。 For proving that a problem is NP complete, we use reductions. 为了证明问题是NP完整的,我们使用归约法。

Now suppose I have L<=L'. 现在假设我有L <= L'。 has the reduction to be from L to L' or can I do it it the reverse way also? 减少量是从L到L',还是也可以相反? ie Can I show that if L can be solved using L', then L' is NP-complete?? 即我可以证明如果可以使用L'求解L,那么L'是NP完全的?

I am pretty confused regarding this. 我对此很困惑。

For example. 例如。 for a reduction from ham cycle to ham path, we so it the backward way. 为了减少从火腿周期到火腿的时间,我们将其倒退。

Also, I am not able to solve the problem that I have to show that "is there a path from s to t in a graph with at least k edges" by reduction from ham cycle. 此外,我无法解决必须通过减少火腿周期来证明“在至少具有k条边的图形中是否存在从s到t的路径”的问题。

Please give me a clarification and guide me with the above problem. 请给我一个澄清,并指导我解决上述问题。 Thanks 谢谢

To show that a language L is NP-complete you actually need to prove two things, L is in NP and L is NP-hard. 为了证明语言L是NP完全的,您实际上需要证明两件事,L是NP中的语言,L是NP中难的语言。 Usually, proving L is in NP is easy, but don't forget to do it. 通常,证明L在NP中很容易,但不要忘记这样做。

The normal way of showing L is NP-hard is to show, in effect, that a polynomial-time decider for L could be used to build a polynomial-time decider for a language L' that has been proved to be NP-complete. 表示L是NP-hard的正常方法实际上是表明,可以使用L的多项式时间判定器来构建已证明是NP完全的语言L'的多项式时间判定器。

It has to be that way round. 一定要这样。 There are many cases of a polynomial-time decidable language L for which a polynomial time decider could be built from a polynomial time decider for an NP-complete language. 在许多情况下,多项式时间可判定语言L可以从NP完全语言的多项式时间判定器构建多项式时间判定器。 For example, consider the polynomial time decidable problem of coloring a graph with two colors, vs. the NP-complete general graph coloring problem. 例如,考虑用两种颜色为图形着色的多项式时间可确定问题,而不是NP完全的普通图形着色问题。

I gave you a hint in a comment on your question about Hamiltonian Cycle. 我在评论您有关汉密尔顿周期的问题时给了您一些提示。 Have you read the hint and thought about it? 您是否已阅读提示并进行了思考? If so, please respond in that question. 如果是这样,请回答该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM