GATE 2013 CS (CS1) – Question 29
What is Bellman–Ford’s running time on a complete graph with n vertices?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $\Theta(n^3)$
Explanation
The standard algorithm relaxes all edges over n−1 passes, costing Θ(VE). A complete graph has Θ(n²) edges, so this becomes Θ(n·n²)=Θ(n³), C, for the standard full-pass worst-case bound.
More Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions
- GATE 2011 CS (CS1) Q64
- GATE 2011 CS (CS1) Q65
- GATE 2010 CS (CS1) Q60
- GATE 2010 CS (CS1) Q61
- GATE 2015 CS (CS2) Q47
- GATE 2015 CS (CS3) Q55
All Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions →