Discussiones Mathematicae 38 (2018) 217–231 doi:10.7151/dmgt.2010

MATCHINGS EXTEND TO HAMILTONIAN CYCLES IN 5- 1

Fan Wang 2

School of Sciences Nanchang University Nanchang, Jiangxi 330000, P.R. China e-mail: [email protected]

and

Weisheng Zhao

Institute for Interdisciplinary Research Jianghan University Wuhan, Hubei 430056, P.R. China e-mail: [email protected]

Abstract

Ruskey and Savage asked the following question: Does every matching in a hypercube Qn for n ≥ 2 extend to a Hamiltonian of Qn? Fink con- firmed that every perfect matching can be extended to a Hamiltonian cycle of Qn, thus solved Kreweras’ conjecture. Also, Fink pointed out that every matching can be extended to a Hamiltonian cycle of Qn for n ∈ {2, 3, 4}. In this paper, we prove that every matching in Q5 can be extended to a Hamiltonian cycle of Q5. Keywords: hypercube, Hamiltonian cycle, matching. 2010 Subject Classification: 05C38, 05C45.

1This work is supported by NSFC (grant nos. 11501282 and 11261019) and the science and technology project of Jiangxi Provincial Department of Education (grant No. 20161BAB201030). 2Corresponding author. 218 F. Wang and W. Zhao

1. Introduction

Let [n] denote the set {1,...,n}. The n-dimensional hypercube Qn is a graph whose set consists of all binary strings of length n, i.e., V (Qn) = {u : u = u1 un and ui ∈ {0, 1} for every i ∈ [n]}, with two vertices being adjacent whenever the corresponding strings differ in just one position. The hypercube Qn is one of the most popular and efficient interconnection networks. It is well known that Qn is Hamiltonian for every n ≥ 2. This state- ment dates back to 1872 [9]. Since then, the research on Hamiltonian cycles in hypercubes satisfying certain additional properties has received considerable attention [2, 3, 4, 6, 12]. A set of edges in a graph G is called a matching if no two edges have an endpoint in common. A matching is perfect if it covers all vertices of G. A cycle in a graph G is a Hamiltonian cycle if every vertex in G appears exactly once in the cycle. Ruskey and Savage [11] asked the following question: Does every matching in Qn for n ≥ 2 extend to a Hamiltonian cycle of Qn? Kreweras [10] conjectured that every perfect matching of Qn for n ≥ 2 can be extended to a Hamiltonian cycle of Qn. Fink [5, 7] confirmed the conjecture to be true. Let K(Qn) be the on the vertices of the hypercube Qn.

Theorem 1.1 [5, 7]. For every perfect matching M of K(Qn), there exists a perfect matching F of Qn, n ≥ 2, such that M ∪ F forms a Hamiltonian cycle of K(Qn). Also, Fink [5] pointed out that the following conclusion holds.

Lemma 1.2 [5]. Every matching in Qn can be extended to a Hamiltonian cycle of Qn for n ∈ {2, 3, 4}. Gregor [8] strengthened Fink’s result and obtained that given a partition of the hypercube into subcubes of nonzero dimensions, every perfect matching of the hypercube can be extended on these subcubes to a Hamiltonian cycle if and only if the perfect matching interconnects these subcubes. The present authors [14] proved that every matching of at most 3n−10 edges in Qn can be extended to a Hamiltonian cycle of Qn for n ≥ 4. In this paper, we consider Ruskey and Savage’s question and obtain the following result.

Theorem 1.3. Every matching in Q5 can be extended to a Hamiltonian cycle of Q5. It is worth mentioning that Ruskey and Savage’s question has been recently done for n = 5 independently by a computer search [15]. In spite of this, a direct proof is still necessary, as it may serve in a possible solution of the general question. Matchings Extend to Hamiltonian Cycles in 5-Cube 219

2. Preliminaries and Lemmas

Terminology and notation used in this paper but undefined below can be found in [1]. The vertex set and edge set of a graph G are denoted by V (G) and E(G), respectively. For a set F ⊆ E(G), let G − F denote the resulting graph after removing all edges in F from G. Let H and H′ be two subgraphs of G. We use H + H′ to denote the graph with the vertex set V (H) ∪ V (H′) and edge set E(H)∪E(H′). For F ⊆ E(G), we use H +F to denote the graph with the vertex set V (H) ∪ V (F ) and edge set E(H) ∪ F , where V (F ) denotes the set of vertices incident with F . The between two vertices u and v is the number of edges in a shortest joining u and v in G, denoted by dG(u,v), with the subscripts being omitted when the context is clear. Let j ∈ [n]. An edge in Qn is called an j-edge if its endpoints differ in the jth n position. The set of all j-edges in Qn is denoted by Ej. Thus, E(Qn)= Si=1 Ei. 0 1 Let Qn−1,j and Qn−1,j, with the superscripts j being omitted when the context is clear, be the (n − 1)-dimensional subcubes of Qn induced by the vertex sets j j {u ∈ V (Qn): u = 0} and {u ∈ V (Qn): u = 1}, respectively. Thus, Qn − Ej = 0 1 0 Qn−1 + Qn−1. We say that Qn splits into two (n − 1)-dimensional subcubes Qn−1 1 and Qn−1 at position j; see Figure 1 for example.

