Dragonfall
- 1,023
- 5
Given an answer to the traveling salesman problem, how do you check it in polynomial time? It seems you must know the length of every route and compare it to the answer.
Alkatran said:I don't think there is a polynomial time algorithm that verifies a given path is the minimum. However, there is one for the decision problem "Is there a tour shorter than L?"
Moo Of Doom said:How does that not verify that a given tour is shortest? If you can decide in polynomial time whether there is a shorter tour than L, then if the answer turns out negative, then L is the shortest tour.
Dragonfall said:Then what is the difference between the verification of the two? If you are given a hamiltonian path, you can get a length L, and if there is no tour whose length is shorter than L, it is the shortest path.
Alkatran said:Verifying an answer to the decision problem is just summing up the path lengths you're given to make sure they're less than L, and making sure all the cities are visited exactly once.