|
|
|
|
|
by yumario
2347 days ago
|
|
I believe A* should always give the minimum path as long the heuristic is optimistic. It will become a greedy search if the heuristic is pessimistic. If the heuristic is "perfect" i.e heuristic(x to y) = min_cost(x to y) the the search will be optimal (i.e no nodes that do not belong with the path will be explored) Yep after playing around with it for a bit it didn't give a minimum path. I believe something is wrong with the heuristic you are using. Edit:
You can prove A* will give a min path as long as: heuristic(x to y) <= min_cost(x to y).
Problem seems to be here https://github.com/ssaric/algoviz/blob/master/src/util/GridN...
I think it should be a matter of removing "times 100" |
|
I got my knowledge about heuristics from here:
http://theory.stanford.edu/~amitp/GameProgramming/Heuristics...