Generation, Ranking and Unranking of Ordered Trees with Degree Bounds

We study the problem of generating, ranking and unranking of unlabeled ordered trees whose nodes have maximum degree of $\Delta$. This class of trees represents a generalization of chemical trees. A chemical tree is an unlabeled tree in which no node has degree greater than 4. By allowing up to $\Delta$ children for each node of chemical tree instead of 4, we will have a generalization of chemical trees. Here, we introduce a new encoding over an alphabet of size 4 for representing unlabeled ordered trees with maximum degree of $\Delta$. We use this encoding for generating these trees in A-order with constant average time and O(n) worst case time. Due to the given encoding, with a precomputation of size and time O(n^2) (assuming $\Delta$ is constant), both ranking and unranking algorithms are also designed taking O(n) and O(nlogn) time complexities.

[1]  Frank Ruskey Generating t-ary Trees Lexicographically , 1978, SIAM J. Comput..

[2]  Shmuel Zaks,et al.  Lexicographic Generation of Ordered Trees , 1980, Theor. Comput. Sci..

[3]  Ivan Gutman Graphs and Graph Polynomials of interest in Chemistry , 1986, WG.

[4]  Abbas Nowzari-Dalini,et al.  Ranking and unranking algorithms for loopless generation of t-ary trees , 2011, Log. J. IGPL.

[5]  Sandra Mitchell Hedetniemi,et al.  Constant Time Generation of Rooted Trees , 1980, SIAM J. Comput..

[6]  James F. Korsh,et al.  Loopless Generation of Gray Codes for k-Ary Trees , 1999, Inf. Process. Lett..

[7]  Vincent Vajnovszki,et al.  Ranking and unranking k-ary trees with a 4k – 4 letter alphabet , 1997 .

[8]  I. Gutman,et al.  Mathematical Concepts in Organic Chemistry , 1986 .

[9]  M. C. Er Efficient Generation of k-ary Trees in Natural Order (Short Note) , 1992, Comput. J..

[10]  A simple algorithm for generating neuronal dendritic trees. , 1990, Computer methods and programs in biomedicine.

[11]  Toufik Mansour,et al.  Staircase tilings and k-Catalan structures , 2008, Discret. Math..

[12]  Abbas Nowzari-Dalini,et al.  On the generation of binary trees in A-order , 1999, Int. J. Comput. Math..

[13]  Jou-Ming Chang,et al.  Ranking and unranking of non-regular trees with a prescribed branching sequence , 2011, Math. Comput. Model..

[14]  Abbas Nowzari-Dalini,et al.  A new algorithm for generation of different types of RNA , 2010, Int. J. Comput. Math..

[15]  Jean Marcel Pallo,et al.  Generating trees with n nodes and m leaves , 1987 .

[16]  Herbert S. Wilf,et al.  Ranking Rooted Trees, and a Graceful Application , 1989 .

[17]  Brendan D. McKay,et al.  Constant Time Generation of Free Trees , 1986, SIAM J. Comput..

[18]  Pierre Hansen,et al.  Variable Neighborhood Search for Extremal Graphs. 10. Comparison of Irregularity Indices for Chemical Trees , 2003, J. Chem. Inf. Model..

[19]  Shin-Ichi Nakano,et al.  Constant Time Generation of Trees with Specified Diameter , 2004, WG.

[20]  Hiroshi Nagamochi,et al.  Enumerating tree-like chemical graphs with given upper and lower bounds on path frequencies , 2011, BMC Bioinformatics.

[21]  H. Nagamochi,et al.  Constant Time Generation of Trees with Degree Bounds (アルゴリズム(AL)) , 2010 .

[22]  Hiroshi Nagamochi,et al.  Enumerating Treelike Chemical Graphs with Given Path Frequency , 2008, J. Chem. Inf. Model..

[23]  Pierre Hansen,et al.  Coding Chemical Trees with the Centered N-tuple Code , 1994, J. Chem. Inf. Comput. Sci..

[24]  Changjie Tang,et al.  On generating k-ary trees in computer representation , 2001, Inf. Process. Lett..

[25]  P. Hansen,et al.  Variable Neighborhood Search for Extremal Graphs: IV: Chemical Trees with Extremal Connectivity Index , 1999, Comput. Chem..

[26]  O. Ivanciuc,et al.  Computer generation of acyclic graphs based on local vertex invariants and topological indices. Derived canonical labelling and coding of trees and alkanes , 1992 .

[27]  Andrey A. Dobrynin,et al.  The Average Wiener Index of Trees and Chemical Trees , 1999, J. Chem. Inf. Comput. Sci..

[28]  Pierre Hansen,et al.  Variable Neighborhood Search for Extremal Graphs: IV: Chemical Trees with Extremal Connectivity Index , 1998, Comput. Chem..

[29]  Vincent Vajnovszki,et al.  Generating binary trees in A-order from codewords defined on a four-letter alphabet , 1994 .

[30]  James B. Hendrickson,et al.  Generation and enumeration of carbon skeletons , 1991, J. Chem. Inf. Comput. Sci..

[31]  Pierre Hansen,et al.  Chemical trees enumeration algorithms , 1999, 4OR.

[32]  Abbas Nowzari-Dalini,et al.  On the generation of binary trees from (0-1) codes , 1998, Int. J. Comput. Math..

[33]  John M. Barnard,et al.  Chemical Similarity Searching , 1998, J. Chem. Inf. Comput. Sci..

[34]  Yota Otachi,et al.  Efficient enumeration of ordered trees with k leaves , 2012, Theor. Comput. Sci..

[35]  James F. Korsh Generating T-ary Trees in Linked Representation , 2005, Comput. J..

[36]  Abbas Nowzari-Dalini,et al.  Parallel generation of binary trees in A-order , 2005, Parallel Comput..

[37]  Frank Ruskey,et al.  On Rotations and the Generation of Binary Trees , 1993, J. Algorithms.

[38]  Jean Marcel Pallo,et al.  A note on generating binary trees in A-order and B-order , 1985 .

[39]  Liwu Li Ranking and Unranking of AVL-Trees , 1986, SIAM J. Comput..

[40]  Jou-Ming Chang,et al.  A linear time algorithm for binary tree sequences transformation using left-arm and right-arm rotations , 2006, Theor. Comput. Sci..

[41]  Frank Ruskey,et al.  Generating Binary Trees Lexicographically , 1977, SIAM J. Comput..

[42]  Ivan Gutman,et al.  A Collective Property of Trees and Chemical Trees , 1998, J. Chem. Inf. Comput. Sci..