Chain mulitplication of matrices of approximately or exactly the same size
We present a different approach to finding an optimal computation order; it exploits both the difference between the size of the matrices and the difference between the number of nonzero elements in the matrices. Therefore, this technique can be usefully applied where the matrices are almost or exactly the same size. We show that using the proposed technique, an optimal computation order can be determined in time O(n) if the matrices have the same size, and in time O(n3) otherwise.