1000 1010 1011 1001 1100 1101 1110 1111

0110 0111 0100 0101

0000 0010 0011 0001 0 Q1 Q3 E4 3

0 1 Figure 1. Q4 splits into two 3-dimensional subcubes Q3 and Q3 at position 4.

n i The parity p(u) of a vertex u in Qn is defined by p(u) = Pi=1 u (mod 2). n−1 n−1 Then there are 2 vertices with parity 0 and 2 vertices with parity 1 in Qn. Vertices with parity 0 and 1 are called black vertices and white vertices, respec- tively. Observe that Qn is bipartite and vertices of each parity form bipartite sets of Qn. Thus, p(u) = p(v) if and only if d(u,v) is odd. A u,v-path is a path with endpoints u and v, denoted by Puv when we specify a particular such path. We say that a spanning subgraph of G whose components are k disjoint paths is a spanning k-path of G. A spanning 1-path thus is simply a spanning or Hamiltonian path. We say that a path P (respectively, a cycle C) passes through a set M of edges if M ⊆ E(P ) (respectively, M ⊆ E(C)). 220 F. Wang and W. Zhao

Lemma 2.1 [13]. Let u,v,x,y be pairwise distinct vertices in Q3 with p(u) = p(v) = p(x)= p(y) and d(u,x)= d(v,y) = 1. If M is a matching in Q3 − {u,v}, then there exists a spanning 2-path Pux + Pvy in Q3 passing through M.

Lemma 2.2 [13]. For n ∈ {3, 4}, let u,v ∈ V (Qn) be such that p(u) = p(v). If M be a matching in Qn − u, then there exists a Hamiltonian path in Qn joining u and v passing through M.

3. Proof of Theorem 1.3

Let M be a matching in Q5. If M is a perfect matching, then the theorem holds by Theorem 1.1. So in the following, we only need to consider the case that M 5 is not perfect. Since Q5 has 2 vertices, we have |M|≤ 15. Choose a position j ∈ [5] such that |M ∩ Ej| is as small as possible. Then 0 |M ∩ Ej|≤ 3. Without loss of generality, we may assume j = 5. Split Q5 into Q4 1 0 1 and Q4 at position 5. Then Q5 − E5 = Q4 + Q4. Let α ∈ {0, 1}. Observe that α 1−α every vertex uα ∈ V (Q4 ) has in Q4 a unique neighbor, denoted by u1−α. Let α Mα = M ∩ E(Q4 ). We distinguish four cases to consider.

Case 1. M ∩ E5 = ∅. We say that a vertex u is covered by M if u ∈ V (M). Otherwise, we say that u is uncovered by M. Since M is not perfect in Q5, there exists a vertex uncovered by M. By symmetry we may assume that the uncovered 0 0 vertex lies in Q4, and denote it by u0. In other words, u0 ∈ V (Q4) \ V (M). First 1 apply Lemma 1.2 to find a hamiltonian cycle C1 in Q4 passing through M1. Let v1 be a neighbor of u1 on C1 such that u1v1 ∈/ M. Since M is a matching, this is 0 always possible. Since p(u0) = p(v0) and M0 is a matching in Q4 −u0, by Lemma 0 2.2 there exists a Hamiltonian path Pu0v0 in Q4 passing through M0. Hence Pu0v0 + C1 + {u0u1,v0v1}− u1v1 is a Hamiltonian cycle in Q5 passing through M, see Figure 2.

u0 u1 v v P 0 1 u0 v 0 C1

position 5 0 1 Q4 Q4

Figure 2. Illustration for Case 1.

α Case 2. |M ∩E5| = 1. Let M ∩E5 = {u0u1}, where uα ∈ V (Q4 ). Let vα be a Matchings Extend to Hamiltonian Cycles in 5-Cube 221

α neighbor of uα in Q4 for α ∈ {0, 1}. Then p(u0) = p(v0) and p(u1) = p(v1). Since u0u1 ∈ M ∩ E5, we have uα ∈/ V (Mα) for every α ∈ {0, 1}. In other words, Mα α is a matching in Q4 − uα. By Lemma 2.2 there exist Hamiltonian paths Puαvα in α Q4 passing through Mα for every α ∈ {0, 1}. Hence Pu0v0 + Pu1v1 + {u0u1,v0v1} is a Hamiltonian cycle in Q5 passing through M. α Case 3. |M ∩ E5| = 2. Let M ∩ E5 = {u0u1,v0v1}, where uα,vα ∈ V (Q4 ). If p(u0) = p(v0), then p(u1) = p(v1), the proof is similar to Case 2. So in the α following we may assume p(u0) = p(v0). Now p(u1) = p(v1). In Q4 , since there are already matched two vertices with the same color, we have |Mα|≤ 6 for every α ∈ {0, 1}. Thus, Pi∈[4] |M ∩ Ei| = |M0| + |M1|≤ 12 and |M|≤ 14. Choose a position k ∈ [4] such that |M ∩ Ek| is as small as possible. Then |M ∩ Ek|≤ 3. Without loss of generality, we may assume k = 4. Let α ∈ {0, 1}. α α0 α1 α0 α1 Split Q4 into Q3 and Q3 at position 4. For clarity, we write Q3 and Q3 as αL αR α αL αR Q3 and Q3 , respectively, see Figure 3. Then Q4 − E4 = Q3 + Q3 . Let αδ αL Mαδ = Mα ∩ E(Q3 ) for every δ ∈ {L, R}. Note that every vertex sαL ∈ V (Q3 ) αR αR has in Q3 a unique neighbor, denoted by sαR, and every vertex tαR ∈ V (Q3 ) αL has in Q3 a unique neighbor, denoted by tαL. By symmetry, we may assume |M0 ∩ E4|≤|M1 ∩ E4|. Since |M ∩ E4| = 0 |M0 ∩E4|+|M1 ∩E4|≤ 3, we have |M0 ∩E4|≤ 1. Since u0 ∈ V (Q4), without loss 0L 1L of generality we may assume u0 ∈ V (Q3 ). Now u1 ∈ V (Q3 ). We distinguish two cases to consider.

0L 1L Q3 Q3

position 4

0R 1R Q3 Q3

Q0 Q1 4 position 5 4

0L 0R 1L 1R Figure 3. Q5 splits into four 3-dimensional subcubes Q3 , Q3 , Q3 and Q3 .

0R 1R Subcase 3.1. v0 ∈ V (Q3 ). Now v1 ∈ V (Q3 ).

Subcase 3.1.1. M0 ∩E4 = ∅. Apply Lemma 1.2 to find a Hamiltonian cycle C1 1 1R in Q4 passing through M1. Since u1 has only one neighbor in Q3 , we may choose 222 F. Wang and W. Zhao

1L a neighbor x1 of u1 on C1 such that x1 ∈ V (Q3 ). Similarly, we may choose a 1R neighbor y1 of v1 on C1 such that y1 ∈ V (Q3 ). Since {u0u1,v0v1} ⊆ M, we have {u1x1,v1y1} ∩ M = ∅. Since p(u0) = p(x0) and M0L is a matching in 0L 0L Q3 − u0, by Lemma 2.2 there exists a Hamiltonian path Pu0x0 in Q3 passing 0R through M0L. Similarly, there exists a Hamiltonian path Pv0y0 in Q3 passing through M0R. Hence Pu0x0 + Pv0y0 + C1 + {u0u1,x0x1,v0v1,y0y1} − {u1x1,v1y1} is a Hamiltonian cycle in Q5 passing through M, see Figure 4.

u 0L 0 Q u1 1L 3 Q3 x1 x0 position 4 v 0 1R 0R v1 Q Q3 3

y0 y1

0 position 5 1 Q4 Q4

Figure 4. Illustration for Subcase 3.1.1.

Subcase 3.1.2. |M0 ∩ E4| = 1. Now 1 ≤ |M1 ∩ E4| ≤ 2. Let M0 ∩ E4 = 0δ {s0Ls0R}, where s0δ ∈ V (Q3 ). Since p(u0)= p(v0) and p(s0L) = p(s0R), without loss of generality, we may assume p(u0)= p(v0)= p(s0L) = p(s0R). 1 First, we claim that there exists a Hamiltonian cycle C1 in Q4 passing through 1R M1 such that the two neighbors of v1 on C1 both belong to V (Q3 ). If |M1 ∩ E4| = 2, then |M ∩ E4| = 3. So |M ∩ Ei| = 3 for every i ∈ [4]. Since |Mα|≤ 6 for every α ∈ {0, 1} and |M0|+|M1| = Pi∈[4] |M ∩Ei|, we have |Mα| = 6 1δ for every α ∈ {0, 1}. Let M1 ∩ E4 = {a1La1R, b1Lb1R}, where a1δ, b1δ ∈ V (Q3 ). Then p(a1δ) = p(b1δ) for every δ ∈ {L, R}. (Otherwise, if p(a1δ) = p(b1δ), then |M1δ|≤ 2. Moreover, either p(u1)= p(a1L)= p(b1L) or p(v1)= p(a1R)= p(b1R), so |M1L|≤ 1 or |M1R|≤ 1. Thus, |M1|≤ 2+1+2 = 5, a contradiction). 1δ If |M1 ∩ E4| = 1, let M1 ∩ E4 = {a1La1R}, where a1δ ∈ V (Q3 ). Since a1R 1R 1R has three neighbors in Q3 , we may choose a neighbor b1R of a1R in Q3 such that b1R = v1. Now p(a1δ) = p(b1δ) for every δ ∈ {L, R}. 1δ For the above two cases, since M1δ is a matching in Q3 − a1δ, by Lemma 1δ 2.2 there exist Hamiltonian paths Pa1δb1δ in Q3 passing through M1δ for every δ ∈ {L, R}. Let C1 = Pa1Lb1L + Pa1Rb1R + {a1La1R, b1Lb1R}. In the former case, since {v0v1,a1La1R, b1Lb1R} ⊆ M, we have v1 ∈/ {a1R, b1R}. In the latter case, since {v0v1,a1La1R} ⊆ M, we have v1 = a1R, and therefore, v1 ∈/ {a1R, b1R}. 1 Hence C1 is a Hamiltonian cycle in Q4 passing through M1 such that the two 1R neighbors of v1 on C1 both belong to V (Q3 ), see Figure 5(1). Matchings Extend to Hamiltonian Cycles in 5-Cube 223

