next up previous
Next: Matrix Chain Multiplication Up: Alternative Algorithm for Shortest Previous: Algorithm

Proof

  1. Claim base case is obvious.
  2. By induction on $k$:

    Assume $\tilde{D} \left[u, v, k-1\right] = D \left[u, v, k-1\right]$.

    Then either $D \left[u, v, k-1\right] = D \left[u, v, k\right]$ or not... If it does, then the the $\min \left\{ ... , ... \right\} = D \left[u, v, k-1\right]$ and we are good. If not, there is a better path. Since we check all neighbours, (which is all the possible paths we can consider using one more step than before) we know that $D\left[u, s, k-1\right] + w \left(s, v\right)$ is at least as good as the optimal solution. Since it can't be better, we are sure that $\tilde{D} \left[u, v, k\right] = D \left[u, v, k\right]$.



Raymond Fingas 2002-01-18