Dynamic Programming21 sections · 916 units
Open in Course

Matrix Chain Multiplication - Problem Statement

Classic interval DP

You have nn matrices to multiply: A₁ ×\times A₂ ×\times ... ×\times AnA_n. Matrix multiplication is associative, so you can parenthesize in any order. Different orders have different costs. Multiplying an (a×b) matrix by a (b×c) matrix costs a×b×c operations.

Your goal: find the parenthesization that minimizes total operations. This is THE classic interval DP problem. The key: choosing where to split the chain determines which two subchains you multiply first.