English

Fast and simple multiplication of bounded twin-width matrices

Data Structures and Algorithms 2026-02-24 v1 Computational Complexity Computational Geometry

Abstract

Matrix multiplication is a fundamental task in almost all computational fields, including machine learning and optimization, computer graphics, signal processing, and graph algorithms (static and dynamic). Twin-width is a natural complexity measure of matrices (and more general structures) that has recently emerged as a unifying concept with important algorithmic applications. While the twin-width of a matrix is invariant to re-ordering rows and columns, most of its algorithmic applications to date assume that the input is given in a certain canonical ordering that yields a bounded twin-width contraction sequence. In general, efficiently finding such a sequence -- even for an approximate twin-width value -- remains a central and elusive open question. In this paper we show that a binary n×nn \times n matrix of twin-width dd can be preprocessed in O~d(n2)\widetilde{\mathcal{O}}_d(n^2) time, so that its product with any vector can be computed in O~d(n)\widetilde{\mathcal{O}}_d(n) time. Notably, the twin-width of the input matrix need not be known and no particular ordering of its rows and columns is assumed. If a canonical ordering is available, i.e., if the input matrix is dd-twin-ordered, then the runtime of preprocessing and matrix-vector products can be further reduced to O(n2+dn)\mathcal{O}(n^2+dn) and O(dn)\mathcal{O}(dn). Consequently, we can multiply two n×nn \times n matrices in O~(n2)\widetilde{\mathcal{O}}(n^2) time, when at least one of the matrices consists of 0/1 entries and has bounded twin-width. The results also extend to the case of bounded twin-width matrices with adversarial corruption. Our algorithms are significantly faster and simpler than earlier methods that involved first-order model checking and required both input matrices to be dd-twin-ordered.

Keywords

Cite

@article{arxiv.2602.20023,
  title  = {Fast and simple multiplication of bounded twin-width matrices},
  author = {László Kozma and Michal Opler},
  journal= {arXiv preprint arXiv:2602.20023},
  year   = {2026}
}
R2 v1 2026-07-01T10:48:11.120Z