According to CLRS, each iteration of the outermost loop (on $k$) makes a new copy of the adjacency matrix. Is it safe not to copy the matrix on every iteration?
What I mean is, according to CLRS:
$d_{ij}^K = \min(d_{ij}^{K-1}, d_{ik}^{K-1} + d_{kj}^{K-1})$
Is the following possible?
$d_{ij} = \min(d_{ij}, d_{ik} + d_{kj})$
I have tried not copying the matrix, and got the same result before as the one which makes a copy after each iteration, but did I just get lucky?