Given n matrices M1, M2, ..., Mn of dimensions d1xd2, d2xd3, ..., dnxd(n+1). What is the optimal order, by multiply two matices at a time, to compute the product M1xM2xM3x...xMn?
Dynamic Programmming is a straight forward method to solve matrix chain multiplication problem. The algorithm is O(n^3) runtime. However, we can improve the runtime by studying the geometric representation for the problem. These properties can lead to an O(n^2) dynamic programming algorithm.
Users can use either Python or Mathematica.