1L Next, choose a neighbor x1 of u1 on C1 such that x1 ∈ V (Q3 ) and choose a 0R neighbor y1 of v1 on C1 such that y0 = s0R. Since M0R is a matching in Q3 −v0, 0R by Lemma 2.2 there exists a Hamiltonian path Pv0y0 in Q3 passing through M0R, see Figure 5(2). Since s0R ∈/ {v0,y0}, we may choose a neighbor t0R of s0R on Pv0y0 such that t0L = x0. Now u0,x0,s0L,t0L are pairwise distinct vertices 0L in Q3 , and p(u0) = p(s0L) = p(x0) = p(t0L), and d(u0,x0) = d(s0L,t0L) = 0L 1. Since M0L is a matching in Q3 − {u0,s0L}, by Lemma 2.1 there exists 0L a spanning 2-path Pu0x0 + Ps0Lt0L in Q3 passing through M0L. Hence Pu0x0 + Ps0Lt0L +Pv0y0 +C1 +{u0u1,x0x1,v0v1,y0y1,s0Ls0R,t0Lt0R}−{u1x1,v1y1,s0Rt0R} is a Hamiltonian cycle in Q5 passing through M, see Figure 5(2).

Q1L 0L Q1L 3 Q3 3 u u 0L u0 1 u0 1 Q3 x x s s 0 1 0L 0L t0L position 4 position 4 t0R s0R v C s0R v C 1 1 v0 1 1

0R v0 Q3 y0 y1 position 5 position 5 Q1R Q0R Q1R (1) 3 3 (2) 3

Figure 5. Illustration for Subcase 3.1.2.

0L 1L Subcase 3.2. v0 ∈ V (Q3 ). Now v1 ∈ V (Q3 ). Let x1 be the unique vertex 1L in Q3 satisfying d(x1,v1) = 3. Then d(x1,u1) = 1. Since M1 is a matching 1 1 in Q4 − u1, by Lemma 2.2 there exists a Hamiltonian path Pu1x1 in Q4 passing 1R through M1. Since v1 has only one neighbor in Q3 , we may choose a neighbor y1 1L of v1 on Pu1x1 such that y1 ∈ V (Q3 ). Since d(x1,v1) = 3, we have y1 = x1. Then u1,x1,v1,y1 are pairwise distinct vertices, and p(u1)= p(v1) = p(x1)= p(y1), and d(u1,x1)= d(v1,y1) = 1, and the same properties also hold for the corresponding ′ ′ 0 vertices u0,x0,v0,y0. If we can find a spanning 2-path Pu0x0 +Pv0y0 in Q4 passing ′ ′ through M0, then Pu0x0 + Pv0y0 + Pu1x1 + {u0u1,x0x1,v0v1,y0y1} − v1y1 is a Hamiltonian cycle in Q5 passing through M. So in the following, we only need ′ ′ to show that the desired spanning 2-path Pu0x0 + Pv0y0 exists. We distinguish several cases to consider.

0L Subcase 3.2.1. |M0 ∩ E4| = 1. Since M0L is a matching in Q3 − {u0,v0}, by 0L Lemma 2.1 there exists a spanning 2-path Pu0x0 + Pv0y0 in Q3 passing through 0δ M0L. Let M0 ∩ E4 = {s0Ls0R}, where s0δ ∈ V (Q3 ). Without loss of generality assume s0L ∈ V (Pv0y0 ). Choose a neighbor t0L of s0L on Pv0y0 . Since s0Ls0R ∈ M, 0R we have s0Lt0L ∈/ M. Since M0R is a matching in Q3 − s0R, by Lemma 2.2 there 224 F. Wang and W. Zhao

0R ′ exists a Hamiltonian path Ps0Rt0R in Q3 passing through M0R. Let Pu0x0 = ′ ′ ′ Pu0x0 and Pv0y0 = Pv0y0 +Ps0Rt0R +{s0Ls0R,t0Lt0R}−s0Lt0L. Then Pu0x0 +Pv0y0 0 is the desired spanning 2-path in Q4, see Figure 6.

u0 u1 x 0L x0 1 Q 1L 3 v0 Q v1 3 s y1 0L y0 t0L position 4

s0R t 1R 0R 0R Q3 Q3 position 5 0 Q1 Q4 4

