next up previous
Next: Up: Previous:

Apply Dynamic Programming

Note similarity to matrix multiplication:


\begin{displaymath}m_{i,j} \;=\; \left\{ \begin{array}{lll} 0 & {\rm if} & i=j \...
...;+\; p_{i-1}p_kp_j\} & {\rm if} & i \neq j \end{array} \right. \end{displaymath}

In fact, our algorithm for computing D involves ``multiplying'' the adjacency matrix by itself n-1 times.


next up previous
Next: Up: Previous: