CSE422 Assignment 1 Uninformed and Local Search
CSE422 Assignment 1 Uninformed and Local Search
F igure1 : The track pieces in a wooden railway set; each is labeled with
the number of copies in the set. Note that curved pieces and “fork” pieces
(“switches” or “points”) can be flipped over so they can curve in either direc-
tion. Each curve subtends 45 degrees.
1. A basic wooden railway set contains the pieces shown in Figure 1. The task is to connect
these pieces into a railway that has no overlapping tracks and no loose ends where a train
could run off onto the floor
(a) Suppose that the pieces fit together exactly with no slack. Give a precise formulation
of the task as a search problem.
(b) Identify a suitable uninformed search algorithm for this task and explain your choice.
(c) Explain why removing any one of the “fork” pieces makes the problem unsolvable.
(d) Give an upper bound on the total size of the state space defined by your formulation.
(Hint: think about the maximum branching factor for the construction process and
the maximum depth, ignoring the problem of overlapping pieces and loose ends.
Begin by pretending that every piece is unique.)
(a) Show how this heuristic can be derived from a relaxed version of the TSP.
(b) Show that the MST heuristic dominates straight-line distance.
(c) Write a problem generator for instances of the TSP where cities are represented by
random points in the unit square.
(d) Find an efficient algorithm in the literature for constructing the MST, and use it
with A graph search to solve instances of the TSP.
3. Give the name of the algorithm that results from each of the following special cases:
(a) Local beam search with k = 1.
(b) Local beam search with one initial state and no limit on the number of states
retained.
(c) Simulated annealing with T = 0 at all times (and omitting the termination test).
(d) Simulated annealing with T = at all times.
(e) Genetic algorithm with population size N = 1..
4. Question 1 considers the problem of building railway tracks under the assumption that
pieces fit exactly with no slack. Now consider the real problem, in which pieces don’t fit
exactly but allow for up to 10 degrees of rotation to either side of the “proper” alignment.
Explain how to formulate the problem so it could be solved by simulated annealing.
5. In this exercise, we explore the use of local search methods to solve TSPs of the type
defined in Question 2.
(a) Implement and test a hill-climbing method to solve TSPs. Compare the results with
optimal solutions obtained from the A algorithm with the MST heuristic (Question
2).
(b) Repeat part (a) using a genetic algorithm instead of hill climbing. You may want
to consult Larra˜naga et al. (1999) for some suggestions for representations.
6. Generate a large number of 8-puzzle and 8-queens instances and solve them (where
possible) by hill climbing (steepest-ascent and first-choice variants), hill climbing with
random restart, and simulated annealing. Measure the search cost and percentage of
solved problems and graph these against the optimal solution cost. Comment on your
results.