Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This problem is concerned with the graph below. Recall that the recursive formula for the distances computed by the Floyd - Warshall APSP algorithm defines

This problem is concerned with the graph below.
Recall that the recursive formula for the distances computed by the Floyd-Warshall APSP algorithm
defines an entry (i,j) in the k th D-matrix as follows:
,dij(k)=wijifk=0 and
min(dij(k-1),dik(k-1)+dkj(k-1)) otherwise.
When k=0, we also need to consider when there is no edge from i to j. So we also have dij(0)=0 if
i==j and if ij but there is no edge from i to j.
(a) Fill in the first two D matrices, D(0) and D(1) following the recursive formula above.
Solution:
(b) We're now interested in , the predecessor matrix that would help us construct a shortest
path between any two vertices. We define a value ij(k) in the predecessor matrix (k) as ij(k)=
predecessor of vertex j on a shortest path from vertex i.
Give a formula for ij(0), the entry for i,j in the initialization matrix.
Solution:
(c) Give a recursive formula for entry (i,j) in the k th matrix. You can assume all relevant D
matrices exist and you can refer back to them.
Solution:
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

More Books

Students also viewed these Databases questions