2

Let's check together whether the TSP-decision problem is NP-complete. Maybe it will help me to understand things better.

Question for TSP-decision problem: Given n cities and a tour from length $k$. The traveller starts at an arbitrary city, visits every other city just once and returns to the starting point. Does a tour from length $\leq{} k$ exist?

Let's first check whether the TSP is in NP:

A proof is given. Proof in this case is a tour. For it to be in NP, we must be able to verify this proof with a deterministic algorithm in polynomial time. So first we have to check, whether every city is only visited once. This can be done at most in $O(n^2)$. Next we need to calculate the distances and sum them up. This can be done as well at most in $O(n^2)$. The last step is to check whether the calculated length is $\leq{} k$. The hole process would require a polynomial time $\rightarrow 2 n^2 = O(n^2)$.

So the TSP-decision problem is in NP. What about the NP-hardness? We don't need to prove that, because Richard M. Karp proved that the Hamiltonian Circuit is NP-complete. The TSP is a special case of the Hamiltonian Circuit, therefore we know TSP must be NP-complete as well. NP-complete means = NP-hard and NP.

Is this possible with TSP-optimization problem?

Question for TSP-optimization: Given n cities and a tour from length $k$. A traveller starts at an arbitrary city and visits every other city just once and returns to the starting point. Is tour from length k the shortest tour? We can check in polynomial time, that every city is visited once. However we can't check whether $k$ is really the shortest tour, because we would have to check every other possible tour as well. That would mean $(n-1)!$ possible tours. And this would make the hole process above exponential.

So TSP-optimization problem is not in NP? Therefore it is not NP-complete, but NP-hard?

Anything wrong about my thoughts?

clemens
  • 382
  • 2
  • 12
Meliss
  • 31
  • 1
  • 3

2 Answers2

1

Only decision problems can be NP-hard or NP-complete; these are problems for which the answer is either Yes or No.

Optimization problems have an optimal solution as an answer. The associated decision problem is, given an instance and a value, whether the the value of an optimal solution is as good or better than the given value.

When we say that an optimization problem is NP-hard, we mean that its associated decision problem is NP-hard; it is an abuse of terms. We could also say that an optimization problem is NP-complete if its associated decision problem is NP-complete.

The TSP optimization problem is, given a graph, find a TSP tour of shortest length. The associated decision problem is, given a graph and a value $k$, decide whether the shortest TSP tour has length at most $k$. These are different than the problems that you describe.

Sometimes we are interested in a weaker version of the optimization problem, namely, given an instance, find the value of an optimal solution. This is the perspective usually considered in the field of hardness of approximation, in which the goal is to show that it is NP-hard to even approximate the optimal value.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
-2

I would like to point out that the TSP optimization problem returns a Minimum length Hamiltonian-Cycle for the graph. Now, our job to prove this problem is in NP class invloves

Checking whether the Minimum length falls within a range.

Now this range is calculated by adding the weight of n-1 number of edges in increasingly sorted order for the minimum bound and decreasingly sorted order for the maximum bound (This maximum or minimum values are not necessarily cycle-lengths). This whole checking process can be done in polynomial time. Hence, TSP optimization problem also lies in NP class.

If anyone thinks that the way of proving this problem to be NP class isn't correct, I would also point out what Raphael originally posted :

However we can't check whether k is really the shortest tour, because we would have to check every other possible tour as well. That would mean (n-1)! possible tours. And this would make the hole process above exponential.

This problem itself is similar to the TSP problem and thus is not what we want to look for.

P.S. Please correct me if I'm wrong anywhere !