Skip to main content

An O(1) Time Algorithm for Generating Multiset Permutations

  • Conference paper
  • First Online:
Algorithms and Computation (ISAAC 1999)

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

Included in the following conference series:

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.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Hu, T.C. and B.N. Tien, Generating permutations with nondistinct items, Amer. Math. Monthly, 83 (1976) 193–196

    Google Scholar 

  2. Ko, C.W. and F. Ruskey, Generating permutations of a bag by interchanges, Info. Proc. Lett., 41 (1992) 263–269

    Google Scholar 

  3. Korsh, J. and S. Lipshutz, Generating multiset permutations in constant time, Jour. Algorithms, 25 (1997) 321–335

    Google Scholar 

  4. Lucas, J., The rotation graph of binary trees is Hamiltonian, Jour. Algorithms, 8 (1987) 503–535

    Google Scholar 

  5. Mikawa, K. and T. Takaoka, Generation of parenthesis strings by transpositions, Proc. the Computing: The Australasian Theory Symposium (CATS’ 97) (1997) 51–58

    Google Scholar 

  6. Nijenhuis, A. and H.S. Wilf, Combinatorial Mathematics, Academic Press (1975)

    Google Scholar 

  7. Proskurowski, A. and F. Ruskey, Generating binary trees by transpositions, Jour. Algorithms, 11 (1990) 68–84

    Google Scholar 

  8. Reingold, E.M., J. Nievergelt, and N. Deo, Combinatorial Algorithms, Prentice-Hall (1977)

    Google Scholar 

  9. Roelants van Baronaigien, D., A loopless algorithm for generating binary tree sequences, Info. Proc. Lett., 39 (1991) 189–194.

    Google Scholar 

  10. Ruskey, F. and D. Roelants van Baronaigien, Fast recursive algorithms for generating combinatorial objects, Congr. Numer., 41 (1984) 53–62

    Google Scholar 

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

    Google Scholar 

  12. Takaoka, T., O(1) Time Algorithms for combinatorial generation by tree traversal, Computer Journal (to appear)(1999)

    Google Scholar 

  13. Vajnovski, V., On the loopless generation of binary tree sequences, Info. Proc. Lett., 68 (1998) 113–117

    Google Scholar 

  14. Walsh, T.R., Generation of well-formed parenthesis strings in constant worst-case time, Jour. Algorithms, 29 (1998) 165–173

    Google Scholar 

  15. Zerling, D., Generating binary trees by rotations, JACM, 32 (1985) 694–701

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics