Abstract
A simple loop-free algorithm for generation of all permutations of a set of elements is presented and its validity is proved. It is a simplification of Ehrlich's loop-free version of Johnson and Trotter's algorithm. Each permutation is generated by exchanging two adjacent elements of the preceding permutation. A very simple data structure obviates the need for looping during the generation of each successive permutation.
Original language | English |
---|---|
Pages (from-to) | 158-164 |
Number of pages | 7 |
Journal | BIT |
Volume | 15 |
Issue number | 2 |
DOIs | |
State | Published - Jun 1975 |
Externally published | Yes |
Keywords
- loop-free algorithms
- ordering
- permutation generation
- permutations
- permutations and combinations