I am trying to understand how to determine what the true cost of a coordinate graph is (h*(n)) so as to determine an admissible heuristic.
In a normal coordinate graph would the true cost be from one coordinate to the other be the Manhattan distance (Assuming movement is limited to adjacent grid squares)? If so, then would straight line distance would be an admissible heuristic for this kind of problem?
i.e. (0,1) to (21,35) MHD = 55 and SLD = 39.96 units
If there were obstacles in the way (i.e. shapes that force the path to reroute around them) between the coordinates, would the Manhattan Distance, instead of being the "true cost" be valid as a admissible heuristic (the true cost would need to be manually counted i guess?)? The SLD should also be a admissible heuristic but would not be as dominant as MHD.
So to summarize, in a coordinate graph would the true cost be the MHD and a valid heuristic the SLD? And in a coordinate graph with obstacles, the true cost would generally be >= to the MHD?
Assuming you are in a grid world where the only allowed movements are N,S,W,E
(or adiacent cells in general) yes.
The Manhattan distance would be the true cost (and even the best heuristic!)
SLD
would of course be smaller but also less informative than MHD
that represents h*
.
In case there are obstacles on your path MHD
will never overestimate the true cost to the goal, being admissible. You could use it to solve the problem but of course the solution would not be as good as in the case of no obstacles, in terms of node expanded.
This does not hold when you can move diagonally, but that's a different story.
Finally, MHD
dominates SLD
for each state thus it is a better heuristic function as they are both admissable.