Abstract
A new algorithm for generating permutations is presented, that generates the next permutation by reversing a certain suffix of its predecessor. The average size of this suffix is less thane ≅ 2.8. It is shown how to find the position of a given permutation and how to construct the permutation of a given position, where the position refers to the order in which the permutations are generated, and is also new.
Similar content being viewed by others
References
N. Dershowitz,A simplified loop-free algorithm for generating permutations, BIT 15 (1975), 158–164.
G. Ehrlich,Loopless algorithm for generating permutations, combinations and other combinatorial configurations, J. ACM 20, 3 (1973), 500–513.
G. Ehrlich,Algorithm 466, Permu., Comm. ACM 16, 11 (1973), 690–691.
S. Even,Algorithmic Combinatorics, Macmillan, New York, (1973), 2–11.
W. H. Gates and C. H. Papadimitriou,Bounds for sorting by prefix reversals, Discrete Mathematics 27 (1979), 47–57.
S. M. Johnson,Generation of permutations by adjacent transpositions, Math. Comput. 17 (1963), 282–285.
E. M. Reingold, J. Nievergelt and N. Deo,Combinatorial Algorithms, Prentice-Hall, New Jersey, (1977), 161–171.
R. Sedgewick,Permutation generation methods, Computing Surveys, 9, 2 (1977), 137–164.
H. F. Trotter,Algorithm 115, Perm., Comm. ACM 5, 8 (1962), 434–435.
American Mathematical Monthly 82, 1 (1975), 1010.
American Mathematical Monthly 84, 4 (1977), 296.
Author information
Authors and Affiliations
Additional information
On leave from the Department of Computer Science, Technion, Haifa, Israel. This work was supported by NSF grant MCS-8302391.
Rights and permissions
About this article
Cite this article
Zaks, S. A new algorithm for generation of permutations. BIT 24, 196–204 (1984). https://doi.org/10.1007/BF01937486
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF01937486