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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started