Figure 6. Illustration for Subcase 3.2.1.

Subcase 3.2.2. M0 ∩ E4 = ∅. It suffices to consider the case that M0L is 0L 0R 0L maximal in Q3 − {u0,v0} and M0R is maximal in Q3 . In Q3 , since p(u0) = p(v0), we have u0,v0 are different in two positions, so there is one possibility of {u0,v0} up to isomorphism. Since d(x0,v0) = 3, the vertex x0 is fixed by v0. Since d(y0,v0) = 1, there are two choices of y0 up to isomorphism. Thus, there are two possibilities of {u0,v0,x0,y0} up to isomorphism, see Figure 7(a)(b). When 0L {u0,v0,x0,y0} is the case (a), since M0L is a maximal matching in Q3 −{u0,v0}, there are three possibilities of M0L up to isomorphism, see Figure 7(1)–(3). When {u0,v0,x0,y0} is the case (b), there are seven possibilities of M0L, see Figure 0R 7(4)–(10). In Q3 , there are three non-isomorphic maximal matchings, denoted by P1, P2 and P3, see Figure 8.

u0 u0

x0 x0

y0

v v y0 0 ()a 0 ()b

u0 u0 u0 u0 u0

x0 x0 x0 x0 x0

y0 y0 y0 y v0 v v v 0 v y0 (1) 0 (2) 0 (3) 0 (4) 0 (5)

u0 u0 u0 u0 u0

x0 x0 x0 x0 x0

v y0 v y0 v y0 v y0 v y0 0 (6) 0 (7) 0 (8) 0 (9) 0 (10)

Figure 7. All possibilities of {u0,v0,x0,y0,M0L} up to isomorphism. Matchings Extend to Hamiltonian Cycles in 5-Cube 225

Before the proof, we point out that if M0R is isomorphic to the matching P1 0R or P2, then there exists a Hamiltonian cycle in Q3 passing through M0R ∪ {e} for any e∈ / M0R, see Figure 9.

()P1 ()P2 ()P3

0R Figure 8. Three non-isomorphic maximal matchings in Q3 .

(P - 1) (P1 - 2) (P - 2) 1 (P1 - 3) (P2 - 1) 2

0R Figure 9. Hamiltonian cycles passing through M0R ∪ {e} for any e∈ / M0R in Q3 when M0R is isomorphic to P1 or P2.

First, suppose that M0R is isomorphic to P1. Since M0L is a matching in 0L Q3 − {u0,v0}, by Lemma 2.1 there exists a spanning 2-path Pu0x0 + Pv0y0 in 0L Q3 passing through M0L. Since |E(Pu0x0 + Pv0y0 )| = 6 > |M0L| + |M0R|, there exists an edge s0Lt0L ∈ E(Pu0x0 + Pv0y0 ) \ M0L such that s0Rt0R ∈/ M0R. Choose 0R a Hamiltonian cycle C0R in Q3 passing through M0R ∪ {s0Rt0R}. Hence Pu0x0 + Pv0y0 + C0R + {s0Ls0R,t0Lt0R} − {s0Lt0L,s0Rt0R} is the desired spanning 2-path 0 in Q4. (Note that the construction is similar to Subcase 3.2.1, so the readers may refer to the construction in Figure 6.) Next, suppose that M0R is isomorphic to P2. We say that a set S of edges crosses a position i if S∩Ei = ∅. If {u0,v0,x0,y0,M0L} is isomorphic to one of the cases (2)–(10) in Figure 7, then we may choose a spanning 2-path Pu0x0 + Pv0y0 0L in Q3 such that the set E(Pu0x0 + Pv0y0 ) \ M0L crosses at least two positions, see Figure 10(2)–(10). Since all the edges in M0R lie in the same position, there exists an edge s0Lt0L ∈ E(Pu0x0 + Pv0y0 ) \ M0L such that s0Rt0R ∈/ M0R. If {u0,v0,x0,y0,M0L} is isomorphic to the case (1) in Figure 7, then we may 0L choose two different spanning 2-paths Pu0x0 + Pv0y0 in Q3 such that the two sets E(Pu0x0 + Pv0y0 ) \ M0L cross two different positions, see Figure 10(1–1), (1– 2), and therefore, at least one of them is different from the position in which M0R lies. Thus, we may choose a suitable spanning 2-path Pu0x0 + Pv0y0 such that there exists an edge s0Lt0L ∈ E(Pu0x0 + Pv0y0 ) \ M0L and s0Rt0R ∈/ M0R. The remaining construction is similar to the above case. Last, suppose that M0R is isomorphic to P3. Without loss of generality, we may assume M0R ⊆ (E2 ∪ E3). 226 F. Wang and W. Zhao

