Optimization versus search. Recall the traveling salesman problem: TSP Input: A matrix of distances; a budget b Output: A tour which passes through all the cities and has length b, if such a tour exists. The optimization version of this problem asks directly for the shortest tour. TSP-OPT Input: A matrix of distances Output: The shortest tour which passes through all the cities. Show that if TSP can be solved in polynomial time, then so can TSP-OPT
Read moreTextbook Solutions for Algorithms
Question
Optimization versus search. Recall the traveling salesman problem:
TSP
Input: A matrix of distances; a budget b
Output: A tour which passes through all the cities and has length \(\leq b\), if such a tour exists.
The optimization version of this problem asks directly for the shortest tour.
TSP-OPT
Input: A matrix of distances
Output: The shortest tour which passes through all the cities.
Show that if TSP can be solved in polynomial time, then so can TSP-OPT.
Solution
Step 1 of 4
Travelling salesman problem (TSP) is defined as:
Given a list of cities and the distance between each pair of cities and a budget b. We have to find the path with costs b, visits all the cities exactly once and returns to the same city where we started.
TSP-OPT is defined as:
Given a list of cities and the distance between each pair of cities. The problem is to find the shortest path which starts from a city, visits all the cities exactly once and returns to the same city where we started.
full solution