Introduction to Algorithms
by Cormen, Leiserson, and Rivest as the basis for its design. The problem can be stated as follows: given a chain <A
1
, A
2
,..., A
n
> of n matrices, where for i = 1, 2,...,n, matrix A
i
has dimension p
i-1
x p
i
, fully parenthesize the product A
1
A
2
...
A
n
in a way that minimizes the number of scalar multiplications. This program does exactly that, for a chain of up to 26 matrices. You may input your own dimensions for a matrix chain or have the computer generate them for you. If you choose to specify your own dimensions, you also have the option to input integer values for the matrix entries, since this program is capable of performing the multiplication.