For our discussion, we will use the symbols di ->j to denote the cost (distance) of the edge from node i to node j.
Dn+1i ->j = mink ( di ->k + Dnk ->j)until on some iteration nothing changes.
Dn+1i ->j = mink ( Dni ->k + Dnk ->j)That is, while the di ->j values are used to initialize the algorithm, they are not involved in the update process. While this may speed the initial convergence of the algorithm, it makes it unable to adjust to dynamic changes in the costs associated with network links.
So, to find "n", the algorithm only needs to consider paths contained completely in W except for the last step.
DWs ->j = min( DWs ->j, DWs ->n + dn ->j)