← Quiz: Shortest Paths: all 10 questions
Quiz: Shortest Paths · Question 5 of 10
How many rounds of "relax every edge" does Bellman-Ford need for V nodes (without the check round)?
How many rounds of "relax every edge" does Bellman-Ford need for V nodes (without the check round)?
- A.V
- B.E
- C.log V
- D.V − 1
Answer & explanation
Correct answer: V − 1
A shortest simple path has at most V − 1 edges, and each round fixes at least one more of them.
Can you get the rest right without peeking?
Take the timed Quiz: Shortest Paths quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →