Log in

Algorithms for Matrix Multiplication via Sampling and Opportunistic Matrix Multiplication

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

As proposed by Karppa and Kaski (in: Proceedings 30th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2019) a novel “broken" or "opportunistic" matrix multiplication algorithm, based on a variant of Strassen’s algorithm, and used this to develop new algorithms for Boolean matrix multiplication, among other tasks. Their algorithm can compute Boolean matrix multiplication in \(O(n^{2.778})\) time. While asymptotically faster matrix multiplication algorithms exist, most such algorithms are infeasible for practical problems. We describe an alternative way to use the broken multiplication algorithm to approximately compute matrix multiplication, either for real-valued or Boolean matrices. In brief, instead of running multiple iterations of the broken algorithm on the original input matrix, we form a new larger matrix by sampling and run a single iteration of the broken algorithm on it. Asymptotically, our algorithm has runtime \(O(n^{2.763})\), a slight improvement over the Karppa–Kaski algorithm. Since the goal is to obtain new practical matrix-multiplication algorithms, we also estimate the concrete runtime for our algorithm for some large-scale sample problems. It appears that for these parameters, further optimizations are still needed to make our algorithm competitive.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Algorithm 1
Fig. 1
Fig. 2

Similar content being viewed by others

Notes

  1. [12] includes an additional step, where the entries of the matrices are randomly permuted at each level. We omit this, since we will later include more extensive randomization in the overall algorithm.

References

  1. Albrecht, M., Bond, G., Hart, W.: Algorithm 898: efficient multiplication of dense matrices over \(\text{ GF }(2)\). AMS Trans. Math. Softw. 37(1), 1–14 (2010)

    Article  Google Scholar 

  2. Arlazarov, V., Dinic, E., Kronrod, M., Faradžev, I.: On economical construction of the transitive closure of a directed graph. Doklady Akademii Nauk 194(3), Russian Academy of Sciences, pp. 487-88 (1970)

  3. Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Communication-optimal parallel algorithm for Strassen’s matrix multiplication. Proc. 24th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 193-204 (2012)

  4. Benson, A., Ballard, G.: A framework for practical parallel fast matrix multiplication. ACM SIGPLAN Notices 50(8), 42–53 (2015)

    Article  Google Scholar 

  5. Coppersmith, D., Winograd, S.: Matrix multiplication via arithmetic progressions. J. Symb. Comput. 9(3), 251–280 (1990)

    Article  MathSciNet  Google Scholar 

  6. Karstadt, E., Schwartz, O.: Matrix multiplication, a little faster. J. ACM 67(1), 1–31 (2020)

    Article  MathSciNet  Google Scholar 

  7. Le Gall, F.: Faster algorithms for rectangular matrix multiplication. In: Proc. 53rd IEEE Symposium on Foundations of Computer Science (FOCS), pp. 514-523 (2012)

  8. Le Gall, F., Urrutia, F.: Improved rectangular matrix multiplication using powers of the Coppersmith-Winograd tensor. In: Proc. 29th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 1029-1046 (2018)

  9. Le Gall, F.: Faster rectangular matrix multiplication by combination loss analysis. In: Proc. 35th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 3765-3791 (2024)

  10. Huang, J., Smith, T., Henry, G., Van De Geijn, R.: Strassen’s algorithm reloaded. In: Proc. International Conference for High Performance Computing, Networking, Storage and Analysis (SC), pp. 690-701 (2016)

  11. Janson, S., Luczak, T., Rucínski, A.: An exponential bound for the probability of a specified subgraph in a random graph. IMA Preprint Series #393 (1988)

  12. Karppa, M., Kaski, P.: Probabilistic tensors and opportunistic Boolean matrix multiplication. In: Proc. 30th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 496-515 (2019)

  13. Karppa, M.: Techniques for similarity search and Boolean matrix multiplication. PhD Thesis (2020)

  14. Pan, V.: Fast feasible and unfeasible matrix multiplication. ar**v:1804.04102 (2018)

  15. Vassilevska Williams, V., Xu, Y., Xu, Z., Zhou, R.: New bounds for matrix multiplication: from alpha to omega. In: Proc. 35th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 3792-3835 (2024)

  16. Yu, H.: An improved combinatorial algorithm for Boolean matrix multiplication. Inf. Comput. 261, 240–247 (2018)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

Thanks for Richard Stong for suggesting the proof of Lemma 12. Thanks to conference and journal reviewers for helpful corrections and suggestions.

Author information

Authors and Affiliations

Authors

Contributions

There is only a single author.

Corresponding author

Correspondence to David G. Harris.

Ethics declarations

Conflict of interest

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This is an extended version of a paper appearing in the European Symposium on Algorithm (ESA) 2023.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Harris, D.G. Algorithms for Matrix Multiplication via Sampling and Opportunistic Matrix Multiplication. Algorithmica (2024). https://doi.org/10.1007/s00453-024-01247-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00453-024-01247-y

Keywords

Navigation