You are in the middle of running the Floyd-Warshal algorithm. You are in the mid
ID: 3579257 • Letter: Y
Question
You are in the middle of running the Floyd-Warshal algorithm.
You are in the middle of running the Floyd-Warshal algorithm. You have just completed calculating D^3 and Product^3. Unfortunately, at that instant in time, a lightning hold corrupts the data stored in your table. Unaware of this, your algorithm continues, correctly following the algorithm to calculate values for D^4 and Product^4. Fill in those values below. (You only need to do it once, I just give the table twice to help you make it legible if it comes out poorly once.)Explanation / Answer
Using :
k = 4
for i = 1 to 4 :
for j = 1 to 4 :
if( D[i][j] > D[i][k] + D[k][j] ):
D[i][j] = D[i][k] + D[k][j];
P[i][j] = P[k][j];
D4 1 2 3 4 1 0 3 -4 3 2 3 5 -5 2 3 2 3 -6 1 4 1 3 -7 0Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.