In Floyd Warshall Algorithm, we take three loops.

```
for k in 1 to number of vertices{
for i in 1 to number of vertices{
for j in 1 to number f vertices{
dist*[j] = min(dist*[j],dist*[k]+dist[k][j]);
}
}
}
```

I understood the above part and also why we do like that

But I did a little experiment and interchanged the places of (for loop of i) and (for loop of k)

and then checked but the answers remained same.I also interchanged (loop of k) and (loop of j),

still the answers come out to be same.

I couldn’t prove that the answer should be same. If the above interchanges aren’t same ,please tell me the case where the error will occur or if the above interchanges are same then please prove it.