Abstract
We design an algorithm that generates multiset permutati- ons in O(1) time from permutation to permutations, using only data structures of arrays. The previous O(1) time algorithm used pointers, causing O(n) time to access an element in a permutation, where n is the size of permutations. The central idea in our algorithm is tree traversal. We associate permutations with the leaves of a tree. By traversing this tree, going up and down and making changes when necessary, we spend O(1) time from permutation to permutation. Permutations are generated in a one-dimensional array.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Hu, T.C. and B.N. Tien, Generating permutations with nondistinct items, Amer. Math. Monthly, 83 (1976) 193–196
Ko, C.W. and F. Ruskey, Generating permutations of a bag by interchanges, Info. Proc. Lett., 41 (1992) 263–269
Korsh, J. and S. Lipshutz, Generating multiset permutations in constant time, Jour. Algorithms, 25 (1997) 321–335
Lucas, J., The rotation graph of binary trees is Hamiltonian, Jour. Algorithms, 8 (1987) 503–535
Mikawa, K. and T. Takaoka, Generation of parenthesis strings by transpositions, Proc. the Computing: The Australasian Theory Symposium (CATS’ 97) (1997) 51–58
Nijenhuis, A. and H.S. Wilf, Combinatorial Mathematics, Academic Press (1975)
Proskurowski, A. and F. Ruskey, Generating binary trees by transpositions, Jour. Algorithms, 11 (1990) 68–84
Reingold, E.M., J. Nievergelt, and N. Deo, Combinatorial Algorithms, Prentice-Hall (1977)
Roelants van Baronaigien, D., A loopless algorithm for generating binary tree sequences, Info. Proc. Lett., 39 (1991) 189–194.
Ruskey, F. and D. Roelants van Baronaigien, Fast recursive algorithms for generating combinatorial objects, Congr. Numer., 41 (1984) 53–62
Savage, C, A survey of combinatorial Gray codes, SIAM Review, 39 (1997) 605–629
Takaoka, T., O(1) Time Algorithms for combinatorial generation by tree traversal, Computer Journal (to appear)(1999)
Vajnovski, V., On the loopless generation of binary tree sequences, Info. Proc. Lett., 68 (1998) 113–117
Walsh, T.R., Generation of well-formed parenthesis strings in constant worst-case time, Jour. Algorithms, 29 (1998) 165–173
Zerling, D., Generating binary trees by rotations, JACM, 32 (1985) 694–701
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Takaoka, T. (1999). An O(1) Time Algorithm for Generating Multiset Permutations. In: Algorithms and Computation. ISAAC 1999. Lecture Notes in Computer Science, vol 1741. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46632-0_25
Download citation
DOI: https://doi.org/10.1007/3-540-46632-0_25
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66916-6
Online ISBN: 978-3-540-46632-1
eBook Packages: Springer Book Archive