Skip to main content

Ranking and unranking trees using regular reductions

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1046))

Abstract

We consider the problem of defining a linear order on a set of combinatorial objects so that the following two operations can be performed efficiently: (1) determine the rank of an object in the linear order (ranking); (2) compute an object from its rank (unranking). Typical applications of such an ordering include testing a program on a random or selected set of input instances and searching for counterexamples of a conjecture involving structured objects. We reduce the problem of finding such a linear order to the problem of constructing a special mapping on the set of combinatorial objects called regular reduction. We demonstrate the power of regular reductions by developing O(n) time procedures for ranking and unranking B-trees on n leaves after O(n 2) time preprocessing; the best previous ordering algorithm, although also running in linear time, required exponential time and space preprocessing. Our new paradigm also yields improved ranking and unranking algorithms for binary trees of bounded height and for height-balanced trees (see [7]).

Work funded in part by the European Commission under a research fellowship of the Human Capital and Mobility (HCM) programme.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A.V. Aho, J.E. Hopcroft, J.D. Ullman, The design and analysis of computer algorithms, Addison-Wesley, 1974.

    Google Scholar 

  2. G.M. Adel'son-Vel'skii and Y.M. Landis, An algorithm for the organization of information, Doklad. Akad. Nauk SSSR, 146 (1962), pp. 263–266; Soviet math. Dokl., 3 (1962), pp. 1259–1262.

    Google Scholar 

  3. C. Berge, Principles of combinatorics, Academic Press, New York, 1971.

    Google Scholar 

  4. R. Bayer and E. McCreight, Organization and maintenance of large ordered indexes, Acta Inform. 1 (1972), pp. 173–189.

    Article  Google Scholar 

  5. U.I. Gupta, D.T. Lee and C.K. Wong, Ranking and unranking of B-trees, Journal of Algorithms 4(1983), pp. 51–60.

    Article  Google Scholar 

  6. U.I. Gupta, D.T. Lee and C.K. Wong, Ranking and unranking of 2–3 trees, SIAM J. Comput. 11(1982), pp. 582–590.

    Article  Google Scholar 

  7. P. Kelsen, Ranking and unranking trees using regular reductions, Technical Report 93-37, Department of Computer Science, University of British Columbia, 1993.

    Google Scholar 

  8. D.E. Knuth, The art of computer programming, vol. 3: Sorting and Searching, Addison-Wesley, Reading, MA, 1973.

    Google Scholar 

  9. L. Li, Ranking and unranking of AVL-trees, SIAM J. Comput. 15 (1986), pp. 1025–1035.

    Article  Google Scholar 

  10. C.C Lee, D.T. Lee and C.K. Wong, Generating binary trees of bounded height, Acta Informatica 23, 529–544 (1986).

    Article  Google Scholar 

  11. F. Ruskey and T.C. Hu, Generating binary trees lexicographically, SIAM J. Comput. 6 (1977), pp. 745–758.

    Article  Google Scholar 

  12. F. Ruskey and D. Roelants van Baronaigien, Fast recursive algorithms for generating combinatorial objects, Congressus Numerantium, vol. 41 (1984), pp. 53–62.

    Google Scholar 

  13. H. Wilf, A unified setting for sequencing, ranking and selection algorithms for combinatorial objects, Advances in Mathematics, 24 (1977), pp.281–291.

    Google Scholar 

  14. S.G. Williamson, On the ordering, ranking and random generation of basic combinatorial sets, Lecture Notes in Mathematics, 579, Springer-Verlag, Berlin, 1976.

    Google Scholar 

  15. S. Zaks, Lexicographic generation of ordered trees, Theoretical Computer Science 10 (1980), pp, 63–82.

    Article  Google Scholar 

  16. S. Zaks, Generating trees and other combinatorial objects lexicographically, SIAM J. Comput. 8 (1979), pp. 73–81.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Claude Puech Rüdiger Reischuk

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kelsen, P. (1996). Ranking and unranking trees using regular reductions. In: Puech, C., Reischuk, R. (eds) STACS 96. STACS 1996. Lecture Notes in Computer Science, vol 1046. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60922-9_47

Download citation

  • DOI: https://doi.org/10.1007/3-540-60922-9_47

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-60922-3

  • Online ISBN: 978-3-540-49723-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics