Gray codes with bounded weights

Abstract Given a set H of binary vectors of length n , is there a cyclic listing of H so that every two successive vectors differ in a single coordinate? The problem of the existence of such a listing, which is called a cyclic Gray code of H , is known to be NP -complete in general. The goal of this paper is therefore to specify boundaries between its intractability and polynomial decidability. For that purpose, we consider a restriction when the vectors of H are of a bounded weight. A weight of a vector u ∈ { 0 , 1 } n is the number of 1’s in u . We show that if every vertex of H has weight k or k + 1 , our problem is decidable in polynomial time for k ≤ 1 and NP -complete for k ≥ 2 . Furthermore, if k = 2 and for every i ∈ [ n ] there are at most m vectors of H of weight two having one in the i -th coordinate, then the problem becomes decidable in polynomial time for m ≤ 3 and NP -complete for m ≥ 13 . The following complementary problem is also known to be NP -hard: given an F ⊆ { 0 , 1 } n , which now plays the role of a set of faults to be avoided, is there a cyclic Gray code of { 0 , 1 } n ∖ F ? We show that if every vertex of F has weight at most k , the problem is decidable in polynomial time for k ≤ 2 and NP -hard for k ≥ 5 . It follows that there is a function f ( n ) = Θ ( n 4 ) such that the existence of a cyclic Gray code of { 0 , 1 } n ∖ F for a given set F ⊆ { 0 , 1 } n of size at most f ( n ) is NP -hard. In addition, we study the cases when the Gray code does not have to be cyclic, and moreover, when the first and the last vectors of the code are prescribed. For these two modifications, all NP -hardness and NP -completeness results hold as well.

[1]  Nobuji Saito,et al.  NP-Completeness of the Hamiltonian Cycle Problem for Bipartite Graphs , 1980 .

[2]  Nelson Castañeda,et al.  Embedded paths and cycles in faulty hypercubes , 2010, J. Comb. Optim..

[3]  Tao Tao,et al.  Compressing bitmap indices by data reorganization , 2005, 21st International Conference on Data Engineering (ICDE'05).

[4]  Owen Kaser,et al.  Sorting improves word-aligned bitmap indexes , 2010, Data Knowl. Eng..

[5]  Gerhard J. Woeginger,et al.  Hamiltonian index is NP-complete , 2011, Discret. Appl. Math..

[6]  Petr Gregor,et al.  Long cycles in hypercubes with distant faulty vertices , 2009, Discret. Math. Theor. Comput. Sci..

[7]  I. Havel On Hamiltonian circuits and spanning trees of hypercubes , 1984 .

[8]  Stephen C. Locke Problem 10892 , 2001, Am. Math. Mon..

[9]  Junming Xu Topological Structure and Analysis of Interconnection Networks , 2002, Network Theory and Applications.

[10]  M. Lewinter,et al.  Hyper-Hamilton Laceable and Caterpillar-Spannable Product Graphs , 1997 .

[11]  Václav Koubek,et al.  Computational complexity of long paths and cycles in faulty hypercubes , 2010, Theor. Comput. Sci..

[12]  Petr Gregor,et al.  Partitions of Faulty Hypercubes into Paths with Prescribed Endvertices , 2008, SIAM J. Discret. Math..

[13]  Carla Savage,et al.  A Survey of Combinatorial Gray Codes , 1997, SIAM Rev..

[14]  Alan A. Bertossi,et al.  The Edge Hamiltonian Path Problem is NP-Complete , 1981, Inf. Process. Lett..

[15]  Tomás Dvorák,et al.  Hamiltonian Cycles with Prescribed Edges in Hypercubes , 2005, SIAM J. Discret. Math..