Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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??$
image text in transcribed

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions