Matrix chain multiplication (source code)

= Matrix chain multiplication
{wiki=Matrix_chain_multiplication}

Matrix Chain Multiplication is a classical problem in computer science and optimization that involves finding the most efficient way to multiply a given sequence of matrices. The goal is to minimize the total number of scalar multiplications needed to compute the product of the matrices.