If {u0,v0,x0,y0,M0L} is isomorphic to the case (5) or (8) in Figure 7, we may 0L choose a spanning 2-path Pu0x0 + Pv0y0 in Q3 passing through M0L such that (E(Pu0x0 +Pv0y0 )\M0L)∩E1 = ∅, see Figure 11. Let s0Lt0L ∈ (E(Pu0x0 +Pv0y0 )\ M0L) ∩ E1. Then s0Rt0R ∈ E1. One can verify that there exists a Hamiltonian 0R cycle C0R in Q3 passing through M0R ∪ {s0Rt0R}. Hence Pu0x0 + Pv0y0 + C0R + 0 {s0Ls0R,t0Lt0R} − {s0Lt0L,s0Rt0R} is the desired spanning 2-path in Q4.

u0 u0 u0 u0 u0 u0

x0 x0 x0 x0 x0 x0 y 0 y0 y0 y0

v v v v v y0 v y0 0 (1 1)- 0 (1 2)- 0 (2) 0 (3) 0 (4) 0 (5)

u0 u0 u0 u0 u0

x0 x0 x0 x0 x0

y y y y v y0 v 0 v 0 v0 0 v 0 0 (6) 0 (7) 0 (8) (9) 0 (10)

0L Figure 10. Spanning 2-paths Pu0x0 + Pv0y0 in Q3 with the possible edges s0Lt0L lined by \\.

u0 u0 u0

x0 x0 x0

y v y0 v y0 v 0 0 (5 1)- 0 (5 2)- 0 (8)

Figure 11. The possible spanning 2-paths Pu0x0 + Pv0y0 such that

(E(Pu0x0 + Pv0y0 ) \ M0L) ∩ E1 = ∅.

If {u0,v0,x0,y0,M0L} is isomorphic to one of the cases (3), (6), (7) or (10) 0L in Figure 7, then choose a spanning 2-path Pu0x0 + Pv0y0 in Q3 passing through M0L, see Figure 12(3), (6), (7), (10). If (E(Pu0x0 + Pv0y0 ) \ M0L) ∩ E1 = ∅, then the proof is similar to the above case. If (E(Pu0x0 + Pv0y0 ) \ M0L) ∩ E1 = ∅, then the set E(Pu0x0 + Pv0y0 ) \ M0L crosses the positions 2 and 3, and therefore, M0R has two choices for every case, see Figure 12. Then we can find a spanning 2-path ′ ′ 0 Pu0x0 + Pv0y0 in Q4 passing through M0, see Figure 12. If {u0,v0,x0,y0,M0L} is isomorphic to one of the cases (1), (2), (4) or (9) 0L in Figure 7, we observe that there exist two vertices in V (Q3 ) at distance 3, 0L denoted by s0L,t0L, such that there is a spanning 2-path Pu0x0 + Pv0y0 in Q3 + s0Lt0L passing through M0L ∪ {s0Lt0L}, see Figure 13. Next, we can verify that 0R there exists a Hamiltonian path Ps0Rt0R in Q3 passing through M0R. Hence Pu0x0 + Pv0y0 + Ps0Rt0R + {s0Ls0R,t0Lt0R}− s0Lt0L is the desired spanning 2-path 0 in Q4. Matchings Extend to Hamiltonian Cycles in 5-Cube 227

Case 4. |M ∩ E5| = 3. Let M ∩ E5 = {u0u1,v0v1,w0w1}, where uα,vα,wα ∈ α V (Q4 ). Now |M ∩ Ei| = 3 for every i ∈ [5] and |M| = 15. Hence there are two vertices of {uα,vα,wα} in one partite set and one vertex in the other partite set. Otherwise, if p(uα)= p(vα)= p(wα), then |Mα|≤ 5, and therefore, |M|≤ 13, a contradiction. Without loss of generality, we may assume p(uα)= p(vα) = p(wα).

u0 u0 u0 u0 u0 u0

x0 x0 x0 x0 x0 x0

y0 y0 y0

y v y0 v0 y0 v v v v0 0 0 0 (3) 0 0 (6)

(3 1)- (3 2)- (6 1)- (6 2)-

u0 u0 u0 u0 u0 u0

x0 x0 x0 x0 x0 x0

y0 v y0 v y v y v 0 v0 y0 v0 y0 0 (7) 0 0 0 0 (10)

(7 1)- (7 2)- (10 1)- (10 2)-

′ ′ 0 Figure 12. Spanning 2-paths Pu0x0 + Pv0y0 in Q4 passing through M0.

s0L s0L u0 u0 u0 u0 s x x 0L 0 s0L x0 x0 0

y0 y0 t0L t0L v v y y0 0 t v0 t 0 0 v0 (1) 0L (2) 0L (4) (9)

0L Figure 13. Spanning 2-paths Pu0x0 + Pv0y0 in Q3 + s0Lt0L passing through M0L ∪ {s0Lt0L}.

α αL αR Split Q4 into two 3- Q3 and Q3 at some position k such that uα ∈ αL αR V (Q3 ) and vα ∈ V (Q3 ). Without loss of generality, we may assume k = 4. αL Since p(uα)= p(vα) = p(wα), by symmetry we may assume wα ∈ V (Q3 ). Since |M0 ∩E4|+|M1 ∩E4| = |M ∩E4| = 3, by symmetry we may assume |M0 ∩E4|≤ 1. αδ Let Mαδ = Mα ∩ E(Q3 ) for every δ ∈ {L, R}.

