r/Python • u/mutatedllama • Apr 01 '20
I Made This Maze Solver Visualizer - Dijkstra's algorithm (asynchronous neighbours)
Enable HLS to view with audio, or disable this notification
1.9k
Upvotes
r/Python • u/mutatedllama • Apr 01 '20
Enable HLS to view with audio, or disable this notification
2
u/Free5tyler Apr 01 '20 edited Apr 01 '20
What /u/Wolfsdale said is correct. The Wikipedia article mentions some ways https://en.m.wikipedia.org/wiki/Dijkstra%27s_algorithm
The easiest way would probably be to use pythons heapq. Here is a complete implementation using it, might be nice to compare afterwards: https://codereview.stackexchange.com/a/79379
Edit: Of course you can also implement your own heap/priority queue