In kth phase dp[i][j] = dp[i][k]+dp[k][j] why 1…k-1 intermediate vertex? why not 1…k intermediate vertext between k…j?
In kth phase dp[i][j] = dp[i][k]+dp[k][j] why 1.....k-1 intermediate vertex?
What we do is one by one make every vertex as intermediate vertex and then we try to check if we can reduce distance between any pair of vertex using the current vertex as intemediate vertex.
In kth phase we divide it in i to k and k to j and not i to k-1