Why it matters
Matrix chain is classic optimization DP. Understanding shapes interval DP.
Advertisement
The architecture
dp[i][j] = min cost to multiply A_i..A_j.
Try each split point k.
Advertisement
How it works end to end
dp[i][i] = 0.
Length increases 2 to n.
Try all splits k in [i, j-1].
Reconstruct via split points.