Generalized Gray codes with prescribed ends
arXiv:1603.08827 · doi:10.1016/j.tcs.2017.01.010
Abstract
An -bit Gray code is a sequence of all -bit strings such that consecutive strings differ in a single bit. It is well-known that given , an -bit Gray code between and exists iff the Hamming distance of and is odd. We generalize this classical result to pairwise disjoint pairs : if is odd for all and , then the set of all -bit strings can be partitioned into sequences such that the -th sequence leads from to and consecutive strings differ in a single bit. This holds for every with one exception in the case when . Our result is optimal in the sense that for every there are pairwise disjoint pairs with odd for which such sequences do not exist.
30 pages, 2 figures