0

https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm

Looking at Wikipedia, I'm studying Floyd-Warshall.

In the example section, On one distance matrix When j and k are the same or j and k same, I want to know why (i,j,k)==(i,j,k-1) With the meaning of k.

Sneftel
  • 40,271
  • 12
  • 71
  • 104
Johnson
  • 13
  • 2

1 Answers1

0

If i=k or j=k, then k is not useful as an intermediate point (it's already usable as an endpoint). So adding k to the set of allowable intermediate points doesn't give any useful new abilities, and the cost is the same.

Sneftel
  • 40,271
  • 12
  • 71
  • 104