A simplified loop-free algorithm for generating permutations

Nachum Dershowitz*

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review


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 languageEnglish
Pages (from-to)158-164
Number of pages7
Issue number2
StatePublished - Jun 1975
Externally publishedYes


  • loop-free algorithms
  • ordering
  • permutation generation
  • permutations
  • permutations and combinations


Dive into the research topics of 'A simplified loop-free algorithm for generating permutations'. Together they form a unique fingerprint.

Cite this