CS 462: Homework #2. For both problems, submit an extensive summary of the results of your experiments including example runs. Problem 1: Draw a simplified map of Connecticut roads and cities. Represent the map as a search graph by means of property lists or association lists. Using breadth-first, depth-first, best-first and hill-climbing searches, find a path between two specified cities. Problem 2: From my Web site, get the code for the 5-puzzle problem. It contains functions for depth-first, breadth-first and best-first searches. You will experiment with two heuristic functions for the best-first search: one that counts the number of tiles in their proper places (it come with the code), and the second is the so-called "Manhattan distance". Manhattan distance computes the distance between two points on a plane as |x1 – x2| + |y1 – y2|, where (x1, y1) and (x2, y2) are their respective coordinates. In our case, we have a total of 6 points (tiles), and we want to compute their total distance, i.e. the distance between the current state and the goal state, (1 2 3 4 5 0). Given our representation, the coordinates of the tiles at the goal are as follows: - Tile 1: x1 = 0, y1 = 1. - Tile 2: x1 = 1, y1 = 1. - Tile 3: x1 = 2, y1 = 1. - Tile 4: x1 = 0, y1 = 0. - Tile 5: x1 = 1, y1 = 0. - Tile 0: x1 = 2, y1 = 0. Each state has its specific tile arrangement, for example for state (4 3 1 5 0 2), the coordinates of the tiles are: - Tile 1: x2 = 2, y2 = 1. - Tile 2: x2 = 2, y2 = 0. - Tile 3: x2 = 1, y2 = 1. - Tile 4: x2 = 0, y2 = 1. - Tile 5: x2 = 0, y2 = 0. - Tile 0: x2 = 1, y2 = 0. The distance between the two states, therefore, is 2 + 2 + 1 + 1 + 1 + 1 = 8 The implementation on this heuristic is given below. You must incorporate it in the code to compare the performance of the best-first search for both heuristic functions. Is any of them an admissible heuristic -- explain why or why not. Compare further the performance of best-first search to breadth-first and depth-first searches. Remember that the state space for this puzzle is divided into two separate graphs not reachable from each other. Carefully select initial states (think of a way to ensure that the final state is reachable from a given initial state). The Manhattan distance between two states, state and goal, is given below. As you insert it into the program, make sure you update the closerp predicate. (defun heuristic-Manhattan (state finish) (setf count 0) (progn (when (not (= (first state) (first finish))) (setf count (+ count (distance '0 '1 (first state) )))) (when (not (= (second state) (second finish))) (setf count (+ count (distance '1 '1 (second state))))) (when (not (= (third state) (third finish))) (setf count (+ count (distance '2 '1 (third state) )))) (when (not (= (fourth state) (fourth finish))) (setf count (+ count (distance '0 '0 (fourth state) )))) (when (not (= (fifth state) (fifth finish))) (setf count (+ count (distance '1 '0 (fifth state) )))) (when (not (= (sixth state) (sixth finish))) (setf count (+ count (distance '2 '0 (sixth state))))) count) ) (defun distance (x1 y1 tile) (cond ( (= tile 0) (+ (abs (- x1 2)) (abs (- y1 0 ))) ) ( (= tile 1) (+ (abs (- x1 0)) (abs (- y1 1 ))) ) ( (= tile 2) (+ (abs (- x1 1)) (abs (- y1 1 ))) ) ( (= tile 3) (+ (abs (- x1 2)) (abs (- y1 1 ))) ) ( (= tile 4) (+ (abs (- x1 0)) (abs (- y1 0 ))) ) ( (= tile 5) (+ (abs (- x1 1)) (abs (- y1 0 ))) ) ) )