HW5 Chp4 Ans
HW5 Chp4 Ans
Chapter 4
1. The sliding-tile puzzle consists of three black tiles, three white tiles, and an empty space in the configuration shown below:
B B B W W W
1) A tile may move into an adjacent empty location. This has a cost of 1.
2) A tile may 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 move all the white tiles to the left of all the black tiles. The position of the blank is not important.
a) Draw the first three levels of the state space of the sliding-tile puzzle. When you generate the children of a node, make sure you add
only those children nodes that have not been included to the state space graph. Label each arc with the cost of the move.
Level 0 BBB_WWW
1 1 2 1 1 2
1 1 1 1 1 1
1
1 2
B_WBBWW
Counting tiles out of place is not monotonic, but is more informed than breadth-first search. An easy way to prove that a heuristic
is non-monotonic is to watch its value change as it goes along a search path.
c) Based on the partial state space you have drawn, find a partial solution path using the best-first search and the evaluation function:
Draw the partial state space that shows your search process (refer to Fig. 4.16 on p-141). You will draw only those nodes that are
generated by the best-first search algorithm. If a node is generated but not opened, connect it with a dotted line. If a node is opened,
connect it with a solid line. Use the double solid line to show your partial solution path.
Level 0 BBB_WWW(9)
1 2
1 2 1 1
Level 1 BB_BWWW(10) B_BBWWW(10) _BBBWWW(11) BBBW_WW(10) BBBWW_W(10) BBBWWW_(11)
1 2 1
2 2 2
1 1 1
1 1
1 2
BWB_BWW(11) BW_BBWW(11) _BBWBWW(11) BBWWB_W(11) B_BWWBW(11) _BBWWBW(11) BBWW_BW(11)