🤖 AI Summary
This study addresses the long-standing challenge of efficiently generating, ranking, and unranking cyclic pivot Gray codes for well-ordered $k$-degenerate graphs, which have historically been constrained by acyclic requirements and a lack of concise algorithms. To overcome these limitations, this work proposes the first simple algorithms for constructing such cyclic pivot Gray codes, effectively breaking through traditional acyclic restrictions. The approach employs a constant amortized-time generation strategy alongside ranking and unranking techniques designed with an $O(n^2)$ space complexity. Consequently, the proposed methods achieve highly efficient generation in constant amortized time per graph, while both ranking and unranking operations maintain $O(n^2)$ time and space complexities. This research delivers the first unified solution that simultaneously ensures theoretical completeness and practical efficiency for this problem domain.
📝 Abstract
A graph $G$ is $k$-degenerate if there exists an ordering $v_1, v_2, \dots, v_n$ of its vertices such that each vertex $v_i$ has at most $k$ neighbors $v_j$ in $G$ with $j < i$. A well-ordered $k$-degenerate graph is a labeled graph on the vertex set $\{1, 2, \dots, n\}$ in which every vertex $i$ has at most $k$ neighbors among $1, 2, \dots, i-1$. We present the first simple algorithms that generate, rank, and unrank cyclic pivot Gray codes for well-ordered $k$-degenerate graphs, where consecutive graphs differ by the addition, removal, or pivoting of a single edge. Our algorithm generates each well-ordered $k$-degenerate graph in constant amortized time per graph, using $O(n^2)$ space, while ranking and unranking take $O(n^2)$ time and $O(n^2)$ space.