Algorithms for efficient matrix multiplication