Pick the fix
Edges: A→B 2, A→C 3, C→B -2. Dijkstra from A settles B at 2 first. What is wrong?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A The route A→C→B costs 1, which is cheaper than the settled 2
Right: the negative edge makes a later route cheaper.
Settling assumes distances only grow along a route, which a negative edge breaks.
Why not the others?
- B B should be settled at 3. The true shortest distance to B is 1.
- C Nothing; Dijkstra handles this case. Once B is settled it is never revised, so the answer stays 2.