This is puz, a program for experimenting with 8-puzzle heuristics. It
takes as input a stored hashtable representing all solvable 8-puzzle
states, and how many moves they are from the optimal solution, and
compares that to a expression that combines various other computable
metrics about puzzle states. An example expression:
m + (n / 4) + (e / 2)
The available metrics are:
m - The sum of the Manhattan distances of each tile from its place
in the goal state.
M - Same as 'm', but doesn't count the blank square.
n - The neighbor distance; that is, the sum of the distances of
each tile from its neighbor tiles (for example, tile 1 has
neighbors 2 and 8) in the goal state.
N - Same as 'n', but doesn't count the blank square.
e - Distance a tile is from its "home edge." The home edge is the
top edge for tiles 1 and 2, the right edge for tiles 3 and 4,
the bottom edge for tiles 5 and 6, and the left edge for tiles
7 and 8.