🤖 AI Summary
This work addresses the exhaustive generation of pattern-avoiding languages over multiset permutations (s-words). To overcome the limitation that classical permutation generation algorithms—such as plain changes and Algorithm J—do not generalize naturally to multisets, we introduce a “collision” operation as a substitute for traditional jump operations, and devise a greedy, rule-based generation framework: collisions are executed according to three prioritized criteria—maximum value first, maximum index first, and rightmost preference—yielding Gray-code orderings. We present the first efficient algorithm for generating s-Stirling words, construct novel Gray codes for multiple s-Catalan families—including s-Dyck paths and s-ballot sequences—and establish Hamiltonian paths on the s-permutahedron, thereby unifying the generation of several classes of mildly restricted pattern-avoiding languages. These results extend combinatorial generation theory and significantly improve both efficiency and generality in structured enumeration under multiset constraints.
📝 Abstract
The most well-known Gray code of permutations is plain changes. It was discovered in the 1600s by bell-ringers who wished to order the permutations of [n] by swaps (e.g., 123, 132, 312, 321, 231, 213 for n = 3). In other words, plain changes traces a Hamilton path in the permutohedron. In 2013 it was shown that plain changes can be generated by a greedy algorithm: swap the largest value. Algorithm J replaces the swap operation with the jump operation (which moves a larger digit past one or more smaller digits) and forms the basis of the wildly successful Combinatorial Generation via Permutation Languages series of papers.
Here we further generalize this line of research to languages of s-words (i.e., multiset permutations). We generalize jumps to bumps, which moves a sequential run of the same larger digit past one or more smaller digits. Algorithm B greedily applies minimum-length bumps prioritized by largest value, then largest index, then rightward before leftward (e.g. 1122, 1221, 1212, 2112, 2121, 2211 for s = (2, 2)).
We show that the algorithm works for s-word languages avoiding a wide variety of tame patterns. Specific applications include efficient algorithm for generating s-Stirling words (which avoid 121) and new Gray codes for various s-Catalan objects (which avoid 132 and 121). The former result leads to Hamilton paths in every s-permutahedron.