2 KiB
2 KiB
id | title | author | prerequisites | ||
---|---|---|---|---|---|
sp | Shortest Paths with Non-Negative Edge Weights | Benjamin Qi |
|
- Shortest Path Without Negative Edge Weights
- Shortest Path With Negative Edge Weights
- All Pairs Shortest Path
Non-Negative Edge Weights
Use Dijkstra's Algorithm.
Standard
Tutorial
- CSES 13.2
- 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
- cp-algo Floyd-Warshall
Problems
- USACO Moortal Cowmbat
- Use APSP before running DP.
- SPOJ Arbitrage