Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the Generic SSSP algorithm on Page 4 of Lecture 21 (from Prof. Jeff Erickson's notes). (In class, I have been calling this the Danzig-Ford

image text in transcribed

Consider the Generic SSSP algorithm on Page 4 of Lecture 21 (from Prof. Jeff Erickson's notes). (In class, I have been calling this the Danzig-Ford algorithm (version 2)). As you know, when all edge weights are non-negative, if we use a min-heap priority queue implementation of the bag data structure, we get Dijkstra's algorithm and this runs in O (m log n) time on graphs with n vertices and m edges. So we have a pretty efficient algorithm, when edge weights are all non-negative. What about when some edge weights can be negative, but there are no negative cycles? Section 21.6 in Prof. Erickson's notes describes an algorithm that he calls Shamble's algorithm that rims in O (m middot n) time, solving the SSSP problem even when there are negative edge weights, provided there are no negative cycles. This algorithm is more commonly known as the Bellman-Ford algorithm. Execute Shimbel's algorithm on the graph given above. As in the figure at the top of Page 7, after each phase (i) show all the dist (middot) values, (ii) all the vertices that were in the queue during the phase that just ended, and (iii) all the edges that were relaxed in the phase that just ended. Use induction to prove the following claim that appears in the box on Page 6: After i phases of the algorithm, dist (upsilon) is at most the length of the shortest walk from s to upsilon consisting of at most i edges. Consider the Generic SSSP algorithm on Page 4 of Lecture 21 (from Prof. Jeff Erickson's notes). (In class, I have been calling this the Danzig-Ford algorithm (version 2)). As you know, when all edge weights are non-negative, if we use a min-heap priority queue implementation of the bag data structure, we get Dijkstra's algorithm and this runs in O (m log n) time on graphs with n vertices and m edges. So we have a pretty efficient algorithm, when edge weights are all non-negative. What about when some edge weights can be negative, but there are no negative cycles? Section 21.6 in Prof. Erickson's notes describes an algorithm that he calls Shamble's algorithm that rims in O (m middot n) time, solving the SSSP problem even when there are negative edge weights, provided there are no negative cycles. This algorithm is more commonly known as the Bellman-Ford algorithm. Execute Shimbel's algorithm on the graph given above. As in the figure at the top of Page 7, after each phase (i) show all the dist (middot) values, (ii) all the vertices that were in the queue during the phase that just ended, and (iii) all the edges that were relaxed in the phase that just ended. Use induction to prove the following claim that appears in the box on Page 6: After i phases of the algorithm, dist (upsilon) is at most the length of the shortest walk from s to upsilon consisting of at most i edges

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions