Computation of Matrix Chain Products on Parallel Machines
Elad Weiss, Oded Schwartz · 2019
The Matrix Chain Ordering Problem is a well studied optimization problem, aiming at finding optimal parentheses assignment for minimizing the number of arithmetic operations required when computing a chain of matrix multiplications. Existing algorithms include the O(N3) dynamic programming of Godbole (1973) and the faster O(N log N) algorithm of Hu and Shing (1982). We show that both may result in suboptimal parentheses assignment on modern machines as they do not take into account inter-processor communication costs that often dominate the running time. Further, the optimal solution may change when using fast matrix multiplication algorithms. We show that the O(N3) dynamic-programing algorithm easily adapts to provide optimal solutions for modern matrix multiplication algorithms, and obtain an adaption of the O(N log N) algorithm that guarantees a constant approximation.