How is Manhattan distance an admissible heuristic?

Admissable heuristics must not overestimate the number of moves to solve this problem. Since you can only move the blocks 1 at a time and in only one of 4 directions, the optimal scenario for each block is that it has a clear, unobstructed path to its goal state. This is a M.D. of 1.

The rest of the states for a pair of blocks is sub-optimal, meaning it will take more moves than the M.D. to get the block in the right place. Thus, the heuristic never over-estimate and is admissible.

I will delete when someone posts a correct, formal version of this.


Formal Proof: By definition of h, h(s∗) = 0, if s∗ is the goal state. Assume for proof by contradiction that C∗ < h(s0) for some initial state s0. Note that, since each action can move only one tile, performing an action can at most reduce h by one. Since the goal can be reached in C∗ actions, we have h(s∗) ≥ h(s0) − C∗ > 0, which brings us to a contradiction since h(s∗) should be zero. Therefore, we must have h(s0) ≤ C∗ forall s0, and h is admissible. (Source: University of California, Irvine)