The Algorithm Design Manual
About the Book
Programming Challenges

The Stony Brook Algorithm Repository

Steven Skiena
Stony Brook University
Dept. of Computer Science

1.2.3 Matrix Multiplication

Problem Input | Problem Output

INPUT                    OUTPUT

Input Description: An x x y matrix A, and an y x z matrix B.

Problem: The x x z matrix A x B.

Excerpt from The Algorithm Design Manual: Although matrix multiplication is an important problem in linear algebra, its main significance for combinatorial algorithms is its equivalence to a variety of other problems, such as transitive closure and reduction, solving linear systems, and matrix inversion. Thus a faster algorithm for matrix multiplication implies faster algorithms for all of these problems. Matrix multiplication arises in its own right in computing the results of such coordinate transformations as scaling, rotation, and translation for robotics and computer graphics.

Asymptotically faster algorithms for matrix multiplication exist, based on clever divide-and-conquer recurrences. However, these prove difficult to program and require very large matrices to beat the trivial algorithm.


  • Fast Matrix Multiplication Algorithms (C) (rating 10)
  • Netlib / TOMS -- Collected Algorithms of the ACM (FORTRAN) (rating 8)
  • LEDA - A Library of Efficient Data Types and Algorithms (C++) (rating 7)
  • TifaMMy isn't the fastest Matrix Multiplication yet (C++) (rating 7)
  • GSL - GNU Scientific Library (C++,C) (rating 7)
  • LAPACK and LINPACK -- Linear Algebra PACKages (FORTRAN) (rating 7)

  • Recommended Books

    Matrix Computations by Gene H. Golub and Charles F. Van Loan Introduction to Algorithms by U. Manber Arithmetic Complexity of Computations by S. Winograd

    Related Problems

    Solving Linear Equations
    Shortest Path

    This page last modified on 2008-07-10 .