9

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.

Ken Bloom
  • 57,498
  • 14
  • 111
  • 168
Akhil
  • 2,269
  • 6
  • 32
  • 39
  • 3
    Can you give some more background on what the problem is? Depending on the problem, Manhattan distance could either be perfectly admissible or entirely inadmissible. – templatetypedef Dec 31 '10 at 18:05
  • Manhattan Distance for 15-Puzzle – Akhil Dec 31 '10 at 18:10
  • 2
    Manhattan Distance is a metric for distance or work, not a class of problems. _DESCRIBE_ the _PROBLEM_. – San Jacinto Dec 31 '10 at 18:12
  • 2
    @San The problem is this http://en.wikipedia.org/wiki/Fifteen_puzzle – Dr. belisarius Dec 31 '10 at 18:15
  • Nevertheless, I don't understand the question – Dr. belisarius Dec 31 '10 at 18:17
  • Does the added detail in the question help or what part is not clear – Akhil Dec 31 '10 at 18:18
  • @Akhil The allowed movements in the 15-puzzle form a _grupoid_ http://en.wikipedia.org/wiki/Groupoid, so the distance to solution is not the geometric distance but the number of grupoid operations you need to perform. I don't post this as an answer, just because I'm not sure what you are really asking – Dr. belisarius Dec 31 '10 at 18:21
  • @belisarius Thanks, that makes more sense. – San Jacinto Dec 31 '10 at 18:22
  • 1
    @belisarius: An "admissible heuristic" in A* search is an estimate of how close you are to your goal that never overstates the distance. That guarantees finding the shortest (or least-cost) path. This is a real question, although one requiring the knowledge of some specific terminology, and should be re-opened. – David Thornley Jan 20 '11 at 15:31
  • @David I intended to mean that to know how far you are from the solution you need to count grupoid operations and not spacial distance. To put it simply, consider the chess horse movements: being closer (in the space sense) does not mean fewer movements left. Voting to reopen. – Dr. belisarius Jan 20 '11 at 15:46
  • 1
    @David: it is now reopened, and also retagged so that it has tags that put it where people who have the requisite knowledge can find it. To someone who has the requisite knowledge, the question was *mostly* clear to begin with, though a link to Wikipedia for the 15 puzzle (or a description of it) would have been a good idea to start with. – Ken Bloom Jan 21 '11 at 16:03

2 Answers2

14

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.

San Jacinto
  • 8,774
  • 5
  • 43
  • 58
  • I got it! I am sorry for being not so clear. This happened may be because I had not given enough thought to the doubt I was facing – Akhil Dec 31 '10 at 18:28
6

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)

Menezes Sousa
  • 1,448
  • 2
  • 18
  • 18
  • 2
    Thank you `University of California, Irvine` – Abdullah Feb 03 '16 at 22:03
  • Sorry for reviving this old thread. I just wanted to ask how did you arrive at this: h(s∗) ≥ h(s0) − C∗ – Donald Feb 22 '18 at 15:40
  • @Donald Assume you move along a path from s0 and make C* steps. The value of your heuristic can only decrease by C*, hence the heuristic value at any endpoint sf of that path can never be lower than h(s0) - C*, i.e. h(sf) ≥ h(s0) - C*. However, one of the possible endpoints is s*, hence h(s*) ≥ h(s0) - C*, which by assumption is greater than 0. Hence we have h(s*) > 0, which is a contradiction, completing the proof. – Peiffap Mar 10 '22 at 14:12