Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is Manhattan distance an admissible heuristic?

Ain't it true that while counting the moves for 1 tile can lead to other tiles getting to their goal state? And hence counting for each tile can give us a count more than the minimum moves required to reach the goal state?

This question is in context of Manhattan distance for 15-Puzzle.

Here is the Question in different words:

Can we use Manhattan distance as an admissible heuristic for N-Puzzle. To implement A* search we need an admissible heuristic. Is Manhattan heuristic a candidate? If yes, how do you counter the above argument (the first 3 sentences in the question)?

Definitions: A* is a kind of search algorithm. It uses a heuristic function to determine the estimated distance to the goal. As long as this heuristic function never overestimates the distance to the goal, the algorithm will find the shortest path, probably faster than breadth-first search would. A heuristic that satisfies that condition is admissible.

like image 545
Akhil Avatar asked Dec 31 '10 17:12

Akhil


2 Answers

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.

like image 143
San Jacinto Avatar answered Nov 02 '22 22:11

San Jacinto


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)

like image 38
Menezes Sousa Avatar answered Nov 02 '22 23:11

Menezes Sousa