GateAI
Graph Algorithms

GATE CSE 2013 · Q19

MCQ1 markEasy

Time

What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of nn vertices?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) (n3)

Graph Algorithms

The standard Bellman-Ford algorithm runs in Θ(∣V∣⋅∣E∣)\Theta(|V| \cdot |E|) time, where ∣V∣|V| is the number of vertices and ∣E∣|E| is the number of edges.

For a complete graph with nn vertices:

  • ∣V∣=n|V| = n

  • ∣E∣=(n2)=n(n−1)2=Θ(n2)|E| = \binom{n}{2} = \frac{n(n-1)}{2} = \Theta(n^2)

Therefore, the overall time complexity is:

Θ(∣V∣⋅∣E∣)=Θ(n⋅n2)=Θ(n3)\Theta(|V| \cdot |E|) = \Theta(n \cdot n^2) = \Theta(n^3)

Hence, the correct option is (C).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

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

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Graph Algorithms in GATE CSE

GATE CSE 2013 Q19 is the only Graph Algorithms question in the GATE CSE papers so far.

How GATE tests Graph Algorithms

More from GATE CSE 2013

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2013 · Q19 · MCQ

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

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.