What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2013 · Q19
Time
Select one answerSingle correct
Solution
Official answer: C) (n3)
Graph AlgorithmsThe standard Bellman-Ford algorithm runs in time, where is the number of vertices and is the number of edges.
For a complete graph with vertices:
Therefore, the overall time complexity is:
Hence, the correct option is (C).
Try the question first, then check your work.
Examiner trap
Recall that Bellman-Ford performs relaxations over all edges , and a complete graph has edges.
This Graph Algorithms previous year question is Q19 of the GATE CSE 2013 paper. Find more GATE CSE PYQs on Graph Algorithms in Algorithms, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 1 related Graph Algorithms PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
GATE CSE 2013 Q19 is the only Graph Algorithms question in the GATE CSE papers so far.
How GATE tests Graph AlgorithmsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.