Fast Generation of Unlabelled Free Trees using Weight Sequences
Paul Brown, Trevor Fenner

TL;DR
This paper presents a new weight sequence representation for generating free trees efficiently, significantly outperforming existing algorithms like WROM in Python implementations.
Contribution
Introduces a novel weight sequence based method for generating free trees and improves efficiency through algorithmic modifications and caching.
Findings
Our algorithm is over four times faster than WROM for free tree generation.
Generation of adjacency lists and matrices is over three times faster than WROM.
Python implementations with optimizations significantly reduce runtime.
Abstract
In this paper, we introduce a new representation for ordered trees, the weight sequence representation. We then use this to construct new representations for both rooted trees and free trees, namely the canonical weight sequence representation. We construct algorithms for generating the weight sequence representations for all rooted and free trees of order n, and then add a number of modifications to improve the efficiency of the algorithms. Python implementations of the algorithms incorporate further improvements by using generators to avoid having to store the long lists of trees returned by the recursive calls, as well as caching the lists for rooted trees of small order, thereby eliminating many of the recursive calls. We further show how the algorithm can be modifed to generate adjacency list and adjacency matrix representations for free trees. We compared the run-times of our…
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.
