Canonization of a Random Graph by Two Matrix-Vector Multiplications

Authors Oleg Verbitsky, Maksim Zhukovskii

Thumbnail PDF


  • Filesize: 0.64 MB
  • 13 pages

Document Identifiers

Author Details

Oleg Verbitsky
  • Institut für Informatik, Humboldt-Universität zu Berlin, Germany
Maksim Zhukovskii
  • Department of Computer Science, University of Sheffield, UK

Cite AsGet BibTex

Oleg Verbitsky and Maksim Zhukovskii. Canonization of a Random Graph by Two Matrix-Vector Multiplications. In 31st Annual European Symposium on Algorithms (ESA 2023). Leibniz International Proceedings in Informatics (LIPIcs), Volume 274, pp. 100:1-100:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2023)


We show that a canonical labeling of a random n-vertex graph can be obtained by assigning to each vertex x the triple (w₁(x),w₂(x),w₃(x)), where w_k(x) is the number of walks of length k starting from x. This takes time 𝒪(n²), where n² is the input size, by using just two matrix-vector multiplications. The linear-time canonization of a random graph is the classical result of Babai, Erdős, and Selkow. For this purpose they use the well-known combinatorial color refinement procedure, and we make a comparative analysis of the two algorithmic approaches.

Subject Classification

ACM Subject Classification
  • Mathematics of computing → Random graphs
  • Mathematics of computing → Graph algorithms
  • Graph Isomorphism
  • canonical labeling
  • random graphs
  • walk matrix
  • color refinement
  • linear time


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Noga Alon and Joel H. Spencer. The probabilistic method. John Wiley & Sons, 2016. Google Scholar
  2. László Babai, Paul Erdős, and Stanley M. Selkow. Random graph isomorphism. SIAM Journal on Computing, 9(3):628-635, 1980. Google Scholar
  3. László Babai and Ludek Kucera. Canonical labelling of graphs in linear average time. In 20th Annual Symposium on Foundations of Computer Science (FOCS'79), pages 39-46. IEEE Computer Society, 1979. URL:
  4. Z. Dvořák. On recognizing graphs by numbers of homomorphisms. Journal of Graph Theory, 64(4):330-342, 2010. Google Scholar
  5. Chris Godsil. Controllable subsets in graphs. Ann. Comb., 16(4):733-744, 2012. URL:
  6. Elias M. Hagos. Some results on graph spectra. Linear Algebra Appl., 356(1-3):103-111, 2002. URL:
  7. David Harvey and Joris van der Hoeven. Integer multiplication in time O(nlog n). Annals of Mathematics, 193(2):563-617, 2021. URL:
  8. Fenjin Liu and Johannes Siemons. Unlocking the walk matrix of a graph. J. Algebr. Comb., 55(3):663-690, 2022. URL:
  9. H. L. Morgan. The generation of a unique machine description for chemical structures - a technique developed at chemical abstracts service. J. Chem. Doc., 5(2):107-113, 1965. URL:
  10. Sean O'Rourke and Behrouz Touri. On a conjecture of Godsil concerning controllable random graphs. SIAM J. Control. Optim., 54(6):3347-3378, 2016. URL:
  11. David L. Powers and Mohammad M. Sulaiman. The walk partition and colorations of a graph. Linear Algebra Appl., 48:145-159, 1982. URL:
  12. Sharad S. Sane. The Shrikhande graph. Resonance, 20:903-918, 2015. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail