The Floyd-Warsall algorithm performs the following actions:
He looks at each node ( k ) and then looks at each k iteration for each i, j , if he can have a shorter path, going from i to k and then from k to j .
So it looks like:
"My shortest path from i to j is L0 , my shortest path from i to k is L1 , my shortest path from k to j is L2 .
What if I match the current shortest paths i to k and k to j with the new path? Is this new path i to k to j shorter than my shortest path i to j ? If so, it accumulates the lengths L1 and L2 to calculate the length of the new shortest path. "
This means that k is a potential stopping point for the path from i to j .
phimuemue
source share