问题描述:

I'm trying to understand the formal definition of NP Complete and had some questions. I was wondering if someone can provide more insight.

The Jon Kleinberg algorithms book says that if every NP problem can be reduced to a problem X, then problem X is in the set NP Complete.

Now since P is a subset of NP, it follows that we can reduce any problem in P to an NP Complete problem in polynomial time. This leads to a contradiction that since the reduction is in polynomial time, we can solve this NP Complete problem in polynomial time. This cannot be true. So I'm not sure where this reasoning is wrong.

Also if we are able to reduce any NP problem in polynomial time to NP Complete, then why do we say that NP Complete is harder. Since the reduction is in polynomial time, asymptotically speaking, it should not make a difference.

Now since P is a subset of NP, it follows that we can reduce any problem in P to an NP Complete problem in polynomial time. This leads to a contradiction that since the reduction is in polynomial time, we can solve this NP Complete problem in polynomial time.

You get the direction of the reduction wrong. If you can reduce any NP-complete problem to a given P problem, then P = NP, because that means this P problem is harder than or equivalent to any NP-Complete problem. The fact that a P problem can be reduced to NP problems doesn't show that it is harder than NP -- it shows that it's easier than NP, which is not surprising or contradictory.

Pretend that we can reduce shortest path to 1 run of TSP, and pretend that TSP can only be solved by by enumeration (exponential complexity). Then, shortest path is polynomial, the reduction is polynomial (O(1)), but the TSP is not polynomial. This is a **hypothetical** example. But hopefully, it shows that the fact TSP can solve SP in one run doesn't mean TSP is easy by any measure. The complexity of TSP is not constrained by the fact that it can easily solve SP.

您可能感兴趣的文章：

- Nest Camera: writing is_streaming field has no effect
- What is the hbase.zookeeper.quorum in hbase-site.xml
- hadoop - Visitor / User profiling based on clickstream data?
- c# Getting WinForm to acknowledge Process.StartInfo.WindowStyle when launched programmatically
- Is a JavaScript array order guarunteed?
- php - Reading a specific line from a text file
- clr - Any implementation of an Unrolled Linked List in C#?
- Finding Hudson Log Files
- Forward to a payment-gateway together with POST data using cURL (or any other PHP server side solution)
- WCF in Winforms app - is it always single-threaded?

随机阅读：

**推荐内容**-

**热点内容**