Ranking and unranking trees using regular reductions
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(n2) 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 ).
KeywordsRecurrence Relation Linear Order Rooted Tree Regular Tree Weighted Tree
Unable to display preview. Download preview PDF.
- 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
- 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
- 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