mirror of
https://github.com/onyx-and-iris/grokking-algorithms.git
synced 2025-01-31 07:00:55 +00:00
6 lines
275 B
Markdown
6 lines
275 B
Markdown
|
# 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.
|
||
|
- Priority queue + min heap is optimal when compared to a function that operates on a list.
|