Permutation generation
ID: permutation-generation
Permutation generation enumerates arrangements of a finite collection under a stated convention. For distinct labelled objects there are permutations, so explicitly writing every length- arrangement already requires output work. Permutation generation by insertion builds each arrangement from a shorter one; the Steinhaus-Johnson-Trotter algorithm instead changes only an adjacent transposition between consecutive arrangements. Repeated values require deciding whether positions remain distinguishable. For values
a,a,b, there are six permutations of labelled positions but only three distinct value strings. New to topics? Read the docs here!