Long cycles in hypercubes with distant faulty vertices

In this paper, we study long cycles in induced subgraphs of hypercubes obtained by removing a given set of faulty vertices such that every two faults are distant. First, we show that every induced subgraph of Q(n) with minimum degree n - 1 contains a cycle of length at least 2(n) - 2(f) where f is the number of removed vertices. This length is the best possible when all removed vertices are from the same bipartite class of Q(n). Next, we prove that every induced subgraph of Q(n) obtained by removing vertices of some given set M of edges of Q(n) contains a Hamiltonian cycle if every two edges of M are at distance at least 3. The last result shows that the shell of every linear code with odd minimum distance at least 3 contains a Hamiltonian cycle. In all these results we obtain significantly more tolerable faulty vertices than in the previously known results. We also conjecture that every induced subgraph of Q(n) obtained by removing a balanced set of vertices with minimum distance at least 3 contains a Hamiltonian cycle.


Introduction
Given a set U of binary strings of length n, is there a (cyclic) ordering of U such that every two consecutive strings differ in a single bit?This can be viewed as a problem of Hamiltonian paths (cycles) in the induced subgraph of the n-dimensional hypercube Q n obtained by removing a given set F = V (Q n ) \ U of faulty vertices.Clearly, since Q n is bipartite and balanced in the sense that it contains the same number of vertices in each bipartite class (called parity), it follows that F must be balanced as well (almost-balanced for Hamiltonian paths between vertices of the same parity).
If there are no restrictions on U , this problem was recently proved to be NP-complete [4].On the other hand, if there are only few faulty vertices, the answer to this problem is positive.In particular, it is wellknown that Q n for any n ≥ 1 has a Hamiltonian path between every two vertices of opposite parity.The corresponding (cyclic) ordering of V (Q n ) = {0, 1} n is called a (cyclic) Gray code, named after Frank Gray who patented a scheme to generate such code [7].These codes have applications in many areas such as data compression, image processing, information retrieval, signal encoding, processor allocation in hypercubic networks.More on Gray codes can be found in a survey by Savage [11].
As for other previous results, Lewinter and Widulski [8] showed that for every vertex u, the graph Q n − {u} contains a Hamiltonian path between every two vertices of the parity other than the parity of u.Then, Locke and Stong [9] showed that Q n − {u, v} has a Hamiltonian cycle for every two vertices u and v of opposite parity.Furthermore, by result due to Dvořák and Gregor [4], Q n − F has a Hamiltonian cycle for every balanced set F ⊆ V (Q n ) with |F | ≤ (n − 5)/3.It is also claimed (without a proof) in [9] that this bound can be improved to |F | + 3 log 2 |F | + 1 ≤ n.Note that the best possible upper bound would be |F | ≤ 2n − 3 since there is a balanced set F of 2n − 2 vertices of Q n such that Q n − F contains a vertex of degree 1.
In this paper we try to significantly improve the number of tolerable faulty vertices under some additional condition on their structure.A similar approach has been successfully applied for the analogous problem with faulty edges in [3] where it has been characterized for every set M of independent edges (matching) of Q n when Q n − M contains a Hamiltonian cycle.
The considered condition on the faulty vertices is that they are not close to each other.For F ⊆ V (Q n ) let d(F ) denote the minimum (Hamming) distance between every two vertices of F .This parameter plays an important role in the design of error-correcting codes.If we encode a message into a sequence of blocks from F ⊆ V (Q n ), then we can correct any up to (d(F ) − 1)/2 errors occurring in each block.For more information on error-correcting codes, we refer to the monograph by MacWilliams and Sloane [10].
Note that the above mentioned balanced set Thus, it is natural to require, apart from the balance of F , that d(F ) ≥ 3. We conjecture that these necessary conditions are also sufficient.A stronger form of the above conjecture requires only vertices of a same parity to be distant.Note that the minimum distance 3 is now replaced by 4 since every two vertices of the same parity are at even distance.The above conjectures are stated in the strongest possible form regarding the prescribed minimum distance between vertices.Although weaker, it is still interesting to establish variants of the above conjectures when the set of vertices have higher distance, i.e. replacing the minimum distances 3 and 4 by bigger integers.
To support Conjecture 1, we have three partial results indicating that it should hold.In Section 3 we study long cycles in induced subgraphs G of Q n with minimum degree δ(G) ≥ n − 1.
not vice-versa.Thus, Theorem 1 considers more general sets than Conjecture 1.Moreover, the set F can be unbalanced so Theorem 1 can only find shorter cycles than Hamiltonian cycles.But in the particular case when F contains only vertices of the same parity, the length of the cycle obtained by Theorem 1 is the best possible.
Cycles of at least this length have been previously found by Fu [6] in Q n with any set F of faulty vertices such that |F | ≤ 2n − 5.Then, this bound was improved by Castañeda and Gotchev [1] to |F | ≤ 3n−7 for n ≥ 5. Recently, it was further increased by Fink and Gregor [5] to |F | ≤ n 2 /10+n/2+1 for n ≥ 15 which is also asymptotically optimal (if there are no restrictions on F ).However, in Theorem 1 we may have a nontrivial set F of up to 2 n−1 vertices.
In Section 4 we study induced subgraphs of Q n obtained by removing the vertices of a given set of edges with minimum distance d(M ) ≥ 3. Note that we state the following theorem for the dimension n + 2 instead of n only for technical reasons.
Clearly, for every (nontrivial) set M of edges of Q n , the condition d(M ) ≥ 3 is equivalent to the condition that the graph G = Q n −V (M ) has minimum degree δ(G) ≥ n−1 and its complement in Q n has regular degree 1.In this sense, Theorem 2 studies a subclass of induced subgraphs of Q n that are considered in Theorem 1.On the other hand, Theorem 2 gives Hamiltonian cycles instead of long cycles in Theorem 1.
Moreover, the bound d(M ) ≥ 3 in Theorem 2 is tight.To see this, consider a matching M consisting of n − 1 edges of the same direction i ∈ [n] that cover all neighbors of some vertex u except the neighbor in the direction i.
In Section 5 we study induced subgraphs of Q n obtained by removing some linear code.
Note that linear codes with odd minimum distance are balanced.In a particular case when F is the wellknown Hamming code [10], which exists for n = 2 r − 1 where r > 1 is integer, we obtain an optimal number of 2 n /(n+1) faulty vertices with minimum distance d(F ) ≥ 3. It could be noted that the induced subgraph of Q n obtained by removing the Hamming code is called the Hamming shell and it has been previously studied by Dejter [2].

Preliminaries
For a positive integer n, we denote by [n] the set {1, 2, . . ., n}.As usual, the vertex and edge sets of a graph G are denoted by V (G) and E(G), respectively.For sets V ⊆ V (G) and a set E ⊆ E(G), let G − V denote the subgraph of G induced by V (G) \ V , and let G − E denote the graph with vertices V (G) and edges E(G) \ E.
The n-dimensional hypercube Q n is a (bipartite) graph with all binary vectors of length n as vertices and with edges joining every two vertices that differ in exactly one coordinate, i.e.
The distance of two edges uv and xy is the minimum distance between a vertex of uv to a vertex of xy.A vertex v is said to be even (odd) if it has even (odd) weight.The weight of v is the number of 1's in v.Note that vertices of each parity form bipartite classes of Q n .Consequently, u and v have the same parity if and only if d(u, v) is even.

Now we introduce notations to describe subcubes of
We can represent every vertex x of Q n as a pair x = (u, v) D , where u ∈ {0, 1} d and v ∈ {0, 1} n−d are the vectors obtained by projection of x on the coordinates from D and [n] \ D, respectively.The index D in (u, v) D may be omitted whenever it is clear from the context.For v ∈ {0, 1} n−d we define the set In a particular case when are induced by vertices with 0 and 1 (respectively) in the i-th coordinate.The set of all edges between Q i L and The set of all edges between Q i L and Q i R of the same parity is called a half-layer of Q n .Hence every layer consists of two half-layers.
It is easy to show that every Hamiltonian cycle of Q n contains at least one edge from each half-layer.In Section 4 we will need the following result on Hamiltonian cycles in hypercubes with a faulty matching.
Proposition 1 (Dimitrov et al. [3]) Let M be a matching in Q n and n ≥ 4. Then Q n − M has a Hamiltonian cycle if and only if M does not contain a half-layer.

Long paths in induced subgraphs of large degree
In this section we study the hypercube Q n with a set F of faulty vertices such that every non-faulty vertex of Q n has at most one faulty neighbor in Q n .That is, we have an induced subgraph G of Q n with a minimum degree δ(G) ≥ n − 1.For our convenience, we allow δ(G) = n (i.e.F = ∅), but we assume that G is nonempty (i.e.F = V (Q n )).Notice that a faulty vertex may have many faulty neighbors.
It is easy to see that G is always connected.Indeed, the statement holds for n = 1, and for an arbitrary and hence also G are connected.
Furthermore, F contains at most 2 n−1 vertices with the extremal case when F forms a subcube of dimension n − 1.Since F can be unbalanced, instead of Hamiltonian cycles we find so called long cycles.
In a particular case when F contains only vertices of the same parity, such length is the best possible.Similarly, a path in Note that every long path between vertices u and v has length at least For long cycles and paths in G we will need the following lemma on interconnecting two parts of G.

Recall that the parity of an edge xy
L and G i R are nonempty, there are at least 2 edges between G i L and G i R of each parity.For n = 4 we assume that We consider all possibilities up to isomorphism for the graph G i L on Figure 1.Note that the crossed red vertices on Figure 1 represent the removed vertices of L is as on Figure 1(a)-(c), then it has at least two vertices of each parity with degree exactly 2 in G i L .Since δ(G) = 3, it follows that these vertices are connected with G i R so the statement holds.If R by at least 6 edges.Since at most 4 of these edges have the same parity, the statement holds also in this case.
For n ≥ 5 we split G into G j L and G j R for an arbitrary j ∈ [n] \ {i}.By the assumptions that both By symmetry, assume that the former case occurs.Then, applying induction for G j L we obtain at least 2 edges between G LL and G RL of each parity.Since G LL and G RL are subgraphs of G i L and G i R , the claim is established.✷ Now we show that induced subgraphs of Q n with large minimum degree have long paths between any two vertices.
Theorem 4 Let G be an induced subgraph of Q n (n ≥ 1) with δ(G) ≥ n − 1.Then G contains a long path between every two distinct vertices u and v.
Proof: We proceed by induction.For n ≤ 2, the statement trivially holds.For n = 3 we have either G = Q 3 or G is as on Figure 1(a)-(d).If G = Q 3 , then the statement holds since G contains a Hamiltonian path between every two vertices of opposite parity, and an almost (up to one vertex) Hamiltonian path between every two vertices of the same parity [8].If G is as on Figure 1(a), then it contains only half of the vertices of Q 3 , so it suffices that G is connected.If G is as on Figure 1(b)-(c), then every two vertices of G are connected by some path of length at least 3, which is even more than it is required for a long path.It remains to consider the case when G is as on Figure 1(d).First observe that there are 3 pairs of vertices u and v in G such that d(u, v) = 3.For all these pairs, G contains a path of length 5 between them.Furthermore, every two vertices u and v lie on a common 6-cycle of G. Thus G contains a path of length at least 4 between u and v also when d(u, v) ≤ 2. So we have a long path in all cases.
For n ≥ 4 we split G into G i L and G i R for some i ∈ [n] such that u and v are in different parts, say u ∈ V (G i L ) and v ∈ V (G i R ).By Lemma 1, there are at least 2 edges between G i L and G i R of each parity.Hence there is an edge xy ∈ E(G) such that x ∈ V (G i L ) is of opposite parity than u and y ∈ V (G i R ) is not v. Applying induction we obtain a path P L in G i L between u and x of length at least Observe that the length of P L is actually at least 2|V (G i L )| − 2 n−1 − 1 since u and x are at odd distance.Therefore, by concatenating these paths with the edge xy we obtain a long path between u and v in G. ✷ Now, the result on long cycles follows directly.
Proof of Theorem 1: Applying Theorem 4 for some two neighbors u and v in G, we obtain a path P of length at least 2|V (G)| − 2 n − 2 between u and v. Observe that the length of P is actually at least 2|V (G)| − 2 n − 1 since u and v are at odd distance.Closing P with the edge uv we obtain the desired long cycle in G. ✷ 4 Hamiltonicity of induced subgraphs of large degree given by faulty matchings In this section we show that every induced subgraph of Q n+2 obtained by removing the vertices of a given set M of edges (matching) of Q n+2 with d(M ) ≥ 3 has a Hamiltonian cycle as stated by Theorem 2.
Recall that d(M ) denotes the minimum distance between every two edges of M .The idea of the proof of Theorem 2 is as follows.We split Q n+2 into Q ′ 2 s and start with a 2-factor C of Q n+2 −V (M ) consisting of cycles inside these Q 2 's or inside two adjacent Q 2 's.By contracting the Q 2 's we obtain the hypercube Q n .Next, we find some special spanning tree T of this Q n that determines which cycles of C will be interconnected together.Finally, we assign some values to the edges of T to describe how to interconnect the cycles of C together so that we obtain a Hamiltonian cycle of Q n+2 − V (M ).
To formalize the proof, we need some additional definitions.Assume that M is a matching of Q n+2 where n ≥ 1 such that d(M ) ≥ 3. The hypercube Q n+2 can be viewed as a Cartesian product Q n+2 = Q 2 Q n .Thus for the set of coordinates D = {1, 2} ⊆ [n + 2], we consider Q n+2 as the (contracted) Q n in which every vertex u represents the subcube Q D (u).For the rest of this section, the set D is fixed, so let us replace the index D with 2, which is the size of D. Thus, for example Q 2 (u) denotes Q D (u).
Some edges of M are inside these Q 2 's, the other edges of M interconnect distinct Q 2 's.However, each Q 2 may contain (one or two) vertices of at most one edge of M because of the minimum distance 3 between the edges of M .Thus, we may assign the red, black or green color to each vertex u of Q n as follows: • if Q 2 (u) contains an edge of M , then u receives the red color; • if Q 2 (u) contains only one vertex of some edge of M , then u receives the black color; • if Q 2 (u) contains no vertex covered by M , then u receives the green color.
Moreover, if some neighbors u and v of Q n receive the black color because of the same edge of M , then we also assign the black color to the edge uv of Q n .Notice that the edge uv corresponds to a copy of Q 3 in Q n+2 .Let Q n (M ) denote the contracted Q n with assigned colors as described above.See Figures 2  and 4(a) for an illustration.On Figure 2 the dashed squares represent the copies of Q ′ 2 s in Q n+2 , the dotted edges represent edges between two adjacent Q 2 's, and the bold black edges represent the matching M .
For our convenience in dealing with small dimensions, let us make one additional assumption on Q n (M ) based on the following observation.3. Note that on Figure 3 the edges between the four copies of Q 3 in Q 5 are omitted except the edges between the red vertices.Observe that in all three cases, every vertex of Q 5 is at distance at most 2 from some vertex of {u, v, x, y}.Thus, there is no other edge in Q 5 at distance at least 3 from both uv and xy.✷ Hence for n ∈ {1, 2, 3}, by the symmetry of Q n+2 we may assume that the edges of M are in the

(i) T contains A;
(ii) T avoids B; (iii) every black vertex has degree 2 or 3 in T ; (iv) every red or green vertex has degree at most 2 in T .
Proof: Recall that for n ∈ {1, 2, 3} we may assume that Q n (M ) contains no black vertices, so the statement trivially holds; just take any Hamiltonian path of Q n (M ).Now assume that n ≥ 4. First observe that B forms a matching in Q n .Indeed, suppose that two edges of B are incident at some vertex u.Then u is black, and it has also one edge from A. But this means that u has at least 3 black neighbors, contrary to Lemma 2(ii).
Moreover, we claim that B does not contain a half-layer of Q n (M ).Suppose on the contrary that B contains a half-layer C. Then all 2 n−1 vertices of C are black, so they are covered by the matching A. Since A connects no two vertices of C and C contains exactly a half of the vertices of Q n (M ), it follows that actually all 2 n vertices of Q n (M ) are black.But this contradicts Lemma 2(ii) so the claim holds.Hence, by Proposition 1, there is a Hamiltonian cycle of Q n (M ) that avoids B. By removing some between non-black vertices on this cycle, we obtain a spanning path T ′ of Q n (M ) satisfying (ii)-(iv).
In addition to satisfy (i), we iteratively add the edges of A into T ′ and at the same time, we remove some edges to keep the tree structure.In particular, assume that we want to add the black edge uv into T ′ .Since the black vertices u and v have only one black edge by Lemma 2(iii), it follows that the degree of both u and v in T ′ is 2. Thus, this procedure may increase the degree of a black vertex only to 3. Let w be the neighbor of the vertex v on the cycle of T ′ ∪ {uv}.Note that w is neither red by Lemma 2(i), nor black since T ′ avoids B. Hence w is green.Then, by removing the edge vw from T ′ ∪ {uv} we obtain a new spanning tree T ′ of Q n (M ) containing the edge uv ∈ A and satisfying conditions (ii)-(iv).After we consider the whole set A, we have the required spanning tree.✷ Figure 4 shows an example of a spanning tree of Q n (M ) obtained by Lemma 3. Notice that A = {uv, xy} and B = {ux, vy} in this example.
In the hypercube Q n+2 , each subcube Q 2 (u) represented by a vertex u of Q n (M ) contains up to 4 edges that are not incident with the matching M .Let S(u) ⊆ E(Q 2 ) be the set of these edges projected to D; that is, for a, b ∈ {0, 1} 2 , ab ∈ S(u) if and only if the edge (a, u)(b, u) ∈ E(Q 2 (u)) is not incident with M .See Figure 5   (ii) if u is red and v is black, then S(u) ∩ S(v) = ∅; (iii) if u and v are black, then S(u) = S(v).
Proof: Note that in all three cases the common neighbor of u and v is green by Lemmas 2(i) and 3(ii).See Figure 6   Now we assign to the non-black edges uv of T values c(uv) from E(Q 2 ) that describe in the main proof how to interconnect cycles of some special 2-factor C of Q n+2 −V (M ) into a Hamiltonian cycle.A value c(uv) = ab where a, b ∈ {0, 1} 2 means that the cycles of C in Q 2 (u) and Q 2 (v) will be interconnected by replacing the edges (a, u)(b, u) and (a, v)(b, v) of C with the edges (a, u)(a, v) and (b, u)(b, v).Since the sets S(u) and S(v) contain the list of available edges for this operation, we need this assignment to satisfy the conditions described by the following lemma.
Lemma 5 Let M be a matching of Q n+2 (n ≥ 1) such that d(M ) ≥ 3, let A be the set of black edges of Q n (M ), and let T be the spanning tree of Q n (M ) obtained by Lemma 3.Then, there is an assignment Proof: From Lemma 3 it follows that by removing the edges of A, the spanning tree T splits into spanning paths.Recall that by Lemmas 2 and 3, every red or black vertex has only green neighbors on these paths.First we assign the single value of S(u) to the edges from each red vertex u.By Lemma 4(i), no conflict may arise in a green vertex that has two red neighbors.Clearly, two edges incident at some red vertex receive the same value of c. Hence the conditions in the statement hold so far.
Next, we traverse each path of T − A starting in an arbitrary end, and along the way we assign the value of c to all unassigned edges of this path so that the statement of the lemma is satisfied.Recall that there are no two consecutive black vertices on any path of T − A by Lemma 3(ii).Assume that we are in an unassigned edge uv.Hence the vertices u and v are not red.Let xu and vy be the previous and the next edge on the same path, respectively, if they exist.If y is red, then the edge vy has already some assigned value c(vy).We consider the colors of u and v.
If both u and v are green, then we choose c(uv) ∈ S(u) ∩ S(v) = E(Q 2 ) such that c(xu) = c(uv) = c(vy).Note that such value c(uv) exists, since there are four possibilities in S(u) ∩ S(v) and at most two of them are prohibited.If u is green and v is black, then |S(u) ∩ S(v)| = 2 and y is not red by Lemma 2(i).We choose c(uv) ∈ S(u) ∩ S(v) such that c(xu) = c(uv).Finally, if u is black and v is green, then |S(u) ∩ S(v)| = 2 and y can be red.Similarly as above, we choose c(uv) ∈ S(u) ∩ S(v) such that c(xu) = c(uv).By Lemma 4(ii), it follows that c(uv) = c(vy) if y is red.
Therefore, after we traverse all paths, the statement of the lemma holds.✷ Now we prove the main theorem of this section.
Proof of Theorem 2: Let Q n (M ) be the contracted hypercube with colors assigned as defined at the beginning of this section, and let A be the set of black edges in Q n (M ).Recall that A forms a matching in Q n (M ) by Lemma 2. First, we define the following 2-factor C of Q n+2 − V (M ).For every green vertex u, we take the 4-cycle of Q 2 (u) into C.For every red vertex u, we take twice into C the only edge in Q 2 (u) that is not incident with M .Because of technical reasons, let us consider this multi-edge to be a 2-cycle in Q n+2 .For every black edge uv we take into C the only possible 6-cycle in the subgraph of Q n+2 − V (M ) induced on vertices of Q 2 (u) and Q 2 (v) as illustrated by Figure 7(a).Hence, C is a 2-factor of Q n+2 − V (M ).Moreover, it is easy to see that for every u ∈ {0, 1} n and a, b ∈ {0, 1} 2 , (a, u)(b, u) ∈ E(C) if and only if ab ∈ S(u).
See Figure 7 for an illustration.Let T be the spanning tree of Q n (M ) obtained by Lemma 3. We use T to interconnect C into a Hamiltonian cycle.To interconnect cycles of C in the adjacent Q ′ 2 s we apply the assignment c : E(T ) \ A → E(Q 2 ) from Lemma 5. Assume that c(uv) = ab for an edge uv ∈ E(T ) \ A. By Lemma 5(i) and by (1), we have that (a, u)(b, u) ∈ E(C) and (a, v)(b, v) ∈ E(C).Hence, by replacing these two edges with the edges (a, u)(a, v) and (b, u)(b, v) we still obtain a 2-factor of Q n+2 − V (M ).
By Lemma 5(ii), no edge can be replaced more than once this way, except the multi-edges, which may be replaced twice.Since T is a spanning tree, after we proceed with all edges of E(T ) \ A, we obtain a Hamiltonian cycle of Q n+2 − V (M ).See Figure 8 for an illustration.✷

Conjecture 1
Let F be a balanced set of vertices of Q n with d(F ) ≥ 3. Then Q n − F contains a Hamiltonian cycle.

Conjecture 2
Let A and B be equal-sized sets of even and odd (respectively) vertices of Q n with d(A) ≥ 4 and d(B) ≥ 4. Then Q n − (A ∪ B) contains a Hamiltonian cycle.
for some examples.Note that |S(u)| = 1 if u is red, |S(u)| = 2 if u is black, and |S(u)| = 4 if u is green.The following lemma describes some properties of S with respect to our spanning tree T .Lemma 4 Let M be a matching of Q n+2 (n ≥ 1) such that d(M ) ≥ 3, and let T be the spanning tree of Q n (M ) obtained by Lemma 3.For every two vertices u and v of Q n (M ) with distance 2 in T , it holds that (i) if u and v are red with S(u) = {ab} and S(v) = {cd}, then {a, b, c, d} = {0, 1} 2 ;
for an illustration.First, assume that u and v are red.Let a, b, c, d ∈ {0, 1} 2 be such that S(u) = {ab} and S(v) = {cd}.That is, (a, u)(b, u) and (c, v)(d, v) are the edges of Q 2 (u) and Q 2 (v), respectively, that are not incident with M .Thus, the edges(c, u)(d, u) and (a, v)(b, v) are in M .Since d(u, v) = 2 and d(M ) ≥ 3, it follows that the vectors a, b, c, d of {0, 1} 2 are distinct, so (i) holds.Next, assume that u is red andv is black.Let a, b, c ∈ {0, 1} 2 be such that (a, u)(b, u) is the edge of M in Q 2 (u) and (c, v) is the vertex of Q 2 (v) covered by M .Again, since d(u, v) = 2 and d(M ) ≥ 3, itfollows that the vectors a, b, c of {0, 1} 2 are distinct.Let d ∈ {0, 1} 2 be the fourth vector of {0, 1} 2 , so S(u) = {cd}.As (c, v) is covered by M , we have cd / ∈ S(v).Hence also (ii) holds.Finally, assume that u and v are black.Let a, b ∈ {0, 1} 2 be such that (a, u) and (b, v) are covered by M .Similarly as above, we obtain that a = b, and therefore S(u) = S(v).