Write a Lisp program that can use a variety of search methods to solve
8-puzzles. The program should take as input an initial state, a goal
state (or goal-state test), a search method, and (if appropriate) a
heuristic function. You should use at
least the following search methods:
- depth-first (or depth-limited),
- breadth-first,
- uniform cost,
- best-first,
- A*.
For best-first and for A*, you should use the three different hs that we
discussed in lecture, namely:
- h_a(n) = W(n) = number of misplaced tiles in node n
-
h_b(n) = P(n) = sum of city-block (``Manhattan'')
distances that each tile is from its goal-state location
-
h_c(n) = P(n) + 3*S(n), where
S(n) = the sequence score =
for all non-central tiles, if it is not followed by correct successor,
score 2 else score 0, & if central tile is not blank, then it scores 1.
For more information on this heuristic, see:
- Nilsson, Nils J. (1971), Problem-Solving Methods in Artificial
Intelligence (New York: McGraw-Hill): 65-68. (SEL Q335 .N52 1971;
also on reserve at SEL)
- Doran, J. E., & Michie, D. (1966), ``Experiments with the Graph
Traverser Program'', Proceedings of the Royal Society of London,
Series A. Mathematical and Physical Sciences 294: 235-259,
esp. pp. 242-250.
(SEL Q41 .L7(2); also on reserve at SEL)