(6 pts) In the Traveling Salesman Problem, the goal is to find the shortest tour
through a set of cities in which each city is visited exactly once.
A tour starts at one city (we'll say any one), visits every city once, and
ends back at the first one.
Hill climbing algorithms produce rough solutions to problems, usually
much faster than a big search. We'd like to convert the Traveling Salesman Problem to
a hill-climbing problem, which could then use the function HILL-CLIMBING in Figure 4.2
(of addendum) to solve. To do this we need a complete-state formulation of the problem,
an objective function, and a method for determining new states from given ones.
You are given a set CITIES of N cities and you know for each pair Ci and Cj,
whether there is a road between Ci and Cj and the distance D(Ci,Cj) between them if there is
a road. (We'll assume at most one road between any pair.)
- (3 pts) Define the set of states S, the start state s0, and the objective
function f that takes in a given state s and produces a number indicating
the goodness of s based on path length (here the shorter the path, the
better the goodness).
- (3 pts) Devise a method to take one such state and produce multiple children
states by doing something to the given one. HINT: the state defines a path.
You can think of it as a string of cities or list of cities. What kinds of
things can you do to one path to produce other paths that might be shorter?
For example, you could swap 2 cities. Note: this is a thought question.