Holooly Plus Logo

Question 18.P.5: (S) For the input graph what are the final array entries of ......

(S) For the input graph what are the final array entries of the Floyd Warshall algorithm?

18.P.5
Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

With columns indexed by k and rows by vertex pairs:

 

(1,1) 0 0 0 0 -4
(1,2) 2 2 2 2 -2
(1,3) 5 5 3 3 -1
(1,4)

+\infty

+\infty

+\infty

0 -4
(2,1)

+\infty

+\infty

+\infty

+\infty

-6
(2,2) 0 0 0 0 -4
(2,3) 1 1 1 1 -3
(2,4)

+\infty

+\infty

+\infty

-2 -6
(3,1)

+\infty

+\infty

+\infty

+\infty

-7
(3,2)

+\infty

+\infty

+\infty

+\infty

-5
(3,3) 0 0 0 0 -4
(3,4) -3 -3 -3 -3 -7
(4,1) -4 -4 -4 -4 -8
(4,2)

+\infty

-2 -2 -2 -6
(4,3)

+\infty

1 -1 -1 -5
(4,4) 0 0 0 -4 -8
0 1 2 3 4

 

Related Answered Questions

Question: 18.P.4

Verified Answer:

With columns indexed by k and rows by vertex pairs...
Question: 18.P1

Verified Answer:

With columns indexed by i and rows by vertices: