A heuristic for optimizing the multiplication of matrix chains

  • Authors:
  • Lionel E. Deimel, Jr.;Tempe Ann Lampe

  • Affiliations:
  • North Carolina State University, Raleigh, North Carolina;North Carolina State University, Raleigh, North Carolina

  • Venue:
  • ACM-SE 17 Proceedings of the 17th annual Southeast regional conference
  • Year:
  • 1979

Quantified Score

Hi-index 0.00

Visualization

Abstract

A consequence of the associative property of matrix multiplication is that the product of n matrices can be calculated in (n-1)! ways. Different choices for the multiplication sequence can cause the numbers of scalar multiplications required to vary by several orders of magnitude. The optimal ordering with respect to number of scalar multiplications can be found in O(n3) time using dynamic programming. A heuristic is presented which finds an optimal or nearly optimal strategy in O(n2) time in its most straightforward implementation. The problem is important in interpretation or code generation for languages which allow high-level manipulation of matrices.