0

Considering three heuristics for 8-puzzle:

 h1(n) = number of misplaced tiles
 h2(n) = total Manhattan distance
 h3(n) = max(h1, h2)

In an 8-puzzle, I was performing different puzzles and noticed that the h3 heuristic function (max) seems to provide the same solution as total manhattan distance heuristic. This is using the A star search algorithm.

I was wondering if the heuristic function of total manhattan distance always dominates over number of misplaced tiles?

1 Answers1

2

Yes, because you would get the same value only if all misplaced tiles are just next to their correct place (i.e. manhattan distance = 1). In all other cases the manhattan distance for a misplaced tile is > 1.

Henry
  • 42,982
  • 7
  • 68
  • 84
  • Another way to put it, the "misplaced tiles" heuristic is basically `sum(min(1, manhatten(x)) for x in tiles)` – tobias_k Oct 11 '20 at 08:59
  • Will there ever be a case where number of misplaced tiles heuristic is greater than manhattan? –  Oct 11 '20 at 10:28
  • @Lebronfan23 every misplaced tile is at least 1 away according to manhattan. So the count of misplaced tiles is always lesss or equal to the sum of manhattan distance. – Henry Oct 11 '20 at 10:32