## Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education

# Chapter 11 - Artificial Intelligence - Section 11.3 - Reasoning - Questions & Exercises - Page 514: 7

#### Answer

The problem here is that our heuristic scheme ignores the value of keeping the hole adjacent to the tiles that are out of place. If the hole is surrounded by tiles in their correct position, some of these tiles must be moved before those tiles still seeking their correct place can be moved. Thus it is incorrect to consider all those tiles surrounding the hole as actually being correct. To fix this flaw, we might first observe that a tile in its correct position but blocking the hole from incorrectly positioned tiles must be moved away from its correct position and later moved back. Thus each correctly positioned tile on a path between the hole and the nearest incorrectly positioned tile accounts for at least two moves in the remaining solution. We can, therefore, modify our projected cost calculation as follows: First, calculate the projected cost as before. However, if the hole is totally isolated from the incorrectly positioned tiles, find the shortest path between the hole and an incorrectly positioned tile, multiply the number of tiles on this path by two, and add the resulting value to the previously projected cost. With this system, the leaf nodes in Figure 11.10 have projected costs of 6, 6, and 4 (from left to right), and thus the correct branch is pursued initially. Our new system is not foolproof. For example, consider the following configuration. The solution is to slide the 5 tiles down, rotate the top two rows clockwise until those tiles are correct, move the 5 tiles back up, and finally move the 8 tiles to its correct position. However, our new heuristic system wants us to start by moving the 8 tiles because the state obtained by this initial move has a projected cost of only 6 compared with the other options that have costs of 8. #### Work Step by Step

The problem here is that our heuristic scheme ignores the value of keeping the hole adjacent to the tiles that are out of place. If the hole is surrounded by tiles in their correct position, some of these tiles must be moved before those tiles still seeking their correct place can be moved. Thus it is incorrect to consider all those tiles surrounding the hole as actually being correct. To fix this flaw, we might first observe that a tile in its correct position but blocking the hole from incorrectly positioned tiles must be moved away from its correct position and later moved back. Thus each correctly positioned tile on a path between the hole and the nearest incorrectly positioned tile accounts for at least two moves in the remaining solution. We can, therefore, modify our projected cost calculation as follows: First, calculate the projected cost as before. However, if the hole is totally isolated from the incorrectly positioned tiles, find the shortest path between the hole and an incorrectly positioned tile, multiply the number of tiles on this path by two, and add the resulting value to the previously projected cost. With this system, the leaf nodes in Figure 11.10 have projected costs of 6, 6, and 4 (from left to right), and thus the correct branch is pursued initially. Our new system is not foolproof. For example, consider the following configuration. The solution is to slide the 5 tiles down, rotate the top two rows clockwise until those tiles are correct, move the 5 tiles back up, and finally move the 8 tiles to its correct position. However, our new heuristic system wants us to start by moving the 8 tiles because the state obtained by this initial move has a projected cost of only 6 compared with the other options that have costs of 8. see the following image : After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.