Problems > Matrix Chain Multiplication > Editorial

Matrix Chain Multiplication — Solution & Editorial

Back to the Problem

Interval DP: dp[i][j] = cheapest way to multiply matrices i..j, splitting at every k. O(N³).

Complexity: O(N3)

Watch out: Costs reach ~106·N ≈ 109 — 64-bit.