mirror of
https://github.com/onyx-and-iris/grokking-algorithms.git
synced 2024-09-27 11:07:03 +01:00
293 B
293 B
Shortest path for weighted graph (cost associated edges)
- Dijkstra's algorithm works when all weights are non-negative
- If there are negative weights use Bellman-Ford.
- The book demonstrates a function that operates on a list. Priority queue + min heap added for completeness.