An algorithm for generating random mixed-arity trees

12/22/2021
by   Aleksander Kiryk, et al.
0

Inspired by [4] we present a new algorithm for uniformly random generation of ordered trees in which all occuring outdegrees can be specified by a given sequence of numbers. The method can be used for random generation of binary or n-ary trees, or ones with various arities. We show that the algorithm is correct and has O(n) time complexity for n being the desired number of nodes in the resulting tree. In the discussion part we show how some selected formulas can be derived with the use of ideas developed in the proof of correctness of the algorithm.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/23/2022

Linear random generation of Motzkin trees

Motzkin trees are also called unary-binary trees. This paper proposes a ...
research
03/06/2020

On the Collection of Fringe Subtrees in Random Binary Trees

A fringe subtree of a rooted tree is a subtree consisting of one of the ...
research
02/07/2020

A One-to-One Correspondence between Natural Numbers and Binary Trees

A characterization is provided for each natural number except one (1) by...
research
01/13/2020

Fast Generation of Big Random Binary Trees

random_tree() is a linear time and space C++ implementation able to crea...
research
07/03/2022

A Gray Code of Ordered Trees

A combinatorial Gray code for a set of combinatorial objects is a sequen...
research
03/16/2023

Uniform random generations and rejection method(I) with binomial majorant

We present three simple algorithms to uniformly generate `Fibonacci word...
research
10/14/2020

Fast Generation of Unlabelled Free Trees using Weight Sequences

In this paper, we introduce a new representation for ordered trees, the ...

Please sign up or login with your details

Forgot password? Click here to reset