Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is Dijkstra algorithm better tham A* algorithm for finding shortest path?

How is Dijkstra algorithm better tham A* algorithm for finding shortest path?

like image 984
Manish Basdeo Avatar asked Dec 09 '22 10:12

Manish Basdeo


1 Answers

It is not better at finding the shortest path. As long as you have an admissible heuristic for A* it will find the shorted path quicker than Dijkstra's would.

And as Mehrad pointed out in the comments, A* degrades into Dijktras if you give it a heuristic function that returns 0.

The wikipedia article for A* has a ton of good information on all of this.

like image 157
Matthew Manela Avatar answered May 03 '23 18:05

Matthew Manela