Question: Recall the Bellman-Ford algorithm for obtaining the Single-Source-Shortest-Paths (SSSP) in a weighted graph G = (V, E, W ). Answer the following questions. Find an
Recall the Bellman-Ford algorithm for obtaining the Single-Source-Shortest-Paths (SSSP) in a
weighted graph G = (V, E, W ). Answer the following questions.
-
Find an example graph G along with weights on edges and an ordering of edges such that the Bellman- Ford algorithm requires all the n 1 iterations for a run time of O(nm). Your example graph should be a general example so that for every n, your example yields a graph with n vertices.
-
Considering your example above, do you think that there is a good ordering of the edges such that the algorithm can really finish in one iteration? Does this hold for a general graph too? Justify.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
