1.7 KiB
1.7 KiB
id | title | author | prerequisites | description | |
---|---|---|---|---|---|
sp-neg | Shortest Paths with Negative Edge Weights | Benjamin Qi |
|
Applications of Bellman-Ford. |
- Hasn't appeared in recent USACO Gold as far as I know.
- If no negative cycles, can use Shortest Path Faster Algorithm or modify Dijkstra slightly (though the same running time bound no longer applies).
Tutorial
- CPH 13.1
- cp-algo Bellman Ford
- Topcoder Graphs Pt 3
Problems
Simple Linear Programming
You can also use shortest path algorithms to solve the following problem (a very simple linear program).
Given variables
x_1,x_2,\ldots,x_N
with constraints in the formx_i-x_j\ge c
, compute a feasible solution.
Problems
- Restore Array
- Art (basically same as above)
- Timeline (Camp)
- equivalent to Timeline (Gold) except
N,C\le 5000
and negative values ofx
are possible.
- equivalent to Timeline (Gold) except