Jesus A. Gonzalez
July 17, 2019
Chapter 25 of Introduction to Algorithms (3rd Edition), Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein.
The problem to make a distances table between all pairs of cities in a Roads Atlas
\(\delta w_{i,j} = \begin{cases} 0 &\mbox{if } i = j\\ w_{i,j} &\mbox {if } i \not= j, (i,j) \in E\\ \infty &\mbox{if } i \not= j, (i,j) \notin E\\ \end{cases}\)
\(l_{ij}^{(0)} = \begin{cases} 0 &\mbox{if } i = j,\\ \infty &\mbox{if } i \not= j.\\ \end{cases}\)
With all possibles predecessors \(k\) of \(j\)
\(l_{ij}^{(m)} = \min(l_{ij}^{(m-1)}, \min_{1 \leq k \leq n}\{l_{ik}^{(m-1)} + w_{kj}\})\) \(= \min_{1 \leq k \leq n}(l_{ik}^{(m-1)} + w_{kj})\)