An $\mathcal{O}(n)$ Space Construction of Superpermutations
Dhruv Ajmera
TL;DR
The paper addresses the challenge of constructing superpermutations with limited memory. It introduces a bead-based framework and a hierarchical assembly via 1-rings and k-rings, employing straight-shift and mirror-shift operations to generate the sequence incrementally while printing on the fly. It proves structural properties such as maximal overlaps, palindrome behavior, and derives a closed-form expression for the sequence length, complemented by a concrete Java implementation. Compared to recursive and graph-theoretic methods, the approach achieves $O(n!)$ time with $O(n)$ space, enabling generation of larger instances in practice and offering a significant memory advantage for superpermutation construction.
Abstract
A superpermutation is a sequence that contains every permutation of $n$ distinct symbols as a contiguous substring. For instance, a valid example for three symbols is a sequence that contains all six permutations. This paper introduces a new algorithm that constructs such sequences more efficiently than existing recursive and graph-theoretic methods. Unlike traditional techniques that suffer from scalability and factorial memory demands, the proposed approach builds superpermutations directly and compactly. This improves memory usage, enabling the construction of larger sequences previously considered impractical.
