Skip to main content

Ranking and Unranking Algorithms for Loopless Generation of Non-regular Trees

  • Conference paper
  • 1940 Accesses

Part of the book series: Smart Innovation, Systems and Technologies ((SIST,volume 20))

Abstract

A non-regular tree T with a prescribed branching sequence (s 1,s 2,…,s n ) is an ordered tree whose internal nodes are numbered from 1 to n in preorder such that every node i in T has s i children. Recently, Wu et al. (2010) introduced a concise representation called RD-sequences to represent all non-regular trees and proposed a loopless algorithm for generating all non-regular trees in a Gray-code order. In this paper, based on such a Gray-code order, we present efficient ranking and unranking algorithms of non-regular trees with n internal nodes. Moreover, we show that each of the algorithms can be run in \({\mathcal O}(n^2)\) time provided a preprocessing takes \({\mathcal O}(n^2S_{n-1})\) time and space in advance, where \(S_{n-1}=\sum_{i=1}^{n-1}(s_i-1)\).

This work was partially supported by the National Science Council of Taiwan under contracts NSC101-2221-E-262-020 and NSC101-2115-M-141-001.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   169.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   219.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ahmadi-Adl, A., Nowzari-Dalini, A., Ahrabian, H.: Ranking and unranking algorithms for loopless generation of t-ary trees. Logic J. IGPL 19, 33–43 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  2. Ahrabian, H., Nowzari-Dalini, A.: Generation of t-ary trees with ballot-sequences. Int. J. Comput. Math. 80, 1243–1249 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  3. Er, M.C.: Lexicographic listing and ranking t-ary trees. Comput. J. 30, 569–572 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  4. Er, M.C.: A simple algorithm for generating non-regular trees in lexicographic order. Comput. J. 31, 61–64 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  5. Korsh, J.F.: Loopless generation of k-ary tree sequences. Inform. Process. Lett. 52, 243–247 (1994)

    Article  MathSciNet  Google Scholar 

  6. Korsh, J.F., LaFollette, P.: Loopless generation of Gray codes for k-ary trees. Inform. Process. Lett. 70, 7–11 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  7. Korsh, J.F., LaFollette, P.: A loopless Gray code for rooted trees. ACM Trans. Algorithms 2, 135–152 (2006)

    Article  MathSciNet  Google Scholar 

  8. Korsh, J.F., Lipschutz, S.: Shift and loopless generation of k-ary trees. Inform. Process. Lett. 65, 235–240 (1998)

    Article  MathSciNet  Google Scholar 

  9. Roelants van Baronaigien, D.: A loopless Gray-code algorithm for listing k-ary trees. J. Algorithms 35, 100–107 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  10. Roelants van Baronaigien, D., Ruskey, F.: Generating t-ary trees in A-order. Inform. Process. Lett. 27, 205–213 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  11. Ruskey, F.: Generating t-ary trees lexicographically. SIAM J. Comput. 7, 424–439 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  12. Savage, C.D.: A survey of combinatorial Gray codes. SIAM Review 39, 605–629 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  13. Trojanowaki, A.E.: Ranking and listing algorithms for k-ary trees. SIAM J. Comput. 7, 492–509 (1978)

    Article  MathSciNet  Google Scholar 

  14. Wu, R.-Y., Chang, J.-M., Chang, C.-H.: Ranking and unranking of non-regular trees with a prescribed branching sequence. Math. Comput. Modelling 53, 1331–1335 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  15. Wu, R.-Y., Chang, J.-M., Wang, Y.-L.: Loopless Generation of non-regular trees with a prescribed branching sequence. Comput. J. 53, 661–666 (2010)

    Article  Google Scholar 

  16. Wu, R.-Y., Chang, J.-M., Wang, Y.-L.: Ranking and unranking of t-ary trees using RD-sequences. IEICE Trans. Inform. Sys. E94-D, 226–232 (2011)

    Article  Google Scholar 

  17. Xiang, L., Ushijima, K., Tang, C.: Efficient loopless generation of Gray codes for k-ary trees. Inform. Process. Lett. 76, 169–174 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  18. Zaks, S.: Lexicographic generation of ordered trees. Theore. Comput. Sci. 10, 63–82 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  19. Zaks, S.: Generation and ranking of k-ary trees. Inform. Process. Lett. 14, 44–48 (1982)

    Article  MathSciNet  Google Scholar 

  20. Zaks, S., Richards, D.: Generating trees and other combinatorial objects lexicographically. SIAM J. Comput. 81, 73–81 (1979)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wu, RY., Chang, JM., Chen, AH., Ko, MT. (2013). Ranking and Unranking Algorithms for Loopless Generation of Non-regular Trees. In: Chang, RS., Jain, L., Peng, SL. (eds) Advances in Intelligent Systems and Applications - Volume 1. Smart Innovation, Systems and Technologies, vol 20. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35452-6_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-35452-6_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-35451-9

  • Online ISBN: 978-3-642-35452-6

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics