Question: Problem 3 Modify the Bellman - Ford algorithm so that it sets | $ v . d | $ to | $ - | $

Problem 3
Modify the Bellman-Ford algorithm so that it sets |$v.d|$ to |$-|$ for all vertices |$v|$ for which there is a negative-weight cycle on some path from the source to |$v|$.
Problem 4
Show how to use the output of the FloydWarshall algorithm to detect the presence of a negative-weight cycle.
Problem 5
As it appears on page 657 of the text, the Floyd-Warshall algorithm requires |$| Theta (n3)|$| space, since it creates |$(d)ij??{(k)}|$ for |$i,j,k|=1,2,dots,n|$|. Show that the procedure $$ text(FLOYDWARSHALL')|$, which simply drops all the superscripts, is correct, and thus only |$(n2)|$ space is required.
|$text(FLOYD-WARSHALL')(W, n)|$
|$D|=W??$
|$| text(for )k=1 text( to )n|$|
|$text() text(for )i=1 text( to )n|$|
|$text() text() text(for )j=1 text( to )n|$|
|$| text() text() text() d_{ij}= min{dij,d-{ik}+d-{kj}}|$|
|$| text(return )D??$
 Problem 3 Modify the Bellman-Ford algorithm so that it sets |$v.d|$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!