Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is TSP NP-Hard?

I read the following in one of the answer on SO :

The Traveling Salesman Problem, as normally posed, is to find the cheapest route connecting all cities. That isn't a decision problem, and we can't verify any proposed solution directly. We can restate it as a decision problem: given a cost C, is there a route that's cheaper than C? This problem is NP-complete, and with a little work we can solve the original TSP about as easily as the modified, NP-complete, form. Therefore, the TSP is NP-hard, since it's at least as hard as an NP-complete problem.

I understand that a TSP is NP-Complete but how the problem is NP-Hard ? I read that problems that are in NP but not in P are NP-Hard. I cannot relate this thing to the TSP . Please explain this.

like image 574
Suhail Gupta Avatar asked Jan 29 '26 18:01

Suhail Gupta


2 Answers

NP-Hard problems are those problems for which every problem in NP has a polynomial time (Cook or Karp, multiple definitions) reduction to. These could contain problems which are not in NP and in fact need not even contain decideable problems (like the Halting problem).

NP-Complete problems are those problems in NP which are also NP-Hard.

If P is not equal to NP, then there are infinitely many problems in NP which are neither in P, nor NP-Complete (Ladner's theorem).

like image 170
Trixter Avatar answered Feb 01 '26 08:02

Trixter


The optimization version of TSP problem has been shown NP-hard, but yet known whether it's in NP or not since there is yet known verification algorithms.

The decision version of the TSP problem has been shown NP-complete (both in-NP and NP-hard).

like image 29
SkyOasis Avatar answered Feb 01 '26 10:02

SkyOasis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!