Subcase 4.1. M0 ∩ E4 = ∅. Since p(u1) = p(w1) and M1 is a matching in 1 1 Q4 − u1, by Lemma 2.2 there exists a Hamiltonian path Pu1w1 in Q4 passing 228 F. Wang and W. Zhao

1L through M1. Since v1 has only one neighbor in Q3 , we may choose a neighbor 1R 0R y1 of v1 on Pu1w1 such that y1 ∈ V (Q3 ). Now y0 ∈ V (Q3 ) and p(u0)= p(v0) = 0L p(w0) = p(y0). Since M0L is a matching in Q3 − u0 and M0R is a matching in 0R 0L Q3 −v0, by Lemma 2.2 there exist Hamiltonian paths Pu0w0 in Q3 and Pv0y0 in 0R Q3 passing through M0L and M0R, respectively. Hence Pu1w1 + Pu0w0 + Pv0y0 + {u0u1,w0w1,v0v1,y0y1}− v1y1 is a Hamiltonian cycle in Q5 passing through M, see Figure 14.

u0 u Q0L 1 1L 3 Q3 w1 w0 position 4 v 0 v 1R 0R 1 Q Q3 3

y0 y1 position 5

Figure 14. Illustration for Subcase 4.1.

Subcase 4.2. |M0 ∩ E4| = 1. Now |M1 ∩ E4| = 2. Let M0 ∩ E4 = {s0Ls0R} 0δ 1δ and M1 ∩ E4 = {a1La1R, b1Lb1R}, where s0δ ∈ V (Q3 ) and a1δ, b1δ ∈ V (Q3 ). 0L Since |M| = 15, Q5 has exactly two vertices uncovered by M, one in Q3 and the 1R other in Q3 . Thus, p(a1L) = p(b1L), and p(v0) = p(s0R), and M1L is a perfect 1L matching in Q3 − {u1,w1,a1L, b1L}. Since p(u1) = p(w1) and p(a1L) = p(b1L), without loss of generality, we may assume p(u1) = p(b1L) = p(w1) = p(a1L). Thus, p(v1)= p(a1R) = p(b1R).

u 0L u0 1 1L Q3 Q3

s0L a w0 w b1L 1L t0L 1 position 4 t0R b1R s0R a v0 v1 1R

y y 1 1R 0R 0 Q Q3 3 position 5

Figure 15. Illustration for Subcase 4.2.

0L Since p(u0) = p(w0) and M0L is a matching in Q3 − u0, by Lemma 2.2 0L there exists a Hamiltonian path Pu0w0 in Q3 passing through M0L, see Figure 15. Since s0L ∈/ {u0,w0}, we may choose a neighbor t0L of s0L on Pu0w0 such 0R that t0R = v0. Since p(s0R) = p(t0R) and M0R is a matching in Q3 − s0R, Matchings Extend to Hamiltonian Cycles in 5-Cube 229

0R by Lemma 2.2 there exists a Hamiltonian path Ps0Rt0R in Q3 passing through M0R, see Figure 15. Since v0 ∈/ {s0R,t0R}, we may choose a neighbor y0 of v0 on Ps0Rt0R such that y1 = b1R. Now v1,y1,a1R, b1R are pairwise distinct vertices, and p(v1) = p(a1R) = p(y1) = p(b1R), and d(v1,y1) = 1, and M1R is a matching 1R in Q3 − {v1,a1R}.

u1 R M1L R a ()w w 1L 1 1 R ()a1L M1L R b1L 1L Q3

1L Figure 16. The spanning 2-path Pu1a1L + Pw1b1L (or Pu1w1 + Pa1Lb1L ) in Q3 .

If d(a1R, b1R) = 1, then by Lemma 2.1 there is a spanning 2-path Pv1y1 + 1R Pa1Rb1R in Q3 passing through M1R, see Figure 17(1). Since M1L is a perfect 1L matching in Q3 − {u1,w1,a1L, b1L}, we have M1L ∪ {u1w1,a1Lb1L} is a perfect 1L 1L matching in K(Q3 ). By Theorem 1.1, there exists a perfect matching R in Q3 1L such that M1L ∪{u1w1,a1Lb1L}∪R forms a Hamiltonian cycle in K(Q3 ). Hence 1L M1L ∪ R forms a spanning 2-path in Q3 . Note that each path of the spanning 2- path is an (R,M1L)-alternating path beginning with an edge in R and ending with an edge in R. So the number of vertices in each path is even. Since Q5 is a bipar- tite graph, the two endpoints of each path have different parities. Hence one path joins the vertices u1 and a1L, and the other path joins the vertices w1 and b1L, see Figure 16 for example. Denote the spanning 2-path by Pu1a1L + Pw1b1L . Note that s0Lt0L ∈/ M and v0y0 ∈/ M. Hence Pu0w0 +Ps0Rt0R +Pu1a1L +Pw1b1L +Pv1y1 +

