# Group theoretic construction for permutation algorithm

Consider a permutation $\sigma = [s_1, \ldots, s_n]$. The `contracting endpoints' construction for the subsequence $[s_i,\ldots, s_k]$ is given by iteratively taking the product of cycles given by the first and last elements of the sequence, successively discarding first and last elements.

Hence, the construction for [2,3,4,5] in [1,2,3,4,5,6] yields (2,5)(3,4).

Can this construction be defined purely in terms of group-theoretic operations?

Assuming you compose permutations right to left, it may be helpful to observe that $(x_2,x_k,x_{k-1},\dots,x_3)(x_1,x_2,\dots,x_k)=(x_1,x_k)$

Thanks to Marston Condor for the following:

Here's one way that's almost purely group-theoretic:

Draw a path graph $X$ with $n$ vertices labelled $s_1, s_2, \ldots, s_n$ in the given order (so the edges are ${s_1,s_2}, {s_2,s_3}$, etc.).

Then the permutation you want is the only non-trivial automorphism of $X$.

Equivalently, it's the only nontrivial element of the symmetric group $S_n$ that preserves the set of pairs ${ {s_i,s_{i+1}} : 1 \le i < n }$.