On the Hardness of Gray Code Problems for Combinatorial Objects
Arturo Merino, Namrata, Aaron Williams
TL;DR
This work studies the decision problem of whether a Gray code exists for a fixed family of combinatorial objects under a specified flip operation. It introduces the concept of Gray code reductions via hypercubes and proves NP-completeness for a broad class of Gray-code problems, including bitstrings, permutations, combinations, non-crossing partitions, and graphs. The authors establish two primary NP-hard source problems, $2\text{TupleGC}'$ and BitstringGC, and transfer hardness to many target problems through structured reductions and gadget encodings, notably embedding induced subgraphs isomorphic to hypercubes. The results reveal pervasive computational hardness behind seemingly natural Gray-code existence questions and highlight a framework for proving NP-hardness via Gray-code reductions, with implications for understanding the limits of efficient Gray-code constructions. The paper also outlines open directions, such as further hardness results for geometry-based objects and the potential for identifying tractable subfamilies.
Abstract
Can a list of binary strings be ordered so that consecutive strings differ in a single bit? Can a list of permutations be ordered so that consecutive permutations differ by a swap? Can a list of non-crossing set partitions be ordered so that consecutive partitions differ by refinement? These are examples of Gray coding problems: Can a list of combinatorial objects (of a particular type and size) be ordered so that consecutive objects differ by a flip (of a particular type)? For example, 000, 001, 010, 100 is a no instance of the first question, while 1234, 1324, 1243 is a yes instance of the second question due to the order 1243, 1234, 1324. We prove that a variety of Gray coding problems are NP-complete using a new tool we call a Gray code reduction.
