Click to See Complete Forum and Search --> : A* dont find the shortest path


TeCNoYoTTa
February 14th, 2009, 02:10 PM
Hello All

I have Implemented A* Algorithm and Also Dijkstra .....but some times Dijkstra Finds Shorter Path than A* finds..... is the function that Calculate Estimated Distance must have some restrictions ???
or it's normal that A* didn't find the shortest path

i can put the algo or the code but when any one answer this questions

Thanks in Advance

Peter_B
February 14th, 2009, 03:02 PM
I have Implemented A* Algorithm and Also Dijkstra .....but some times Dijkstra Finds Shorter Path than A* finds.....

Well, there is obviously something wrong with your implementation of the A* algorithm then, as it should find the shortest path. But without seeing your code it is impossible to help you with this.

Russco
February 16th, 2009, 06:28 PM
What heuristic did you use??

This (http://www.policyalmanac.org/games/aStarTutorial.htm) is a decent resource for A* and will explain a few different ways of doing A*.

zkidkid
February 17th, 2009, 12:24 AM
IT's depend on which heuristic you choose.

So nobody can sure that A* always find the shortest path.