2 ms·
The two algorithms solve different (but related) problems. A* finds the shortest path from a source to a single target node. Dijkstra's finds the shortest paths
by Jtsummers 2y ago
The two algorithms solve different (but related) problems. A* finds the shortest path from a source to a single target node. Dijkstra's finds the shortest paths from a source to all other nodes. If you're using Dijkstra's as a search algorithm then it may be slower than A* (often will be, but it depends on the heuristic), but you'll be terminating the algorithm early (once your target has been found you don't need to continue the algorithm).
The algorithm under discussion is not that search-use of Dijkstra's, but the original all shortest paths use, so it's not directly comparable here to A*.
- fiddlerwoaroof 2y agoOk, this makes sense, it’s been a while since I did a deep dive into these algorithms for a roguelike project. This article I found really interesting at the time: https://roguebasin.com/?title=The_Incredible_Power_of_Dijkstra_Maps https://roguebasin.com/?title=The_Incredible_Power_of_Dijkst...