Skip to content
Related Articles
Open in App
Not now

Related Articles

Algorithms | Graph Shortest Paths | Question 7

Improve Article
Save Article
Like Article
  • Last Updated : 19 Nov, 2018
Improve Article
Save Article
Like Article

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

(A) \Theta(n^2)
(B) \Theta(n^2 Logn)
(C) \Theta(n^3)
(D) \Theta(n^3 Logn)


Answer: (C)

Explanation: Time complexity of Bellman-Ford algorithm is \Theta(VE) where V is number of vertices and E is number edges (See this). If the graph is complete, the value of E becomes \Theta(V^2). So overall time complexity becomes \Theta(V^3)

Quiz of this Question

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!