8.1.
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 .
证明: 若 S 为图 G 中所有边的长度之和,显然所求最短回路的长度不会超过
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 .
证明: 若 S 为图 G 中所有边的长度之和,显然所求最短回路的长度不会超过