For this lab, we will apply A* search to the eight puzzle problem. The eight puzzle consists of a three by three board with eight numbered tiles and a blank space. A tile adjacent to the blank space can slide into the space. The object is to figure out the steps needed to get from one configuration of the tiles to another.
For this problem, a state should specify the location of each the eight tiles as well as the blank space in the three by three grid. The operators are most efficiently represented as moving the blank left, right, up, or down, rather than creating operators for each of the numbered tiles.
For example, suppose we wanted to get from the initial state to the goal state given below.
1 2 3 1 2 3 8 6 -> 8 4 7 5 4 7 6 5 initial goalWe could accomplish this with the following sequence of operators on the blank, R=right, L=left, U=up, D=down.
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 8 6 R 8 6 D 8 6 4 L 8 6 4 U 8 4 7 5 4 7 5 4 7 5 7 5 7 6 5 initial goal
1 2 3 1 3 1 3 4 1 3 7 1 2 8 1 2 2 6 3 7 3 4 7 4 5 8 4 8 2 4 8 6 2 4 2 5 8 3 7 4 4 5 6 1 5 6 3 7 6 5 7 6 5 7 5 8 7 6 6 5 4 6 5 3 1 8 7 8 2 8 1 2 goal A B C D E F G H
Node Expansions Problem BFS A*(tiles) A*(dist) A B C D E F G H
Use cs63handin to submit your eight puzzle file. Your table of test results and discussion of the results should be included in the file as comments. If you need to change the search file, you may turn in an updated version of that as well.