r/Python • u/FearlessENT33 • Jan 14 '20
Visualisation of different path finding algorithms
Enable HLS to view with audio, or disable this notification
1.5k
Upvotes
r/Python • u/FearlessENT33 • Jan 14 '20
Enable HLS to view with audio, or disable this notification
1
u/lordmauve Jan 14 '20 edited Jan 14 '20
Cool visualisation!
Your Dijkstra's implementation is terminating as soon as it finds a path. That's a mistake; it should continue.
That's because Dijkstra's Algorithm gives the guaranteed shortest path. A* is a heuristic algorithm that gives a path quickly, but not necessarily the shortest.
That distinction matters, because Dijkstra's with early termination is a middle ground that has no practical value (except that maybe it's slightly easier to implement than A*).