← Back to arXiv
arXivCombinatoricsarXiv:2609.13214

Genlex Gray codes for $S_n$ with the fewest operations: classification and symmetry

The paper studies efficient ways to list all arrangements of n objects so that consecutive arrangements differ by simple, well-defined operations. This kind of listing is called a Gray code, named after the idea of moving through a space of configurations one small step at a time. The specific focus is on "genlex" Gray codes, where arrangements that share a common ending are grouped together, making the structure recursive and hierarchical. The central question is: among all such genlex Gray codes, which ones use the smallest possible number of distinct operations to move from one arrangement to the next?

The authors find a complete answer. There is an entire family of optimal genlex Gray codes, all of which generalize a classical construction due to Zaks. The size of this family grows very rapidly with n (superfactorially), yet the authors prove that nothing outside this family can achieve the minimum number of operations. Every code in the family can be arranged into a closed loop, and these loops have a rich symmetry: each one is preserved under a natural group of relabeling symmetries, which turns out to be either a cyclic group of order n or a dihedral group of order 2n, depending on a concrete property of the operations used. The authors give an explicit rule for determining which symmetry applies in any given case.

The paper also connects these abstract combinatorial results to two well-studied mathematical structures. In the pancake graph, a network where adjacent nodes differ by a prefix reversal (like flipping a stack of pancakes), the entire optimal family collapses to a single representative: Zaks' original ordering. Additionally, this ordering is shown to sit at one extreme of a natural measure of complexity tied to the theory of Coxeter groups, which are algebraic objects that capture the symmetry of geometric reflections. These connections suggest the optimal codes are not just efficient but are deeply natural objects within several branches of mathematics.

Read original →