Definition: Generate permutations by transposing one pair of elements at a time.

Also known as Steinhaus-Johnson-Trotter.

Generalization (I am a kind of ...)

See also Fisher-Yates shuffle, Gray code.

Author: PEB

More information

Hale F. Trotter, Perm (Algorithm 115), CACM, 5(8):434-435, August 1962.
Selmer M. Johnson, Generation of Permutations by Adjacent Transposition, Mathematics of Computation, 17(83):282-285, July 1963.

Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul Black.

Entry modified 14 December 2020.
HTML page formatted Mon Dec 14 10:59:03 2020.

Cite this as:
Paul E. Black, "Johnson-Trotter", in Dictionary of Algorithms and Data Structures [online], Paul E. Black, ed. 14 December 2020. (accessed TODAY) Available from: