Table of Contents
Fetching ...

Generating Signed Permutations by Twisting Two-Sided Ribbons

Yuan, Qiu, Aaron Williams

TL;DR

The paper addresses the problem of efficiently generating all signed permutations of $[n]$, which number $2^n \cdot n!$, by introducing twisted plain changes—a twist-based generalization of plain changes implemented with two-sided ribbons. The authors develop a greedy construction that prioritizes $2$-twists on the largest symbol before $1$-twists, yielding a twist Gray code for $S_n^{\pm}$ and a loopless, mixed-radix Gray code implementation based on signed ruler sequences. Key contributions include the definition and analysis of twisted plain changes, the 2-twisted permutohedron framework, a signed ruler-sequence formalism, and an explicit loopless algorithm with a Python appendix. The work provides an efficient, memory-light method to enumerate signed permutations with potential impact in areas like genomics and network design, and it connects classical Gray codes to a rich signed-twist generalization through ruler-based encoding.

Abstract

We provide a simple and natural solution to the problem of generating all $2^n \cdot n!$ signed permutations of $[n] = \{1,2,\ldots,n\}$. Our solution provides a pleasing generalization of the most famous ordering of permutations: plain changes (Steinhaus-Johnson-Trotter algorithm). In plain changes, the $n!$ permutations of $[n]$ are ordered so that successive permutations differ by swapping a pair of adjacent symbols, and the order is often visualized as a weaving pattern involving $n$ ropes. Here we model a signed permutation using $n$ ribbons with two distinct sides, and each successive configuration is created by twisting (i.e., swapping and turning over) two neighboring ribbons or a single ribbon. By greedily prioritizing $2$-twists of the largest symbol before $1$-twists of the largest symbol, we create a signed version of plain change's memorable zig-zag pattern. We provide a loopless algorithm (i.e., worst-case $\mathcal{O}(1)$-time per object) by extending the well-known mixed-radix Gray code algorithm.

Generating Signed Permutations by Twisting Two-Sided Ribbons

TL;DR

The paper addresses the problem of efficiently generating all signed permutations of , which number , by introducing twisted plain changes—a twist-based generalization of plain changes implemented with two-sided ribbons. The authors develop a greedy construction that prioritizes -twists on the largest symbol before -twists, yielding a twist Gray code for and a loopless, mixed-radix Gray code implementation based on signed ruler sequences. Key contributions include the definition and analysis of twisted plain changes, the 2-twisted permutohedron framework, a signed ruler-sequence formalism, and an explicit loopless algorithm with a Python appendix. The work provides an efficient, memory-light method to enumerate signed permutations with potential impact in areas like genomics and network design, and it connects classical Gray codes to a rich signed-twist generalization through ruler-based encoding.

Abstract

We provide a simple and natural solution to the problem of generating all signed permutations of . Our solution provides a pleasing generalization of the most famous ordering of permutations: plain changes (Steinhaus-Johnson-Trotter algorithm). In plain changes, the permutations of are ordered so that successive permutations differ by swapping a pair of adjacent symbols, and the order is often visualized as a weaving pattern involving ropes. Here we model a signed permutation using ribbons with two distinct sides, and each successive configuration is created by twisting (i.e., swapping and turning over) two neighboring ribbons or a single ribbon. By greedily prioritizing -twists of the largest symbol before -twists of the largest symbol, we create a signed version of plain change's memorable zig-zag pattern. We provide a loopless algorithm (i.e., worst-case -time per object) by extending the well-known mixed-radix Gray code algorithm.
Paper Structure (22 sections, 2 theorems, 5 equations, 7 figures, 1 table, 3 algorithms)

This paper contains 22 sections, 2 theorems, 5 equations, 7 figures, 1 table, 3 algorithms.

Key Result

theorem thmcountertheorem

Algorithm alg:greedy creates a twist Gray code for signed permutations which starts at ${+}1 {+}2 {+}3 \cdots {+}n \in S_{n}^{\pm}$ and prioritizes $2$-twists of the largest value followed by $1$-twists of the largest value. The order is cyclic as the last signed permutation is ${-}1 {+}2 {+}3 \cdot

Figures (7)

  • Figure 1: Two-sided ribbons with distinct positive (i.e., glossy) and negative (i.e., matte) sides running in parallel. A $k$-twist reverses the order of $k$ neighboring ribbons and turns each of them over, as shown for (a) $k=1$ and (b) $k=2$.
  • Figure 2: Binary reflected Gray code using indistinct two-sided ribbons for $n=4$.
  • Figure 3: Plain changes $\mathsf{plain}(n)$ using distinct one-sided ribbons for $n=4$.
  • Figure 4: Twisted plain changes $\mathsf{twisted}(n)$ for $n=4$ up to its $25$th entry.
  • Figure 5: The permutohedron and the $2$-twisted permutohedron for $n=4$.
  • ...and 2 more figures

Theorems & Definitions (4)

  • definition thmcounterdefinition
  • theorem thmcountertheorem
  • proof
  • theorem thmcountertheorem