Enter dimensions and compare candidate chain multiplication costs. View splits, tables, and export results easily. Choose parenthesizations that reduce computation across larger matrix workloads.
| Example | Dimension Vector | Matrix Chain | Expected Minimum Cost |
|---|---|---|---|
| Classic DP Example | 30, 35, 15, 5, 10, 20, 25 | A1: 30×35, A2: 35×15, A3: 15×5, A4: 5×10, A5: 10×20, A6: 20×25 | 15,125 |
| Short Chain | 10, 20, 30, 40 | A1: 10×20, A2: 20×30, A3: 30×40 | 18,000 |
| Balanced Sizes | 5, 10, 3, 12, 5, 50, 6 | A1: 5×10, A2: 10×3, A3: 3×12, A4: 12×5, A5: 5×50, A6: 50×6 | 2,010 |
Matrix chain multiplication uses dynamic programming. It does not change the matrix order. It only changes the parenthesization.
Base case: m[i,j] = 0 when i = j
Recurrence: m[i,j] = min(m[i,k] + m[k+1,j] + p[i-1] × p[k] × p[j]) for every k from i to j-1
Here, p is the dimension vector. If the vector is 30, 35, 15, 5, then the chain is 30×35, 35×15, and 15×5.
The merge term p[i-1] × p[k] × p[j] counts the scalar operations needed after the left and right subchains are already solved.
The split table stores the best k for each subchain. That table helps rebuild the final optimal parenthesization.
It finds the multiplication order that minimizes scalar operations for compatible matrices. The matrix sequence stays fixed. Only the grouping changes.
Matrix multiplication is associative, but intermediate matrix sizes can change with grouping. Different temporary sizes cause different scalar multiplication counts.
No. It optimizes dimension-based multiplication order only. It focuses on cost, split points, dynamic tables, and the best parenthesization.
Enter positive integers separated by commas or spaces. Example: 30,35,15,5,10,20,25. That creates six compatible matrices.
A chain of n matrices needs n+1 dimensions. Each matrix uses one starting dimension and one ending dimension from the vector.
It is the index k that divides one subchain into two smaller parts. The recurrence tests all valid splits and keeps the cheapest.
The graph plots minimum solved costs for subchains by length. It helps you see how complexity grows as the chain becomes longer.
Yes. Use the CSV or PDF buttons after calculation. The exported file includes the summary, matrix list, and optimization steps.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.