Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3RckKrNbvvStS36UM
8 lines
311 B
Plaintext
8 lines
311 B
Plaintext
One negative edge: A->B 1, A->C 2, C->B -5
|
|
==========================================
|
|
|
|
Dijkstra.run(g, A) throws : Dijkstra needs non-negative weights; use Bellman-Ford instead
|
|
visited-set version, dist[B] : 1
|
|
lazy version, check removed, dist[B]: -3 (pops 4)
|
|
Bellman-Ford, dist[B] : -3
|