Revisiting Tree Isomorphism: An Algorithmic Bric-\`a-Brac
Florian Ingels

TL;DR
This paper presents a more intuitive formulation of the AHU tree isomorphism algorithm, proposes three implementation variants, and demonstrates their practical competitiveness and adaptability to DAG tree compression, with experiments on large datasets.
Contribution
It introduces a clearer, alternative formulation of the AHU algorithm and three implementation variants, including prime multiplication, for improved understanding and practical performance.
Findings
Two variants using sorting are competitive with the original algorithm.
Prime multiplication variant performs well despite worse theoretical complexity.
Algorithms are effective for trees up to size 10^6 in Python.
Abstract
The Aho, Hopcroft and Ullman (AHU) algorithm has been the state of the art since the 1970s for determining in linear time whether two unordered rooted trees are isomorphic or not. However, it has been criticized (by Campbell and Radford) for the way it is written, which requires several (re)readings to be understood, and does not facilitate its analysis. In this article, we propose a different, more intuitive formulation of the algorithm, as well as three propositions of implementation, two using sorting algorithms and one using prime multiplication. Although none of these three variants admits linear complexity, we show that in practice two of them are competitive with the original algorithm, while being straightforward to implement. Surprisingly, the algorithm that uses multiplications of prime numbers (which are also be generated during the execution) is competitive with the fastest…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Algorithms and Data Compression · Graph Theory and Algorithms
