Article view

Fast Generation of Unlabelled Free Trees using Weight Sequences

By Paul Brown, Trevor I. Fenner

Article information

Publication
Published 1 January 2021
Institutions at publication
University of London; Birkbeck, University of London
1 Citations OpenAlex, 3 December 2026 FULL LIST: Citations
Countries with citations No data yet
Usage Phase 3: not collected yet

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 modified to generate adjacency list and adjacency matrix representations for free trees. We compared the runtimes of our Python implementation for generating free trees with the Python implementation of the well-known WROM algorithm taken from NetworkX. The implementation of our algorithm is over four times as fast as the implementation of the WROM algorithm. The runtimes for generating adjacency lists and matrices are somewhat longer than those for weight sequences, but are still over four times as fast as the corresponding implementations of the WROM algorithm.

Citations per year

Citations per year
YearCitations
2021 0
2022 0
2023 1
2024 0
2025 0
2026 0

OpenAlex counts citations by year for the last ten years only, so the total and the list of citing works can include earlier ones.

Works citing this article

OpenAlex counts 1 citation, but the citing work is not listed here yet: citing works are collected from OpenAlex a few at a time, and it lists most, not all, of the citations it counts.

Where its authors are based

Countries of the institutions the article's authors were affiliated to when it was published.

  • AUTHORS
  • CITATIONS No data yet
  • USAGE Phase 3
Authors by country
CountryAuthors
United Kingdom2