BIT Numerical Mathematics

, Volume 30, Issue 1, pp 17–26 | Cite as

Generating alternating permutations lexicographically

  • Bruce Bauslaugh
  • Frank Ruskey
Part I Computer Science


A permutation π1 π2 ... π n is alternating if π1234 .... We present a constant average-time algorithm for generating all alternating permutations in lexicographic order. Ranking and unranking algorithms are also derived.

CR Categories

F.2.2 G.2.1 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    L. Comtet:Advanced Combinatorics. D. Reidel, 1974.Google Scholar
  2. [2]
    R. C. Entringer:A combinatorial interpretation of the Euler and Bernoulli numbers. Nieuw Archief voor Wiskunde 14:241–246, 1966.Google Scholar
  3. [3]
    T. Hough and F. Ruskey:An efficient implementation of the Eades, Hickey, Read adjacent interchange combination generation algorithm. J. Combinat. Math. and Combinat. Computing, 4:79–86, 1988.Google Scholar
  4. [4]
    A. D. Kalvin and Y. L. Varol:On the generation of all topological sortings. J. Algorithms, 4:150–162, 1983.CrossRefGoogle Scholar
  5. [5]
    R. Kemp:Fundamentals of the Average Case Analysis of Particular Algorithms. Wiley-Teubner, 1984.Google Scholar
  6. [6]
    D. E. Knuth:Sorting and Searching. Addison-Wesley, 1973.Google Scholar
  7. [7]
    D. E. Knuth and T. J. Buckholtz:Computing of Tangent, Euler, and Bernoulli numbers. Math. Computation, 21:663–688, 1967.Google Scholar
  8. [8]
    A. Nijenhuis and H. S. Wilf:Combinatorial Algorithms, 2nd Ed. Academic Press, 1978.Google Scholar
  9. [9]
    R. J. Ord-Smith:Generation of permutations in lexicographic order (algorithm 323). Comm. ACM, 2:117, 1968.CrossRefGoogle Scholar
  10. [10]
    G. Pruesse and F. Ruskey:Transposition Generation of the Linear Extensions of Certain Posets. Technical Report DCS-91-IR, U. Victoria, 1988.Google Scholar
  11. [11]
    E. M. Reingold, J. Nievergelt, and N. Deo:Combinatorial Algorithms: Theory and Practice. Prentice-Hall, 1977.Google Scholar
  12. [12]
    F. Ruskey:Transposition Generation of Alternating Permutations. Technical Report DCS-90-IR. U. Victoria, 1988.Google Scholar
  13. [13]
    F. Ruskey and A. Proskurowski:Generating binary trees by transpositions. J. Algorithms, to appear.Google Scholar
  14. [14]
    R. Sedgewick:Permutation generation methods. Computing Surveys, 9:137–164, 1977.CrossRefGoogle Scholar
  15. [15]
    H. S. Wilf:A unified setting for sequencing, ranking and selection algorithms for combinatorial objects. Advances in Math., 24:281–291, 1977.Google Scholar
  16. [16]
    S. Zaks:Lexicographic generation of ordered trees. Theoretical Computer Science, 10:63–82, 1980.CrossRefGoogle Scholar
  17. [17]
    S. Zaks and D. Richards:Generating trees and other combinatorial objects lexicographically. SIAM J. Computing, 8:73–81, 1979.CrossRefGoogle Scholar

Copyright information

© BIT Foundations 1990

Authors and Affiliations

  • Bruce Bauslaugh
    • 1
    • 2
  • Frank Ruskey
    • 1
  1. 1.Department of Computer ScienceUniversity of VictoriaVictoriaCanada
  2. 2.Dept. of MathematicsSimon Fraser UniversityBurnabyCanada

Personalised recommendations