Generating ordered trees (original) (raw)
Related papers
An Efficient Scheme for the Generation of Ordered Trees in Constant Amortized Time
2021 15th International Conference on Ubiquitous Information Management and Communication (IMCOM), 2021
Trees are useful entities allowing to model data structures and hierarchical relationships in networked decision systems ubiquitously. An ordered tree is a rooted tree where the order of the subtrees (children) of a node is significant. In combinatorial optimization, generating ordered trees is relevant to evaluate candidate combinatorial objects. In this paper, we present an algebraic scheme to generate ordered trees with n vertices with utmost efficiency; whereby our approach uses O(n) space and O(1) time in average per tree. Our computational studies have shown the feasibility and efficiency to generate ordered trees in constant time in average, in about one tenth of a millisecond per ordered tree. Due to the 1-1 bijective nature to other combinatorial classes, our approach is favorable to study the generation of binary trees with n external nodes, trees with n nodes, legal sequences of n pairs of parentheses, triangulated n-gons, gambler's sequences and lattice paths. We believe our scheme may find its use in devising algorithms for planning and combinatorial optimization involving Catalan numbers.
Efficient generation of rooted trees
In this paper we give an algorithm to generate all rooted trees with at most n vertices. The algorithm generates each tree in constant time on average. Furthermore the algorithm is simple, and clarifies a simple relation among the trees, that is a family tree of trees, and outputs trees based on the relation.
Parallel Generation of t-Ary Trees in A-order
The Computer Journal, 2007
We present a cost-optimal and adaptive parallel algorithm for generating t-ary trees in A-order. The generation is based on an encoding using integer sequences (z-sequences) due to Zaks [(1980), Lexicographic generation of ordered tree. Theor. Comput. Sci., 10, 63-82]. Our algorithm is the first introduced parallel generation algorithm, which generates t-ary trees in A-order in the literature. The used computational model is CREW SM SIMD multi-processors. This algorithm is designed based on a novel sequential generation algorithm that is also discussed. Ranking and unranking algorithms for z-sequences are also presented.
Loopless generation of k-ary tree sequences
Information Processing Letters, 1994
Roelants van Baronaigien (1991) gave an algorithm to generate all n-node binary tree representations with constant time between them. He used the well-known rotation operation on nodes for balancing binary search trees and represented binary trees by binary tree sequences. This paper generalizes the rotation to k-ary trees and uses it to generate k-ary tree representations with constant time between them.
Towards a More Precise Analysis of an Algorithm to Generate Binary Trees: A Tutorial
The Computer Journal, 1998
For the analysis of an algorithm to generate binary trees, the behaviour of a certain sequence of numbers is essential. In the original paper, it was expressed by a recursion. Here, we show how to solve this (and similar) recursions, both explicitly and asymptotically. Some additional information about useful mathematical software is also provided.
Generating binary trees by transpositions
Journal of Algorithms, 1990
Let T(n) denote the set of all bitstrings with n l's and n O's that satisfy the property that in every prefix the number of O's does not exceed the number of 1's. This is a well known representation of binary trees. We consider algorithms for generating the elements of T(n) that satisfy one of the following constraints: (a) successive bitstrings differ by the transposition of two bits or (b) successive bitstrings differ by the transposition of two adjacent bits. In case (a) a constant average time generation algorithm is presented. In case (b) we show that such generation is possible if and only if n is even or n < 5. A constant average time algorithm is presented in this case as well. 0 1990 Academic press. IX.