The sliding-tile puzzle consists of three black tiles, three white tiles, and an empty space in the configuration shown in Figure 4.29. The puzzle has two legal moves with associated costs:
A tile may move into an adjacent empty location. This has a cost of 1. A tile can hop over one or two other tiles into the empty position. This has a cost equal to the number of tiles jumped over.
The goal is to have all the white tiles to the left of all the black tiles. The position of the blank is not important.
a. Analyze the state space with respect to complexity and looping.
b. Propose a heuristic for solving this problem
Textbook, p. 162, exercise 5:
http://www.uoitc.edu.iq/images/documents/informatics-institute/exam_materials/artificial%20intelligence%20structures%20and%20strategies%20for%20%20complex%20problem%20solving.pdf
Answer:
(a) One of the rules is, it is possible to move backwards. Also, the rules can allow loops, then the graph search is implemented. There are 6 moves if the blank space comes to an end. The blank space can be anywhere in the cells because the position of the blank is not important. So there are 7 choices for the blank space. If the blank space is located somewhere, there will be remaining 6 spaces in which the 3 white tiles can be located (6C3). The white tiles are identical, so they can be arranged in (6*5*4)/3! ways. There are remaining 3 spaces. The black tiles can be located into those. They are done with 140 different states in the graph.
There is another way: It can be done by permutation of the cells divided by the arrangements of the white and black cells. This can be written as 7! / (3!+3!).
(b) The justifiable and monotonic one is breadth-first search (BFS). The heuristic of counting the tiles to reach the goal state is justifiable. This type of heuristic would be to number (count) all the white cells on the wrong side of each of the black cells. Counting the cells out of their place is not a monotonic one. A* search is also justifiable and monotonic.