Data Structures and Algorithms — Homework 12

Due by 11:59pm Wednesday, April 24

Reading

Exercises

  1. Finish the heuristic-search version of the 8-puzzle solver from Lab 12. Complete the table from part 7 of the lab worksheet showing the performance of your program on each of the starting states under the various conditions given in the table. You should test your heuristic functions individually, to make sure they work as expected. To help you out, the correct heuristic values for each of the starting boards are shown below. For example, calling z.heuristic2(goal2) should return 15.

    Board/Goalheuristic1heuristic2
    a / goal122
    b / goal156
    c / goal178
    d / goal178
    e / goal178
    f / goal1712
    g / goal1813
    h / goal1816
    x / goal2819
    y / goal2711
    z / goal2815

Turning in Your Homework