Pa1Rb1R + {u0u1,w0w1,v0v1,y0y1,a1La1R, b1Lb1R,s0Ls0R,t0Lt0R}−{v0y0,s0Lt0L} is a Hamiltonian cycle in Q5 passing through M, see Figure 17(1).

1L 1L 0L Q 0L Q Q u u1 3 u u1 3 3 0 Q3 0

s 0L w a s0L a 0 w1 b1L 1L w0 w b1L 1L t0L t0L 1 position 4 t 0R b1R a t0R b1R s0R v 1R s0R a v0 1 v0 v1 1R

y0 y1 y0 y1 Q0R Q1R Q0R Q1R 3 position 5 3 3 position 5 3 (1) (2)

Figure 17. Illustration for Subcase 4.2. 230 F. Wang and W. Zhao

If d(a1R, b1R) = 3, then d(v1, b1R)= d(a1R,y1) = 1. Since M1R is a matching 1R in Q3 − {v1,a1R}, by Lemma 2.1 there is a spanning 2-path Pv1b1R + Pa1Ry1 1R in Q3 passing through M1R, see Figure 17(2). Since M1L ∪ {u1a1L,w1b1L} is a 1L perfect matching in K(Q3 ), similar to the above case, there is a spanning 2-path 1L Pu1w1 + Pa1Lb1L in Q3 passing through M1L. Hence Pu0w0 + Ps0Rt0R + Pv1b1R + Py1a1R +Pu1w1 +Pa1Lb1L +{u0u1,w0w1,v0v1,y0y1,a1La1R, b1Lb1R,s0Ls0R,t0Lt0R}− {v0y0,s0Lt0L} is a Hamiltonian cycle in Q5 passing through M, see Figure 17(2). The proof of Theorem 1.3 is complete. Acknowledgements The authors would like to express their gratitude to the anonymous referees for their kind suggestions on the original manuscript.

References

[1] J.A. Bondy and U.S.R. Murty, Graph Theory with Applications (North-Holland, NewYork-Amsterdam-Oxford, 1982). [2] R. Caha and V. Koubek, Spanning multi-paths in hypercubes, Discrete Math. 307 (2007) 2053–2066. doi:10.1016/j.disc.2005.12.050 [3] D. Dimitrov, T. Dvoˇr´ak, P. Gregor and R. Skrekovski,ˇ Gray codes avoiding match- ings, Discrete Math. Theoret. Comput. Sci. 11 (2009) 123–148. [4] T. Dvoˇr´ak, Hamiltonian cycles with prescribed edges in hypercubes, SIAM J. Discrete Math. 19 (2005) 135–144. doi:10.1137/S0895480103432805 [5] J. Fink, Perfect matchings extend to Hamilton cycles in hypercubes, J. Combin. Theory Ser. B 97 (2007) 1074–1076. doi:10.1016/j.jctb.2007.02.007 [6] J. Fink, Connectivity of matching graph of hypercube, SIAM J. Discrete Math. 23 (2009) 1100–1109. doi:10.1137/070697288 [7] J. Fink, Matching graphs of hypercubes and complete bipartite graphs, European J. Combin. 30 (2009) 1624–1629. doi:10.1016/j.ejc.2009.03.007 [8] P. Gregor, Perfect matchings extending on subcubes to Hamiltonian cycles of hyper- cubes, Discrete Math. 309 (2009) 1711–1713. doi:10.1016/j.disc.2008.02.013 [9] L. Gros, Th´eorie du Baguenodier (Aim´eVingtrinier, Lyon, 1872). [10] G. Kreweras, Matchings and Hamiltonian cycles on hypercubes, Bull. Inst. Combin. Appl. 16 (1996) 87–91. Matchings Extend to Hamiltonian Cycles in 5-Cube 231

[11] F. Ruskey and C. Savage, Hamilton cycles that extend transposition matchings in Cayley graphs of Sn, SIAM J. Discrete Math. 6 (1993) 152–166. doi:10.1137/0406012 [12] J. Vandenbussche and D. West, Matching extendability in hypercubes, SIAM J. Dis- crete Math. 23 (2009) 1539–1547. doi:10.1137/080732687 [13] F. Wang and H.P. Zhang, Two types of matchings extend to Hamiltonian cycles in hypercubes, Ars Combin. 118 (2015) 269–283. [14] F. Wang and H.P. Zhang, Small matchings extend to Hamiltonian cycles in hyper- cubes, Graphs Combin. 32 (2016) 363–376. doi:10.1007/s00373-015-1533-6 [15] E. Zulkoski, V. Ganesh and K. Czarnecki, MathCheck: A Math Assistant via a Combination of Computer Algebra Systems and SAT Solvers, in: A.P. Felty and A. Middeldorp, Proc. CADE-25 (Ed(s)), (LNCS 9195, 2015) 607–622. doi:10.1007/978-3-319-21401-6 41

Received 27 September 2016 Revised 4 November 2016 Accepted 4 November 2016