A More Informed Heuristic

Although the number of misplaced tiles heuristic never overestimates, we can do better without overestimating.

Consider these two states and their heuristics:

The state on the right is better because the 1 and 8 tiles are closer to their destinations.

A more informed heuristic is the sum of the "Manhattan distances" that the tiles are out of place.