← Graphs Quiz: all 8 questions
Graphs Quiz · Question 7 of 8
Dijkstra's algorithm works correctly only when edge weights are…
Dijkstra's algorithm works correctly only when edge weights are…
- A.All equal
- B.Non-negative
- C.Negative
- D.Integers
Answer & explanation
Correct answer: Non-negative
With negative edges, a node's distance could still improve after it's finalised. Use Bellman-Ford instead.
Can you get the rest right without peeking?
Take the timed Graphs Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →