2.1 KiB
2.1 KiB
id | title | author | prerequisites | description | |
---|---|---|---|---|---|
sp | Shortest Paths with Non-Negative Edge Weights | Benjamin Qi |
|
Introduces Dijkstra's Algorithm for a single source as well as Floyd-Warshall for All-Pairs Shortest Path. |
Non-Negative Edge Weights
Use Dijkstra's Algorithm.
Standard
Tutorial
- CSES 13.2
- PAPS 12.3.1
- cp-algo Dijkstra (Dense Graphs)
- cp-algo Dijkstra (Sparse Graphs)
- Usually, it's this one that's applicable.
- CPC.8
Problems
- CSES
- USACO
- Milk Pumping
- fairly standard application
- Shortcut
- Fine Dining
- Milk Pumping
- Other
All Pairs Shortest Path (APSP)
Use the Floyd-Warshall algorithm.
Standard
Tutorial
- CPH 13.3
- PAPS 12.3.3
- cp-algo Floyd-Warshall
Problems
- USACO Moortal Cowmbat
- Use APSP before running DP.
- SPOJ Arbitrage