Skip to main content
Erschienen in: Journal of Combinatorial Optimization 3/2022

11.11.2019

Improved algorithms for ranking and unranking (km)-ary trees in B-order

verfasst von: Yu-Hsuan Chang, Ro-Yu Wu, Ruay-Shiung Chang, Jou-Ming Chang

Erschienen in: Journal of Combinatorial Optimization | Ausgabe 3/2022

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Du and Liu (Eur J Comb 28:1312–1321, 2007) introduced (km)-ary trees as a generalization of k-ary trees. In a (km)-ary tree, every node on even level has degree k (i.e., has k children), and every node on odd level has degree m (which is called a crucial node) or is a leaf. In particular, a (km)-ary tree of order n has exactly n crucial nodes. Recently, Amani and Nowzari-Dalini (Bull Iranian Math Soc 45(4):1145–1158, 2019) presented a generation algorithm to produce all (km)-ary trees of order n in B-order using Zaks’ encoding, and showed that the generated ordering of this encoding results in a reverse-lexicographical ordering. They also proposed the corresponding ranking and unranking algorithms for (km)-ary trees according to such a generated ordering. These algorithms take \(\mathcal {O}(kmn^2)\) time and space for building a precomputed table in which (km)-Catalan numbers (i.e., a kind of generalized Catalan numbers) are stored in advance. Then, each ranking and unranking algorithm can be performed subsequently in \(\mathcal {O}(n)\) and \(\mathcal {O}(n\log n)\) time, respectively. In this paper, we revisit the ranking and unranking problems. With the help of an encoding scheme called “right-distance” introduced by Wu et al. (Math Comput Model 53:1331–1335, 2011a; IEICE Trans Inf Syst E94–D:226–232, 2011b), we propose new ranking and unranking algorithms for (km)-ary trees of order n in B-order using Zaks’ encoding. We show that both algorithms can be improved in \(\mathcal {O}(kmn)\) time and \(\mathcal {O}(n)\) space without building the precomputed table.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Anhänge
Nur mit Berechtigung zugänglich
Literatur
Zurück zum Zitat Amani M (2018) Gap terminology and related combinatorial properties for AVL trees and Fibonacci-isomorphic trees. AKCE Int J Graphs Comb 15:14–21MathSciNetCrossRef Amani M (2018) Gap terminology and related combinatorial properties for AVL trees and Fibonacci-isomorphic trees. AKCE Int J Graphs Comb 15:14–21MathSciNetCrossRef
Zurück zum Zitat Amani M, Nowzari-Dalini A (2015a) Ranking and unranking algorithm for neuronal trees in B-order. J Phys Sci 20:19–34MathSciNetMATH Amani M, Nowzari-Dalini A (2015a) Ranking and unranking algorithm for neuronal trees in B-order. J Phys Sci 20:19–34MathSciNetMATH
Zurück zum Zitat Amani M, Nowzari-Dalini A (2015b) Generation, ranking and unranking of ordered trees with degree bounds. In: Proceedings of DCM 2015, Electronic proceedings in theoretical computer science, vol 204, pp 31–45 Amani M, Nowzari-Dalini A (2015b) Generation, ranking and unranking of ordered trees with degree bounds. In: Proceedings of DCM 2015, Electronic proceedings in theoretical computer science, vol 204, pp 31–45
Zurück zum Zitat Amani M, Nowzari-Dalini A (2019) Efficient generation, ranking, and unranking of \((k, m)\)-ary trees in B-order. Bull Iranian Math Soc 45(4):1145–1158MathSciNetCrossRef Amani M, Nowzari-Dalini A (2019) Efficient generation, ranking, and unranking of \((k, m)\)-ary trees in B-order. Bull Iranian Math Soc 45(4):1145–1158MathSciNetCrossRef
Zurück zum Zitat Amani M, Nowzari-Dalini A, Ahrabian H (2014) Generation of neuronal trees by a new three letters encoding. Comput Inf J 33:1428–1450MathSciNetMATH Amani M, Nowzari-Dalini A, Ahrabian H (2014) Generation of neuronal trees by a new three letters encoding. Comput Inf J 33:1428–1450MathSciNetMATH
Zurück zum Zitat Du RRX, Liu F (2007) \((k, m)\)-Catalan numbers and hook length polynomials for plane trees. Eur J Comb 28:1312–1321MathSciNetCrossRef Du RRX, Liu F (2007) \((k, m)\)-Catalan numbers and hook length polynomials for plane trees. Eur J Comb 28:1312–1321MathSciNetCrossRef
Zurück zum Zitat Pai K-J, Chang J-M, Wu R-Y, Chang S-C (2019) Amortized efficiency of generation, ranking and unranking left-child sequences in lexicographic order. Discrete Appl Math 268:223–236MathSciNetCrossRef Pai K-J, Chang J-M, Wu R-Y, Chang S-C (2019) Amortized efficiency of generation, ranking and unranking left-child sequences in lexicographic order. Discrete Appl Math 268:223–236MathSciNetCrossRef
Zurück zum Zitat Pallo J (1987) Generating trees with \(n\) nodes and \(m\) leaves. Int J Comput Math 21:133–144CrossRef Pallo J (1987) Generating trees with \(n\) nodes and \(m\) leaves. Int J Comput Math 21:133–144CrossRef
Zurück zum Zitat Seyedi-Tabari E, Ahrabian H, Nowzari-Dalini A (2010) A new algorithm for generation of different types of RNA. Int J Comput Math 87:1197–1207MathSciNetCrossRef Seyedi-Tabari E, Ahrabian H, Nowzari-Dalini A (2010) A new algorithm for generation of different types of RNA. Int J Comput Math 87:1197–1207MathSciNetCrossRef
Zurück zum Zitat Stanley RP (1999) Enumerative combinatorics, vol 2. Cambridge University Press, CambridgeCrossRef Stanley RP (1999) Enumerative combinatorics, vol 2. Cambridge University Press, CambridgeCrossRef
Zurück zum Zitat Wu R-Y, Chang J-M, Wang Y-L (2006) A linear time algorithm for binary tree sequences transformation using left-arm and right-arm rotations. Theor Comput Sci 355:303–314MathSciNetCrossRef Wu R-Y, Chang J-M, Wang Y-L (2006) A linear time algorithm for binary tree sequences transformation using left-arm and right-arm rotations. Theor Comput Sci 355:303–314MathSciNetCrossRef
Zurück zum Zitat Wu R-Y, Chang J-M, Wang Y-L (2010) Loopless generation of non-regular trees with a prescribed branching sequence. Comput J 53:661–666CrossRef Wu R-Y, Chang J-M, Wang Y-L (2010) Loopless generation of non-regular trees with a prescribed branching sequence. Comput J 53:661–666CrossRef
Zurück zum Zitat Wu R-Y, Chang J-M, Chang C-H (2011a) Ranking and unranking of non-regular trees with a prescribed branching sequence. Math Comput Model 53:1331–1335MathSciNetCrossRef Wu R-Y, Chang J-M, Chang C-H (2011a) Ranking and unranking of non-regular trees with a prescribed branching sequence. Math Comput Model 53:1331–1335MathSciNetCrossRef
Zurück zum Zitat Wu R-Y, Chang J-M, Wang Y-L (2011b) Ranking and unranking of \(t\)-ary trees using RD-sequences. IEICE Trans Inf Syst E94–D:226–232CrossRef Wu R-Y, Chang J-M, Wang Y-L (2011b) Ranking and unranking of \(t\)-ary trees using RD-sequences. IEICE Trans Inf Syst E94–D:226–232CrossRef
Zurück zum Zitat Wu R-Y, Chang J-M, Chen A-H, Liu C-L (2013) Ranking and unranking \(t\)-ary trees in a Gray-code order. Comput J 56:1388–1395CrossRef Wu R-Y, Chang J-M, Chen A-H, Liu C-L (2013) Ranking and unranking \(t\)-ary trees in a Gray-code order. Comput J 56:1388–1395CrossRef
Zurück zum Zitat Wu R-Y, Chang J-M, Chan H-C, Pai K-J (2014) A loopless algorithm for generating multiple binary tree sequences simultaneously. Theor Comput Sci 556:25–33MathSciNetCrossRef Wu R-Y, Chang J-M, Chan H-C, Pai K-J (2014) A loopless algorithm for generating multiple binary tree sequences simultaneously. Theor Comput Sci 556:25–33MathSciNetCrossRef
Metadaten
Titel
Improved algorithms for ranking and unranking (k, m)-ary trees in B-order
verfasst von
Yu-Hsuan Chang
Ro-Yu Wu
Ruay-Shiung Chang
Jou-Ming Chang
Publikationsdatum
11.11.2019
Verlag
Springer US
Erschienen in
Journal of Combinatorial Optimization / Ausgabe 3/2022
Print ISSN: 1382-6905
Elektronische ISSN: 1573-2886
DOI
https://doi.org/10.1007/s10878-019-00469-z

Weitere Artikel der Ausgabe 3/2022

Journal of Combinatorial Optimization 3/2022 Zur Ausgabe

Premium Partner