Open In App

Algorithms | Graph Shortest Paths | Question 7

Last Updated : 19 Nov, 2018
Like Article
Like
Save
Share
Report

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

(A)

Θ(V2)

(B)

Θ(V2 log v)

(C)

Θ(V3)

(D)

Θ(V3 log v)



Answer: (C)

Explanation:

Time complexity of Bellman-Ford algorithm is Θ(VE) where V is number of vertices and E is number edges . If the graph is complete, the value of E becomes Θ(V2). So overall time complexity becomes Θ(V3)

Hence, option C is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads