Matrix Chain Multiplication Order

hard
Unit 21 · Dynamic Programming III0/0 to milestone

Multiplying matrices A1 (d0×d1), A2 (d1×d2), ..., An costs p*q*r scalar multiplications per pair. The order of multiplication changes the total cost hugely.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Matrix Chain Multiplication Order · TechGradify