Charles University in Prague Faculty of and Physics

MASTER THESIS

David Pěgřímek

Hamiltonicity of hypercubes without k-snakes and k-coils

Department of Theoretical Computer Science and Mathematical Logic

Supervisor of the master thesis: Mgr. Petr Gregor, Ph.D. Study programme: Computer Science Study branch: Theoretical Computer Science

Prague 2016 I declare that I carried out this master thesis independently, and only with the cited sources, literature and other professional sources. I understand that my work relates to the rights and obligations under the Act No. 121/2000 Coll., the Copyright Act, as amended, in particular the fact that the Charles University in Prague has the right to conclude a license agreement on the use of this work as a school work pursuant to Section 60 paragraph 1 of the Copyright Act.

In ...... date ...... signature of the author Title: Hamiltonicity of hypercubes without k-snakes and k-coils

Author: David Pěgřímek

Department: Dept. of Theoretical Computer Science and Mathematical Logic

Supervisor: Mgr. Petr Gregor, Ph.D., KTIML

Abstract: A snake (coil) is an induced () in a hypercube. They are well known from the snake-in-the-box (coil-in-the-box) problem which asks for the longest snake (coil) in a hypercube. They have been generalized to k-snakes (k-coils) which preserve distances between their every two vertices at at most k − 1 in hypercube. We study them as a variant of Locke’s hypothesis. It states that a balanced set F ⊆ V (Qn) of cardinality 2m can be avoided by a Hamiltonian cycle if n ≥ m + 2 and m ≥ 1. We show that if S is a k-snake (k-coil) in Qn for n ≥ k ≥ 6 (n ≥ k ≥ 7), then Qn − V (S) is Hamiltonian laceable. For a fixed k the number of vertices of a k-coil may even be exponential with n. We introduce a dragon, which is an induced tree in a hypercube, and its generalization a k-dragon which preserves distances between its every two vertices at distance at most k − 1 in hypercube. By proving a specific lemma from my Bachelor thesis that was previously verified by a computer, we finish the proof of the theorem regarding Hamiltonian laceability of hypercubes without n-dragons.

Keywords: hypercube, faulty , Hamiltonicity, k-snake, k-coil Dedication. I would like to thank my supervisor Petr Gregor for his patience with me and his guidance during my fight with snakes and dragons. I am grateful for every helpful advice he gave me as snakes can bite and k-snakes can bite k times harder. My family and friends deserve a special thanks as they were supporting me all the time. Contents

1 Introduction 1

2 Preliminaries 4 2.1 ...... 4 2.2 Hypercubes ...... 5 2.3 Hamiltonicity ...... 6 2.4 k-snakes and k-coils ...... 7

3 Previous results 10 3.1 Hamiltonicity and hypercubes ...... 10 3.2 k-snakes and k-coils ...... 11 3.3 My previous results ...... 12 3.4 Useful propositions ...... 12

4 Avoiding k-snakes 14 4.1 Exploring k-snakes ...... 14 4.2 Hamiltonization of a path in a hypercube ...... 17 4.3 Disjoint covering by two paths in a hypercube ...... 18 4.4 Traveling to the tail of the snake ...... 20 4.5 Avoiding an almost-balanced snake by a Hamiltonian path . . . . 22 4.6 Avoiding a balanced snake by a Hamiltonian path ...... 30

5 Avoiding k-coils 39 5.1 Exploring k-coils ...... 40 5.2 Traveling between coily vertices...... 44 5.3 Avoiding a k-coil by a Hamiltonian path ...... 47

6 Lemma on n-dragons in small dimensions 56 6.1 Proof of Lemma 6.5 ...... 57

7 Conclusion 61 1. Introduction

Hypercube plays an important role in a design of parallel architectures [26], [30]. It has many suitable properties such as recursive structure, small diameter, high of symmetry, connectivity, effective routing and broadcasting algorithms [26]. A hypercube parallel multiprocessor consists of 2n identical processors (ver- tices), each provided with its own memory and connected to n neighbors (using edges) in a form of a hypercube topology. It has excellent mapping capabilities as it is possible to map various other networks such as rings, linear arrays, multi- dimensional meshes, and trees into hypercubes [34]. As a processor may fail, it is of interest to know how many faults a hypercube network can tolerate while preserving its functionality. One of the first hypercube based computers was built in 1983 in Caltech. It was called the Cosmic and had 64 processors that were connected to a 6- dimensional hypercube topology. Few years later, Intel started offering hypercube computers commercially. After some other successful attempts in building hy- percube based computers, they were abandoned due to their bad scalability (the degree of a hypercube grows logarithmically with the number of its vertices). Still, hypercubes can inspire real world applications. Let us mention a P2P network HyperCuP [36], a Bluetooth network BlueCube [6], and a hypercube topology for dynamic distributed databases called HyperD [40] which was introduced in 2011. The n-dimensional hypercube Qn 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. It is well known that the hypercube Qn is Hamiltonian for every n ≥ 2 [19]. The definition of Hamiltonicity (i.e. the existence of a Hamiltonian cycle in a graph) can be generalized to a Hamiltonian laceability. A H with its bipartition U, V is Hamiltonian laceable if (a) |U| = |V | and there exists a Hamiltonian path between every u ∈ U and every v ∈ V , or (b) |U| = |V | + 1 and there exists a Hamiltonian path between every two distinct u, u′ ∈ U. The hypercube Qn is also Hamiltonian laceable for every n ≥ 1 [37]. In 2001 Stephen Locke [28] conjectured that if F is a balanced set of 2k faulty vertices in Qn where k ≥ 1, then for n ≥ k + 2 the graph Qn − F is Hamiltonian. Since then the conjecture has been proved only for certain values of k and n. The more detailed view on the attempts to prove Locke’s conjecture can be found in Chapter 3. This problem has also been studied when additional conditions are applied on the set F . For example, when the minimum Hamming distance between every two edges of M ⊆ E(Qn) is at least three and the set of faulty vertices is V (M) [16], or when F forms a certain subgraph of Qn like a path or a cycle [39]. We have already explored the Hamiltonian laceability of faulty hypercubes when the set of faulty vertices F forms either an isometric cycle in Qn or an isometric tree in Qn [33]. A subgraph H of G is isometric if dH (u, v) = dG(u, v) for every u, v ∈ V (H) where dG(u, v) is the shortest distance between two vertices u and v in G. Isometric subgraphs of hypercubes are called partial and they were first investigated in 1970’s by Graham and Pollak [14] and Djoković [10].

1 Recently, Leader and Long [25] showed that if G is a subgraph of Qn with average degree d, then G must contain an isometric path of length d. Further references on studies of isometric subgraphs in hypercubes can be found, for example, in a book [17]. Hamiltonian cycles in hypercubes correspond to cyclic binary Gray codes. A cyclic binary of dimension n is a sequence of all 2n binary strings of length n such that any two consecutive strings differ in precisely one coordinate. The scheme to generate such code was patented in 1953 by Frank Gray [15], a researcher at Bell Labs. Binary Gray codes and their variations also appear in surprising places such as solutions to puzzles like Tower of Hanoi or Chinese ring puzzle, signal encoding, data compression, graphic and image processing, hashing and many more [35]. A Gray code itself does not have any error-checking properties. In 1958 Kautz [21] introduced new error-checking code which he called a unit-distance error- checking counting code. It has also been referred to as a snake-in-the-box code or shortly, SIB code. This code is now known as a coil. A coil is an induced cycle in a hypercube. Unfortunately, the terminology was not united at that time and it differs from the one that we use today. We use the term snake for an in a hypercube. Both snakes and coils have been studied for more than fifty years. Their application ranges from analog-to-digital conversion [38], pattern recognition [38], and even the design of combination locks [8]. The most famous problem regarding snakes is a snake-in-the-box problem which asks for the longest snake in a hypercube. Analogously, a coil-in-the-box problem asks for the longest coil in a hypercube. Both of these problems were first introduced by Klee [23]. There has been many attempts to solve the snake-in-the-box problem, yet it still remains open for dimension greater than 7. The problem is trivial for n ≤ 6 and it was solved for n = 7 little more than twenty years ago using a genetic algorithm [31]. Coil-in-the-box is also trivial if 2 ≤ n ≤ 6. It was solved for n = 7 in 1996 [24] and for n = 8 the solution was found recently using canonical augmentation [42]. Finding the longest induced paths in bipartite graphs is known to be NP- complete [13]. With the size of the search space O(n2n ) the methods for solving the snake-in-the-box problem consist of improving the lower and the upper bounds analytically or with the help of computers. Various search techniques are used including optimized exhaustive search [24], genetic algorithms [31], [9] Monte Carlo method [22], reduction to SAT [7], joining together smaller snakes [41], canonical augmentation [42] and more. Even though snakes and coils themselves are an interesting topic with a vast research, in this thesis we shift our interest to their generalizations called k-snakes and k-coils. For n ≥ k ≥ 1 a k-snake is a path S in Qn such that for every u, v ∈ V (S) it holds that if dQn (u, v) < k then dS(u, v) = dQn (u, v).A 1-snake is a path in Qn, a 2-snake is an induced path in Qn (i.e. a snake), and an n-snake is an isometric path in Qn. For n ≥ k ≥ 1 a k-coil is a cycle C in Qn such that for every ∈ u, v V (C) it holds that if dQn (u, v) < k then dC (u, v) = dQn (u, v). Similarly to k-snakes, a 1-coil is a cycle in Qn, a 2-coil is an induced cycle in Qn, and an n-coil is an isometric cycle in Qn. Note that throughout this thesis we do not consider 1-snakes and 1-coils as avoiding them by a Hamiltonian path with prescribed vertices has been already solved [39].

2 The parameter k is called a spread. Both k-snakes and k-coils were introduced in 1966 by Singleton [38]. He noticed that they are useful in digital encoding of analog data. The longer the code, the greater is the accuracy of the system. The greater the spread, the greater is the error-detection capability. Thus there is an interest in finding the longest k-coil which is a question raised by Klee [23]. There have been some attempts to improve lower and upper bounds of the lengths of the longest k-snakes and k-coils [38], [11]. The latest result on k-snakes and k-coils published in 2014 [20] improved an existing algorithm used to search for snakes and coils. The authors managed to find several new longer k-snakes and k-coils. The research on k-snakes and k-coils (contrary to the ordinary snakes and coils) remains scarce. Now we describe the structure of this thesis. In the next chapter we introduce some notation related to graphs, hypercubes, k-snakes, and k-coils. In chapter 3 we summarize the previous results on Hamiltonicity of hypercubes without faulty vertices and dive a bit deeper into the history of k-snakes and k-coils. After that starts the main part which is divided into three chapters. In Chapter 4, we show that if S is a k-snake in Qn where n ≥ k ≥ 6, then the graph Qn − V (S) is Hamiltonian laceable. In Chapter 5, we show that if C is a k-coil in Qn where n ≥ k ≥ 7, then the graph Qn − V (C) is Hamiltonian laceable. In chapter 6, we introduce a generalization of an induced tree in a hypercube which we call k-dragon. For n ≥ k ≥ 1 a k-dragon T is a tree in Qn such that ∈ for every u, v V (T ) it holds that if dQn (u, v) < k then dT (u, v) = dQn (u, v). To the best of our knowledge this term has not been previously used. Unfortunately, avoiding them by a Hamiltonian path using the same method we use with k- snakes and k-coils does not seem to work. We just prove Lemma 6.5 from my Bachelor thesis [32] where it was only verified by a computer. By proving the lemma we finish the proof of the theorem from my Bachelor thesis which states that if T is a balanced n-dragon in Qn where n ≥ 5 and if S is an almost-balanced m-dragon in Qm where m ≥ 6, then both graphs Qn − V (T ) and Qm − V (S) are Hamiltonian laceable. In chapter 7, we review our results, discuss the possibilities of improving the bound on k in Theorem 4.15 and Theorem 5.11, and formulate some open problems. All results in Chapters 4, 5, and 6 are new, up to our knowledge.

3 2. Preliminaries

We start with a standard graph theory notation. If the reader is not familiar with it, he or she can use any introductory book on graph theory. We recommend a book by Matoušek and Nešetřil [29].

2.1 Graph theory

For a graph G let V (G) and E(G) stand for the vertex set and the edge set of G, respectively. For U ⊆ V (G) and a subgraph H of G let G − U denote the subgraph of G induced by V (G)\U and let G−H denote the graph (G−V (H)). The Cartesian product R □ S of graphs R and S is the graph with the vertex set V (R □ S) = V (R) × V (S) and the edge set

E(R □ S) = {(u, v)(u′, v) | uu′ ∈ E(R), v ∈ V (S)} ∪ {(u, v)(u, v′) | vv′ ∈ E(S), u ∈ V (R)} .

For u, v ∈ V (G) let dG(u, v) denote the length of a shortest path between u and v in G.A diameter of a graph G is the value maxu,v∈V (G) dG(u, v). For a vertex u ∈ V (G) a diametral vertex is a vertex v ∈ V (G) such that dG(u, v) is equal to the diameter.

G

P

v u

Figure 2.1: An induced subgraph P which is not an isometric subgraph of G as 4 = dP (u, v) ≠ dG(u, v) = 2.

In this paragraph we introduce certain types of (sub)graphs. A graph G is vertex-transitive if for every two vertices u and v of G there exists an au- tomorphism on V (G) that maps u to v. An intersection of graphs G and H (denoted by G ∩ H) is a graph with the vertex set V (G) ∩ V (H) and the edge set E(G)∩E(H). A subgraph H of G is induced if it is obtained from G by removing vertices (not edges). A subgraph H of G is isometric if dH (u, v) = dG(u, v) for every u, v ∈ V (H). We also say that H is isometrically embedded in G. Every isometric subgraph is an induced subgraph but the converse implication is not true, see Figure 2.1. Let H be a bipartite graph with its bipartitions U and V . We say that H is balanced if |U| = |V | and we say it is almost balanced if sizes of U and V differ by one. A subgraph H of G is convex if for every two vertices u, v ∈ V (H) every shortest path between u and v in G is entirely in H. Let [n] = {1, 2, . . . , n} and [n]0 = [n] ∪ {0} where n is a positive integer. We now introduce notation to describe paths and cycles in graphs. A sequence P =

4 (v0, v1, . . . , vk) is a path of length |P | = k in a graph G (sometimes denoted by (v0P vk) or Pk) if vi ∈ V (G) for all i ∈ [k]0, vj−1vj ∈ E(G) for all j ∈ [k], and vi are distinct for all i ∈ [k]0. If k = 0, then P = (v0) is a path of length 0 and it consists of a single vertex v0. We call v0 and vk the endvertices of P . For j ∈ [k]0 and i ∈ [j]0 the path (vi, vi+1, . . . , vj−1, vj) is a subpath of P . We can join two subpaths R and S of a path P if there exists an edge uv ∈ E(P ) such that R = (rRu) and S = (vSs). We denote the merged path created by joining R and S by (rRu, vSs) or by (R,S). A sequence (v0, v1, . . . , vk−1) is a cycle of length |C| = k in a graph G (some- times denoted by Ck) if vi ∈ V (G) for all i ∈ [k − 1]0, vj−1vj ∈ E(G) for all j ∈ [k − 1], vk−1v0 ∈ E(G), and vi are distinct for all i ∈ [k − 1]0. Sometimes we consider paths and cycles to be graphs instead of sequences of vertices. This slight abuse of definition should not cause any confusion. For example, it allows us to easily define subpaths of any graph.

2.2 Hypercubes

The n-dimensional hypercube Qn (n ≥ 1 ) is an undirected graph with

n V (Qn) = {0, 1} and E(Qn) = {uv ; |∆(u, v)| = 1} where ∆(u, v) = {i ∈ [n] | ui ≠ vi} for u = (u1, . . . , un) and v = (v1, . . . , vn).

Note that the shortest distance dQn (u, v) between two vertices u, v of Qn is called | | the Hamming distance and dQn (u, v) = ∆(u, v) . The zero vertex of Qn is n the vertex 0 = (0, 0,..., 0). If ∆(u, v) = {i}, the edge uv ∈ E(Qn) is said to have the direction i ∈ [n]. We define the size |u| of a vertex u ∈ V (Qn) by |u| = |{i ∈ [n] | ui = 1}|. With this property in mind, we can now distinguish two disjoint sets of vertices of the hypercube. The set Bn of vertices of Qn with even size, which we often call black and draw them as black dots (i.e. •) in pic- tures. Analogously, we call the vertices of Qn with odd size white, denote their set by Wn and draw them as white circles (i.e. ◦). Obviously, the hypercube Qn is bipartite and balanced with bipartitions Bn and Wn. Figure 2.2 shows some hypercubes of small dimension.

1 01 11 010 110 111 011

101 001 0 00 10 000 100

Figure 2.2: Hypercubes Qn for n = 1, 2, 3, 4.

Let us now focus on subcubes of the hypercube Qn. For l ≥ 1 an l-dimensional subcube is a subgraph isomorphic to Ql, often called an l-cube. We represent them by strings from {0, 1, ∗}n. Let w ∈ {0, 1, ∗}n and let us denote the number

5 of ∗’s in w by l. Then w uniquely represents the l-dimensional subcube (denoted by Ql[w]) induced by the vertex set

n {(v1, . . . , vn) ∈ {0, 1} | vi = wi if wi ≠ ∗} .

Subcubes of hypercubes are precisely the convex subgraphs of Qn. Every hypercube of dimension at least 2 is a Cartesian product of two hyper- cubes of smaller dimensions. Precisely, Qn+m ≃ Qn □ Qm for every n, m ≥ 1. We often use this property in the following form. Let l ≥ 1 and Qn ≃ Qn−l □ Ql. n−l Then v ∈ {0, 1} is a vertex of Qn−l and we can also use it to represent the l-dimensional subcube of Qn (denoted by Ql[v]) by right padding the vector v with l asterisks. Let P be a path or a cycle in Qn and let v ∈ V (Qn−l) such that V (Ql[v]) ∩ V (P ) ≠ ∅. Then we use the notation P [v] to denote the graph P ∩ Ql[v]. Although P [v] might be any graph, we mostly use this notation when we know that P [v] is a connected subgraph of P and that is either a subpath of P or a cycle P . In Chapter 6, we use a special case of Qn+m ≃ Qn □ Qm for n ≥ 1 and m = 1. ≃ □ 0,i 1,i That is, we use Qn Qn−1 Q1 to partition Qn into two copies Qn−1 and Qn−1 where i ∈ [n] is a direction of edges removed in order to cut Qn into two subcubes of dimension n − 1 . Formally, for i ∈ [n] we define

0,i ∈ { ∗}n ∗ ̸ Qn−1 = Qn−1[w] where w 0, with wi = 0 and wj = for j = i, 1,i ∈ { ∗}n ∗ ̸ Qn−1 = Qn−1[w] where w 1, with wi = 1 and wj = for j = i.

0 1 If i is fixed, we usually omit it and refer to these two subcubes as Qn−1 and Qn−1. Let us now focus on isometric (sub)paths, (sub)cycles and (sub)trees in hy- percubes. Let P be an isometric path in Qn for n ≥ 1. For every d ∈ [n] there is at most one edge in P of direction d. We show this by contradiction. Let P ′ be an isometric path in Qn such that two distinct edges e and e of P have the same direction. Let P ′ be the shortest subpath of P containing e and e′ and we denote its endvertices by u and v. Then dP ′ (u, v) = dP (u, v) = l where l ≥ 1, − but dQn (u, v) = l 2 which contradicts the definition of an isometric subgraph of Qn. So the length of an isometric path in Qn is at most n. Let C be an isometric cycle in Qn for n ≥ 1. For every d ∈ [n] there are exactly two edges uv, wx ∈ V (C) of direction d or none at all and if C = (uRw, xSv), then |R| = |S| where R and S are subpaths of C. It follows that |C| ≤ 2n. Let T be an isometric tree in Qn for n ≥ 1. For every d ∈ [n] there is exactly one edge in T of direction d, or none at all. It follows that the number of edges of T is at most n.

2.3 Hamiltonicity

A Hamiltonian cycle in a graph G is a cycle in G that contains every vertex of G. We say that G is Hamiltonian if it contains a Hamiltonian cycle. A Hamiltonian path in a graph G between two distinct vertices u and v of G is a path in G such that it contains every vertex of G exactly once and u and v are its endvertices. Now we show a generalization of Hamiltonicity by focusing on bipartite graphs. It was introduced by Lewinter and Widulski [27] in 1997.

6 Definition 2.1 A bipartite graph G with its bipartition U, V is Hamiltonian laceable if (a) G is balanced and there exists a Hamiltonian path between every u ∈ U and every v ∈ V , or (b) G is almost-balanced and there exists a Hamiltonian path between every two distinct vertices of the larger bipartition class

In balanced graphs Hamiltonian laceability implies Hamiltonicity. Let G be a graph and let P and R be two paths in G. We say that {P,R} spans G if V (P ) ∪ V (R) = V (G) and V (P ) ∩ V (R) = ∅. Let u, v, c, d be four distinct vertices of G. We say that {{u, v}, {c, d}} is connectable if there exist paths P between u and v and R between c and d in G such that {P,R} spans G.

2.4 k-snakes and k-coils

A snake is an induced path in a hypercube. It is associated with a so called snake- in-the-box problem (SIB) which aims to find a longest snake in Qn for a given n ≥ 1. We can generalize a snake to a k-snake where the parameter k is called a spread. For n ≥ k ≥ 1 a k-snake is a path S in Qn such that for every u, v ∈ V (S)

it holds that if dQn (u, v) < k then dS(u, v) = dQn (u, v). Informally, k-snakes are paths preserving distances at most k − 1. The task of finding a longest k-snake is referred to as a k-snake-in-the-box problem or shortly SIBk. The value S(n, k) denotes the maximal length of a k-snake in Qn. By the following observation, a 1-snake is an ordinary path in Qn, a 2-snake is an induced path in Qn (i.e. a snake), and an n-snake is an isometric path in Qn.

Observation 2.2 Let S be a k-snake in Qn for n ≥ k ≥ 1. Then, the following statements hold.

(a) If k = 1, then S is a path in Qn.

(b) If k = 2, then S is an induced path in Qn.

(c) If k = n, then S is an isometric path in Qn.

Proof Let u and v be two vertices of S.

(a) If k = 1, then the condition dQn (u, v) < 1 holds only for identical vertices u = v of S. So there are no restrictions on the path S and thus 1-snakes are ordinary paths in Qn.

(b) If k = 2, then the condition dQn (u, v) < 2 holds either for identical vertices u = v of S and as we know from (a) it imposes no restriction on S, or for vertices u, v ∈ V (S) such that uv is an edge of Qn. So every two vertices of S that are adjacent in Qn must be also adjacent in S which is precisely the definition of an induced path in Qn. ∈ (c) Let k = n. If there are no vertices u, v V (S) such that dQn (u, v) = n, then S is obviously an isometric path in Qn by definition. Assume that there exist ′ vertices u, v of S such that dQn (u, v) = n. Let v be any neighbor of v on the ′ ′ − path S . Then dQn (u, v ) = n 1 since u has only one diametral vertex v. Since ′ ′ ′ dQn (u, v ) < n it must hold dS(u, v ) = dQn (u, v ) by the definition of an n-snake.

7 ′ As vv is an edge of S, its length is one and the condition dS(u, v) = dQn (u, v) is satisfied. Thus S is an isometric path in Qn.

The following observation shows that if a k-snake was defined for k > n then it would be an n-snake.

Observation 2.3 For k > n ≥ 1 let S be a path in Qn such that for every ∈ u, v V (S) it holds that if dQn (u, v) < k then dS(u, v) = dQn (u, v). Then S is an n-snake in Qn.

Proof If k > n + 1, then the condition dQn (u, v) < k is vacuous for vertices ∈ u, v V (S) such that dQn (u, v) > n + 1 as there are no such vertices in Qn due to the diameter of Qn being n. If k = n + 1, then for every two vertices u, v of

S such that dQn (u, v) < n + 1 it must be dS(u, v) = dQn (u, v). As the diameter of Qn is n, this is precisely the definition of an isometric path in Qn. So by Observation 2.2, S is an n-snake in Qn.

Also note that every (k + 1)-snake is also a k-snake.

Observation 2.4 Let S be a (k + 1)-snake in Qn for n > k ≥ 1. Then S is also a k-snake.

Proof For every u, v ∈ V (S) it holds that if dS(u, v) < k + 1 then dS(u, v) = dQn (u, v). Since k < k + 1 the condition dS(u, v) = dQn (u, v) is also true if dS(u, v) < k.

The following proposition, proved by Douglas [11], shows different but equiv- alent definitions of k-snakes.

Proposition 2.5 (Douglas [11]) Let S be a path in Qn and let k be an integer such that n ≥ k ≥ 1. Then the following statements are equivalent.

1. S is a k-snake, ∀ ∈ ≥ 2. x, y V (S): dQn (x, y) min(dS(x, y), k), ∀ ∈ ≥ ≥ 3. (i) x, y V (S): if dS(x, y) k then dQn (x, y) k, and ∀ ∈ ≤ (ii) x, y V (S): if dS(x, y) k then dQn (x, y) = dS(x, y).

A coil is an induced cycle in a hypercube. For n ≥ k ≥ 1 a k-coil is a ∈ cycle C in Qn such that for every u, v V (C) it holds that if dQn (u, v) < k then dC (u, v) = dQn (u, v). Informally, k-coils are cycles preserving distances at most k − 1. The task of finding a longest k-coil is referred to as a k-coil-in-the-box problem. The value C(n, k) denotes the maximal length of a k-coil in Qn. By Observation 2.6, a 1-coil is a cycle in Qn, a 2-coil is an induced cycle in Qn (i.e. a coil), and an n-coil is an isometric cycle in Qn. We state it without proof as it is similar to the proof of Observation 2.2.

Observation 2.6 Let C be a k-coil in Qn for n ≥ k ≥ 1. Then, the following statements hold.

8 (a) If k = 1, then C is a cycle in Qn.

(b) If k = 2, then C is an induced cycle in Qn.

(c) If k = n, then C is an isometric cycle in Qn.

Note that Observation 2.3, Observation 2.4, and Proposition 2.5 hold for k- coils as well. Singleton [38] showed some useful properties of k-coils.

Proposition 2.7 (Singleton [38]) Let C be a k-coil in Qn for n ≥ k ≥ 1 and let P be a subpath of C of length k + 1. Then P is an isometric subpath in Qn.

Proposition 2.8 (Singleton [38]) Let C be a k-coil of length greater or equal than 2(k + 1) in Qn for n ≥ k ≥ 1. Let P be a subpath of C of length k + 3. Then there exists a subpath P ′ of P of length k + 2 such that P ′ is an isometric subpath in Qn.

Proposition 2.9 (Singleton [38]) Let [C be] a k-coil of length greater or equal ≥ ≥ ≥ 3k than 2n in Qn for n k 1. Then n 2 + 2.

9 3. Previous results

Here we summarize what is already known about Hamiltonicity of hypercubes without some faulty vertices, about k-snakes, and k-coils. Then we review our previous results considering Hamiltonian laceability of hypercubes without iso- metric cycles and trees. Finally, we introduce a list of previously known propo- sitions that we intend to use throughout this thesis.

3.1 Hamiltonicity and hypercubes

In 1984 Ivan Havel showed that for n ≥ 2 the hypercube Qn is Hamiltonian [19]. As Simmons [37] proved that for n ≥ 1 the hypercube Qn is also Hamiltonian laceable, the interest moved to hypercubes with some vertices removed (so called faulty vertices). In 1997 Lewinter and Widulski [27] showed for n ≥ 1 that if one vertex x ∈ V (Qn) is removed, then the graph Qn − {x} is Hamiltonian laceable. In 2001 Stephen Locke [28] conjectured that if F is a balanced set of 2k faulty vertices of Qn where k ≥ 1, then for n ≥ k + 2 the graph Qn − F is Hamiltonian. Two years later, Richard Stong proved it for k = 1 and published it in the American Monthly [28]. The journal claims that Stong also send the proof for ≥ n 2k + 3 log2 k + 4, but by our knowledge it has not been published anywhere. Harborth and Kemnitz [18] showed that it holds for k = 2 and k = 3, Dvořák ≤ n−5 and Gregor showed that it holds for k 6 , Castañeda and Gotchev showed in 2015 that it holds for k = 4 [4], but altogether Locke’s conjecture remains unproven. An attempt to prove it has been made by Gotchev, Castañeda, and Latour with the first part of the proof available on prof. Gotchev’s website marked as submitted for publication [1]. Gotchev and Castañeda have been active contributors to this particular topic. In 2007 they formulated a Castañeda–Gotchev conjecture that states that for two positive integers n and k where n ≥ k + 3 and for a set F of k black and k + 1 white vertices of Qn it holds that Qn −F is Hamiltonian laceable [3]. They proved it for k = 1 and k = 2 in the same paper [3] and later on they also proved it for k = 3 together with F. Latour [2]. The also proved a weaker versions of Locke’s conjecture and Castañeda and Gotchev’s conjecture [5] which we now present. ′ ′ For a set F of vertices of Qn the set F is a disjoint mirror twin if |F | = |F |, F ∩ F ′ = ∅, and the number of black vertices in F is the same as the number of white vertices in F ′.

Proposition 3.1 (Castañeda and Gotchev [5]) For n ≥ 2 and a set F of faulty vertices of Qn such that 0 ≤ |F | ≤ n − 2 there exists a disjoint mirror twin ′ ′ F such that Qn − (F ∪ F ) is Hamiltonian.

Proposition 3.2 (Castañeda and Gotchev [5]) Let n ≥ 3 and let F be a set of faulty vertices of Qn such that 0 ≤ |F | ≤ n − 3. Then for every pair of vertices ′ u, v ∈ V (Qn) − F with opposite parity there exists a disjoint mirror twin F of F ′ ′ such that {u, v} ∩ F = ∅ and there exists a Hamiltonian path in Qn − (F ∪ F ) between u and v.

10 As the difficulty of the proof of Locke’s conjecture remains uncertain, some work has been done on Hamiltonicity of hypercubes without faulty vertices where some restrictive condition is applied on F . Let d(F ) denote the minimum Ham- ming distance between every two vertices of F . For a set of edges M ⊆ E(Qn) let d(M) denote the minimum Hamming distance between every two edges of M. Gregor and Škrekovski [16] proved that if M is a set of edges of Qn+2 where n ≥ 1 and d(M) ≥ 3, then Qn+2 − V (M) is Hamiltonian. They also formulated the following conjectures, which are still open.

Conjecture 3.3 (Gregor and Škrekovski [16]) Let F be a balanced set of ver- tices of Qn with d(F ) ≥ 3. Then Qn − F contains a Hamiltonian cycle.

Conjecture 3.4 (Gregor and Škrekovski [16]) Let A and B be equal-sized sets of black and white (respectively) vertices of Qn with d(A) ≥ 4 and d(B) ≥ 4. Then Qn − (A ∪ B) contains a Hamiltonian cycle.

In this thesis we consider the problem of Hamiltonicity of Qn − F under the condition on the set F that it forms a specific subgraph of Qn. Some results on this topic are already known. Let n ≥ 4 and let P be a path in Qn of length at most 2n − 5 and let C be a cycle in Qn of length at most 2n − 4. Sun and Jou [39], showed that both graphs Qn − V (P ) and Qn − V (C) are Hamiltonian laceable. Moreover, they also proved that the bounds on the lengths of P and C are tight.

3.2 k-snakes and k-coils

We skip the history of ordinary snakes and coils as the number of papers in which they appear is huge and we did not prove any result that would consider them. In 1966 Singleton [38] first introduced k-coils which he called SIBk codes. He also mentioned SIBk codes which form an open chain, i.e. k-snakes. He proved some useful properties of k-snakes and k-coils which we have already covered in the previous section. He showed a construction of k-coils which takes an existing k-coil and increases its length by increasing n. Based on this construction he obtained the following lower bounds.

C(n, 2) ≥ 4 · 6(n−2)/4 for n ≥ 6, (3.1) C(n, 3) ≥ 32 · 3(n−8)/3 for n ≥ 6, (3.2) ⌊ ⌋ 2n C(n, k) ≥ (k + 1)2⌊2n/(k+1)⌋−1 for k odd and ≥ 2, (3.3) k + 1

And he also improved the upper bound of C(n, 2), and conjectured that

[ ] 3k C( + 2, k) = 4k + 6 for k even, 2

and stated without proof that

11 [ ] 3k C( + 2, k) = 4k + 4 for k odd. 2

Both of these statements were proved by Douglas [11]. In 1970 Klee [23] asked what is the maximum length of a snake (coil) in Qn. He also explored k-coils and reviewed some bounds on the function C. The most recent paper that focuses on k-snakes and k-coils is a 2014 collab- oration of four authors [20]. They presented two algorithms that exhaustively search for k-snakes and k-coils. Altogether, they have managed to find 21 new longest k-snakes, 31 new longest k-coils, and they verified that some of them are optimal. Moreover, they summarized the lengths of the longest known k-snakes and k-coils into a table.

3.3 My previous results

This thesis is partly a followup of my Bachelor thesis [32] in which I have ex- plored Hamiltonian laceability of hypercubes without certain isometric subgraphs, namely cycles and trees. I showed that if C is an isometric cycle in Qn of length divisible by four and n ≥ 6, then Qn − V (C) is Hamiltonian laceable. I have also conjectured that if C is an isometric cycle in Qn of length not divisible by four and n ≥ 6, then Qn − V (C) is Hamiltonian laceable. Both of these statements are now a special case of Theorem 5.11 which we prove in Chapter 5. Together with Petr Gregor we proved that if C is an isometric cycle in Qn such that n ≥ 5, then Qn − V (C) is Hamiltonian laceable and we submitted this result together with the following result regarding isometric trees into Graphs and [33]. We have also proved the following statements regarding isometric trees. Let T be a balanced isometric tree in Qn where n ≥ 5 and let S be an almost- balanced isometric tree in Qm where m ≥ 6. Then both graphs Qn − V (T ) and Qm − V (S) are Hamiltonian laceable. Part of the proof of these statements relied on a computer verification. That part is Lemma 6.5 which we prove in Chapter 6 and thus complete the proof.

3.4 Useful propositions

Now we introduce some proposition that we intend to use and refer to.

Proposition 3.5 (Simmons [37]) For every n ≥ 1 there exists a Hamiltonian path between every b ∈ Bn and every w ∈ Wn in Qn.

′ Proposition 3.6 (Dvořák [12]) Let b, b ∈ Bn be distinct vertices of Qn and ′ ′ ′ let w, w ∈ Wn be distinct vertices of Qn where n ≥ 2. Then {{b, w}, {b , w }} is connectable.

Proposition 3.7 (Sun and Jou [39]) Let P be a path in Qn such that n ≥ 4 and |P | ≤ 2n − 5. Then Qn − V (P ) is Hamiltonian laceable.

12 Proposition 3.8 (Sun and Jou [39]) Let C be a cycle in Qn such that n ≥ 4 and |C| ≤ 2n − 4. Then Qn − V (C) is Hamiltonian laceable.

Proposition 3.9 (Pěgřímek and Gregor [33]) Let C be an isometric cycle in Qn such that n ≥ 5. Then Qn − V (C) is Hamiltonian laceable.

13 4. Avoiding k-snakes

This chapter is devoted to exploring Hamiltonian laceability of hypercube without certain paths. Sun and Jou [39] have already proved that if n ≥ 4 and P is a path in Qn of length at most 2n − 5, then Qn − V (P ) is Hamiltonian laceable. Moreover, the bound 2n − 5 on the length of P is tight. A snake is an induced path in a hypercube, well known from the snake-in- the-box problem which ask for the maximal length of a snake in a hypercube. We mainly focus on their generalization to k-snakes.

Definition 4.1 Let n and k be two integers such that n ≥ k ≥ 1.A k-snake is ∈ a path S in Qn such that for every u, v V (S) it holds that if dQn (u, v) < k then dS(u, v) = dQn (u, v).

By Observation 2.2, a 1-snake is a path in Qn, a 2-snake is an induced path in Qn (i.e. a snake), and an n-snake is an isometric path in Qn where n ≥ 1. Throughout this chapter we denote a k-snake by the letter S, its length by N and its vertices by si for i ∈ [N]0 so that S = (s0, s1, . . . , sN ). The goal of this whole chapter is to prove Theorem 4.15 stating that if S is a k-snake in Qn for n ≥ k ≥ 6, then Qn − V (S) is Hamiltonian laceable. Its proof is divided into two key lemmas, Lemma 4.13 and Lemma 4.14. In Section 4.1 we prove some useful observations regarding k-snakes. In Sec- tion 4.2, Section 4.3, and Section 4.4 we introduce three special constructions. They help us shorten the proof of Theorem 4.15 which is divided into two key lem- mas. In Section 4.5 we prove Lemma 4.13 considering almost-balanced k-snakes. In Section 4.6 we prove Lemma 4.14 considering balanced k-snakes.

4.1 Exploring k-snakes

Q4[p3] Q4[p2]

S[p2]

S[p3]

Q4[p0] Q4[p1]

S[p1] S

S[p0]

Figure 4.1: A 4-snake S in Q7 where P = (p0, p1, p2, p3) is a snaky path in Q3.

14 In most of the proofs that follow we partition the cube Qn into l-cubes for l ∈ [n] which we now introduce along with some related notation. We view the cube Qn as a Cartesian product of Ql and Qn−l where l ∈ [n]. Recall that for n−l v ∈ {0, 1} we denote by Ql[v] the l-dimensional subcube of Qn induced by vertices with the first n − l coordinates fixed by v. Let S be a k-snake in Qn for n ≥ k ≥ l ≥ 1. We say that an l-cube Ql[u] for − u ∈ {0, 1}n l is snaky if it contains a vertex of S. We refer to the vertex u as a n−l snaky vertex. Analogously, an l-cube Ql[v] for v ∈ {0, 1} is snakeless if it does not contain any vertex of S and we refer to the vertex v as a snakeless vertex. The following observation shows that a k-snake in Qn visits each l-dimensional subcube for n ≥ k > l ≥ 1 at most once.

Observation 4.2 Let S be a k-snake in Qn and let Ql[x] be an l-dimensional n−l snaky subcube of Qn for n ≥ k > l ≥ 1 and some x ∈ {0, 1} . Then S ∩ Ql[x] is a connected subpath of S.

Proof We show that if S ∩ Ql[x] is not a connected subpath of S, then there

Ql[x] v ) (u, v n d Q S u

dS(u, v) ≥ 1 + dQn (u, v) + 1

Figure 4.2: A k-snake S returning to the same l-cube Ql[x] for n ≥ k > l ≥ 1. ̸ ∈ This leads to a contradiction dS(u, v) = dQn (u, v) for some vertices u, v V (S) such that dQn (u, v) < k as in the proof of Observation 4.2. ∈ ̸ exist vertices u, v V (S) such that dQn (u, v) < k and dQn (u, v) = dS(u, v). If S ∩ Ql[x] is not connected it has at least two connected components. Let u and v be two vertices of V (S) ∩ V (Ql[x]) such that u is in a different connected ≤ component than v. Since dQn (u, v) l < k and u and v are not connected by S in Ql[x] it must be dS(u, v) > dQn (u, v) as we show in the following estimate of dS(u, v). The distance dS(u, v) is at least the sum of one for the edge from u to some cube different than Ql[x], one for the edge from v to some cube different than Ql[x], and the distance dQn (u, v) as u and v are not connected in Ql[x]. So ≥ due to the convexity of Qn it must be dS(u, v) 1+1+dQn (u, v) which completes the proof.

This observation allows us to introduce some useful definitions. So from now on let k > l and let S be a k-snake in Qn for n ≥ k > l ≥ 1. If Ql[x] is an n−l l-dimensional snaky subcube of Qn where x ∈ {0, 1} we use the notation S[x] to represent the (connected) path S ∩ Ql[x]. We now inductively define a snaky path P = (p0, p1, . . . , pM ) in Qn−l for a k-snake S = (s0, s1, . . . , sN ), see Figure 4.1 for illustration of a snaky path in Q7. Let p0 be the vertex of V (Qn−l) such that s0 is in Ql[p0]. In the inductive

15 step we have a vertex pi−1 ∈ V (P ) and we show how to find pi. Let j be the largest index such that sj is in S[pi−1]. If j = N, then the construction ends with M = i − 1. Otherwise, pi is the vertex of Qn−l such that sj+1 is in Ql[pi]. By Observation 4.2, the path P is well defined. Notice that every vertex of P is snaky and every vertex of V (Qn−l) \ V (P ) is snakeless. The following observation was originally proved by R. Singleton [38]. As he used different notation we prove it ourselves to better suit our needs. It states that for every i ∈ [M]0 the path S[pi] is in fact an l-snake (also known as an isometric path in Ql[pi]).

n−l Observation 4.3 Let S be a k-snake in Qn and let u ∈ {0, 1} be a snaky vertex for n ≥ k > l ≥ 1. Then S[u] is an isometric path in Ql[u]. ∈ ≤ Proof For every two distinct vertices u, v V (S[u]) it holds that dQn (u, v) l < k. From the definition of a k-snake we obtain that dQn (u, v) = dS(u, v). By Observation 4.2, we can see that dS(u, v) = dS[u](u, v), which completes the proof.

From now on we restrict ourselves to the case l ≥ 4. Applying Observation 4.3 we obtain that for every i ∈ [M]0 the subpath S[pi] of S is an isometric subpath in Ql[pi] and therefore the length of S[pi] is at most l. From now on we take l = 4 and fix it. In the following claim we find out that for every i ∈ [M]0 the graph Q4[pi] − V (S[pi]) is Hamiltonian laceable except when the length of S[pi] is four and the prescribed endvertices of the desired Hamiltonian path are u5 and u6 as in Figure 4.3.

Claim 4.4 Let P be an isometric path in Q4, then the graph Q4 − V (P ) is Hamiltonian laceable unless the length of P is four and the prescribed endvertices are u5 and u6 as in Figure 4.3.

Proof Since P is an isometric path in Q4, the length of P is at most four. If the length of P is at most three, then by Proposition 3.7, the graph Q4 − V (P ) is Hamiltonian laceable Let P4 denote an isometric path of length 4 in Q4 and let u5, u6 ∈ W4 be the ′ vertices in Figure 4.3. We now show that for every distinct w, w ∈ W4 \V (P4) ex- ′ ′ cept the case {w, w } = {u5, u6} there exists a Hamiltonian path between w and w in Q4 −V (P4). We denote the white vertices of Q4 −V (P4) by u1, u2, u3, u4, u5, u6, the black vertices of Q4 − V (P4) by c1, c2, c3, c4, c5 and the vertices of P4 by P4 = (b0, w1, b2, w3, b4), see Figure 4.3. We present all 14 Hamiltonian paths in Q4 − V (P4) between ui and uj for every 1 ≤ i < j ≤ 6 except the case {ui, uj} = {u5, u6}:

(u1, c2, u3, c3, u4, c5, u6, c4, u5, c1, u2), (u2, c1, u1, c2, u3, c3, u4, c5, u6, c4, u5), (u1, c1, u2, c2, u4, c5, u5, c4, u6, c3, u3), (u2, c1, u1, c2, u3, c3, u4, c5, u5, c4, u6), (u1, c1, u2, c2, u3, c3, u6, c4, u5, c5, u4), (u3, c2, u2, c1, u1, c5, u5, c4, u6, c3, u4), (u1, c1, u2, c2, u3, c3, u4, c5, u6, c4, u5), (u3, c2, u2, c1, u1, c5, u4, c3, u6, c4, u5), (u1, c1, u2, c2, u3, c3, u4, c5, u5, c4, u6), (u3, c3, u4, c2, u2, c1, u1, c5, u5, c4, u6), (u2, c1, u1, c2, u4, c5, u5, c4, u6, c3, u3), (u4, c3, u3, c2, u2, c1, u1, c5, u6, c4, u5), (u2, c1, u1, c2, u3, c3, u6, c4, u5, c5, u4), (u4, c3, u3, c2, u2, c1, u1, c5, u5, c4, u6).

16 c u1 2 u4 c5

u5 c u 1 2 b4

b2 w3 c4 w1 P4

u c u6 b0 3 3

Figure 4.3: There is no Hamiltonian path between u5 and u6 in Q4 − V (P4) due to the vertex c4 having degree two. The isometric path of length 4 is unique in Q4 up to automorphisms of Q4. Notice that each automorphism of Q4 that preserves P4 maps the set {u5, u6} to itself.

Now we introduce three special constructions that we use in the proofs of Lemma 4.13 and Lemma 4.14.

4.2 Hamiltonization of a path in a hypercube

The first construction transforms a path P = (p0, p1, . . . , pm) in Qn−l where n ≥ ′ ′ l ≥ 1 into a path P in Qn such that P [pi] is a Hamiltonian path in Ql[pi] for every i ∈ [m]0.

Q5 =Q3 Q2 p p 1 P 2

p0

Figure 4.4: Path P used for the Hamiltonization in Figure 4.5 to illustrate Claim 4.5.

Claim 4.5 Let P = (p0, p1, . . . , pm) be a path in Qn−l where n ≥ l ≥ 1. For illustration, see Figure 4.4. Let b ∈ Bl be a vertex in Ql[p0] and w ∈ Wl be a ′ vertex Ql[pm]. Then there exists a path P in Qn between b and w such that

′ V (P ) = V (Ql[p0]) ∪ V (Ql[p1]) ∪ · · · ∪ V (Ql[pm]),

′ and P [pi] is a Hamiltonian path in Ql[pi] for every i ∈ [m]0.

′ Proof We construct a path P in Qn by finding a Hamiltonian path in Ql[pi] for every i ∈ [m]0 and connecting these paths into one, see Figure 4.5. To simplify the notation we denote the vertex b by u0 and the vertex w by vm. Now for every i ∈ [m] we choose an arbitrary black vertex ui in Ql[pi] and we denote the neighbor of ui in Ql[pi−1] by vi−1. Note that vi is white for every i ∈ [m]0. By Proposition 3.5, there exists a Hamiltonian path Hi in Ql[pi] between ui and vi for every i ∈ [m]0.

17 Q2[p1] Q2[p2]

v1 u H2 P 0 2

u1 v2 = w H1

Q2[p0]

v0

u0 = b H0

Figure 4.5: Hamiltonization of the path P from Figure 4.4 resulting in a path P ′ as in the proof of Claim 4.5.

′ Thus we have constructed the desired path P = (u0H0v0, u1H1v1, . . . , umHmvm) in Qn.

4.3 Disjoint covering by two paths in a hyper- cube

The second construction transforms two paths P = (p0, p1, . . . , pm) and R = ′ ′ (r0, r1, . . . , rk) in Qn−l where n ≥ l ≥ 2 into the paths P and R in Qn such that the following conditions hold: (i) For every i ∈ [m]0

′ • either P [pi] is a Hamiltonian path in Ql[pi], or

′ ′ • there exists j ∈ [k]0 such that pi = rj, P [pi] is a connected subpath of P , ′ ′ ′ ′ R [rj] is a connected subpath of R , and {P [pi],R [rj]} spans Ql[pi].

(ii) For every i ∈ [k]0

′ • either R [ri] is a Hamiltonian path in Ql[ri], or

′ ′ • there exists j ∈ [m]0 such that ri = pj, R [ri] is a connected subpath of R , ′ ′ ′ ′ P [pj] is a connected subpath of P , and {R [ri],P [pj]} spans Ql[ri].

p1 p2 Qn−l p3 p4 r1 r2 P R

r0 r3 p0 p5

Figure 4.6: The paths P and R in Qn−l that are used for the construction of disjoint covering in Figure 4.7 to illustrate Claim 4.6.

18 Q [p ] Q [p ] = Q [r ] Q [p ] = Q [r ] Q [p ] l 1 l 2 l 1 0 l 3 l 2 l 4 P u4 v1 H2 H3 u G1 0 G2 1 R v4 H1 H4

Ql[p0] Ql[r0] Ql[r3] Ql[p5]

v0 y0 x3 u5

0 0 u0 = b x0 = b w = y3 w = v5 H0 G0 G3 H5

′ ′ Figure 4.7: Disjoint covering by the paths P and R in Qn which was constructed from the paths P and R in Figure 4.6 as in the proof of Claim 4.6.

Claim 4.6 Let P = (p0, p1, . . . , pm) and R = (r0, r1, . . . , rk) be two paths in Qn−l ′ for n ≥ l ≥ 2. Let b, b ∈ Bl be two distinct vertices such that b is in Ql[p0] and ′ ′ b is in Ql[r0]. Let w, w ∈ Wl be two distinct vertices such that w is in Ql[pm] ′ ′ ′ and w is in Ql[rk]. Then there exist paths P in Qn between b and w and R in ′ ′ Qn between b and w such that

′ ′ V (P ) ∪ V (R ) = V (Ql[p0]) ∪ · · · ∪ V (Ql[pm]) ∪ V (Ql[r0]) ∪ · · · ∪ V (Ql[rk]), (∗)

′ ′ ′ P [pi] is a connected subpath of P for every i ∈ [m]0, and R [rj] is a connected ′ subpath of R for every j ∈ [k]0.

′ Proof We construct two vertex-disjoint paths P = (bH0v0, u1H1v1, . . . , umHmw) ′ ′ ′ ′ and R = (b G0y0, x1G1y1, . . . , xkGkw ) in Qn such that Hi = P [pi] for every ′ i ∈ [m]0, Gj = R [rj] for every j ∈ [k]0 and (∗) holds. To simplify the notation ′ we denote the vertex b by u0, the vertex w by vm, the vertex b by x0, and the ′ ′ ′ vertex w by yk. Note that if P ∩ R = ∅ then by Claim 4.5, paths P and R can be constructed separately using previously described Hamiltonization of a path P between b and w and a path R between b′ and w′, respectively. From now on assume that P ∩R ≠ ∅. For every i ∈ [m] we choose an arbitrary black vertex ui in Ql[pi] and we denote the neighbor of ui in Ql[pi−1] by vi−1. Note that vi is white for every i ∈ [m]0. For every i ∈ [k] we choose an edge yi−1xi such that yi−1 is a white vertex in Ql[ri−1], xi is a black vertex in Ql[ri], and there does not exist j ∈ [m] such that xi = uj or yi−1 = vj−1. Then the following holds: (i) For every i ∈ [m]0

• either there does not exist j ∈ [k]0 such that pi = rj and by Proposition 3.5, there exists a Hamiltonian path Hi between ui and vi in Ql[pi], or

• there exists j ∈ [k]0 such that pi = rj and by Proposition 3.6, there exist paths Hi between ui and vi and Gi between xi and yi such that {Hi,Gi} spans Ql[pi].

(ii) For every i ∈ [k]0

• either there does not exist j ∈ [m]0 such that ri = pj and by Proposition 3.5, there exists a Hamiltonian path Gi between xi and yi in Ql[ri], or

19 • there exists j ∈ [m]0 such that ri = pj and in that case both Hi and Gi are already constructed and the set {Hi,Gi} spans Ql[ri].

Finally, for every i ∈ [m] we join the path Hi−1 with the path Hi using the ′ edge vi−1ui and thus creating the path P = (bH0v0, u1H1v1, . . . , umHmw) in Qn. Similarly, for every i ∈ [k] we join the path Gi−1 with the path Gi using the edge ′ ′ ′ yi−1xi and thus creating the path R = (b G0y0, x1G1y1, . . . , xkGkw ) in Qn. It is easy to verify that both paths satisfy all conditions stated in the claim.

4.4 Traveling to the tail of the snake

Before we show the third and last construction we need the following observation stating that if S is a k-snake in Qn where n ≥ k > (l + 1) ≥ 5 and we have two adjacent snaky l-cubes, then these l-cubes must be connected by an edge of S.

Observation 4.7 Let S be a k-snake in Qn where n ≥ k > (l + 1) ≥ 5 and let n−l n−l u ∈ {0, 1} denote a snaky vertex in Qn−l. Then for every v ∈ {0, 1} such that v is a snaky neighbor of u in Qn−l it holds that (S[u],S[v]) is a connected subpath of S.

Ql[u] Ql[v] P 1 ) z (y, z n d Q S P 0 d(x, y) = 1 y x

dS(x, z) ≥ dQn (x, z) + 2

Figure 4.8: A k-snake S returning to the l-cube Ql for n ≥ k > (l +1) ≥ 5 leads to contradiction as in the proof of Observation 4.7.

Proof Let P 0 = S[u] and let P 1 = S[v]. If P 0 and P 1 are not connected by an edge of S then we show that there exist two vertices x, z ∈ V (S) such ̸ that dQn (x, z) < k but dS(x, z) = dQn (x, z), contrary to the assumption that S is a k-snake. So let x be an arbitrary vertex of P 0 and z be an arbitrary 1 vertex of P , see Figure 4.8. Let y denote the neighbor of x in Ql[v]. Then ≤ dQn (x, z) = dQn (x, y) + dQn (y, z) 1 + l < k but dS(x, z) > dQn (x, z) as we show in the following estimate of dS(x, z). As x and z are not connected through cubes Ql[u] and Ql[v], the distance dS(x, z) is at least the sum of one for the edge from x leaving Ql[u], one for the edge from z leaving Ql[v] and dQn (x, z) to connect vertices x and z outside of ≥ Ql[u] and Ql[v]. So due to the convexity of Qn it must be dS(x, z) 2+dQn (x, z) which completes the proof.

This observation leads to two important corollaries regarding the number of snakeless neighbors of a snaky vertex in Qn−l.

20 Corollary 4.8 Let S be a k-snake in Qn where n ≥ k > (l+1) ≥ 5 and n ≥ l+4. Then every snaky vertex in Qn−l has at least two snakeless neighbors.

Proof From Observation 4.7, it follows that every snaky vertex in Qn−l has at most two snaky neighbors. Since n ≥ l+4 and every vertex in Qn−l has (n−l) ≥ 4 neighbors, we obtain that every snaky vertex has at least two snakeless neighbors.

Corollary 4.9 Let S be a k-snake in Qn where n ≥ k > (l+1) ≥ 5 and n ≥ l+3. Then every snaky vertex in Qn−l has at least one snakeless neighbor. Now we can introduce the third construction which enables us for n ≥ k > (l+1) ≥ 5 and n ≥ l+3 to find a path in Qn−l −V (P ) from a prescribed snakeless ′ vertex r in Qn−l to another a snakeless vertex pM which is a neighbor of pM , the last vertex of a snaky path P = (p0, p1, . . . , pM ) for some k-snake S.

Claim 4.10 Let S be a k-snake in Qn and let P = (p0, p1, . . . , pM ) be a snaky path for S in Qn−l where n ≥ k > (l + 1) ≥ 5 and n ≥ l + 3. Let r be an arbitrary ′ snakeless vertex in Qn−l. Then there exists a path R between r and pM in Qn−l ′ such that every vertex of R is snakeless and pM is a snakeless neighbor of pM .

Proof We choose a snakeless vertex r0 in Qn−l such that r0 is a neighbor of

Qn−l

p2 p3 p4

P

p1 r 0 1 r2 = p4

p0 r0

R

r

′ ′ Figure 4.9: A path R in Qn−l from r to p4 where p4 is a snakeless neighbor of p4 as in the proof of Claim 4.10 with M = 4. some snaky vertex and there exists a path R between r and r0 in Qn−l − V (P ). By Corollary 4.9, the vertex r0 exists. We inductively extend the path R using snakeless vertices which are adjacent to some snaky ones until we reach a snakeless vertex which is a neighbor of pM . In the base of induction we already have a snakeless vertex r0 such that it is adjacent to some snaky vertex. In the induction step i → i+1 we have a snakeless n−l vertex ri ∈ {0, 1} such that ri is adjacent to at least one snaky vertex in Qn−l. Let j ∈ [M]0 be the largest number such that pj is a neighbor of ri. If j = M ′ then the vertex ri is the vertex pM , the resulting path is the extended path R and the construction is finished.

21 Qn−l

p2 p3 p4

P

R p1 r1 r2

Figure 4.10: A detail of Figure 4.9 showing the choice of vertex r2 using the vertex r1 in the induction step i = 1 → 2 as in the proof of Claim 4.10 with j = 3 and M = 4.

We now consider the case when j ≠ M. We extend R into a longer path using n−l a snakeless vertex ri+1 adjacent to ri, see Figure 4.10. Let ri+1 ∈ {0, 1} denote the neighbor of ri in Qn−l such that the direction of the edge riri+1 is equal to the direction of the edge pjpj+1. Notice that ri+1 is a neighbor of pj+1. We show that the vertex ri+1 is snakeless. Assume by contradiction that ri+1 ′ is snaky and thus there exists an integer j ∈ [M]0 such that ri+1 = pj′ . Obviously j′ ≠ j. If j′ > j then this contradicts with the choice of j as the largest number ′ such that pj is a neighbor of ri (since pj′ is a neighbor of ri as well). If j < j then according to Observation 4.7 the path S[pj′ ] must be connected to the path S[pj+1] since the l-cubes Ql[rj′ ] and Ql[rj+1] are both adjacent and snaky. So it must be either j′ = j + 2, or j′ = j. Both of these choices contradict the ′ assumption that j < j. Therefore, Ql[ri+1] is snakeless.

Analogously, we can travel to the head of the snake as well. We state the following claim without proof as it is symmetric to the previous claim. We can picture it as Claim 4.10 but with a flipped k-snake S.

Claim 4.11 Let S be a k-snake in Qn and let P = (p0, p1, . . . , pM ) be a snaky path for S in Qn−l where n ≥ k > (l + 1) ≥ 5 and n ≥ l + 3. Let r be an arbitrary ′ snakeless vertex in Qn−l. Then there exists a path R between r and p0 in Qn−l ′ such that every vertex of R is snakeless and p0 is a snakeless neighbor of p0.

4.5 Avoiding an almost-balanced snake by a Hamil- tonian path

We prove Theorem 4.15 by splitting it into two lemmas depending on the balance of a k-snake. In this section, we prove Lemma 4.13 which considers almost- balanced k-snakes and in the next section, we prove Lemma 4.14 which considers balanced k-snakes. We start with the following observation stating that if we have two adjacent snaky vertices u and v of Qn−l such that S[u] is an l-snake of length l in Ql[u], then S[v] is a single vertex.

Observation 4.12 Let S be a k-snake in Qn where n ≥ k > l ≥ 1 and let n−l u, v ∈ {0, 1} be two adjacent snaky vertices of Qn−l such that the length of the path S[u] is l. Then the path S[v] consists of a single vertex.

Proof By Observation 4.3, the path S[u] is an isometric path in Ql[u]. The length of S[u] is l, so for every i ∈ [l] there exists an edge e of S[u] such that

22 direction of e is i. We show by contradiction that the path S[v] must consists of precisely one vertex. Assume that the length of S[v] is at least one and without loss of generality the length of S[v] is exactly one, i.e. S[v] = (x, y) where x, y ∈ V (S[v]). Then there exists an integer d ∈ [l] such that direction of the edge xy is d. Also there exists an edge e of S[u] such that the direction of e is d. Let c denote the first ̸ vertex of S[u]. Then dQn (c, y) = l < k but dS(c, y) = l + 2 = dQn (c, y) which contradicts the definition of a k-snake.

Lemma 4.13 Let S be an almost-balanced k-snake in Qn where n ≥ 8 and n ≥ k ≥ 6. Then Qn − V (S) is Hamiltonian laceable.

Proof Without loss of generality we can assume that S has more black than white vertices (i.e. S is black-balanced). Recall that we split Qn into sub- n−4 cubes Q4[u] for u ∈ {0, 1} as introduced in the beginning of Section 4.1. ′ Let w, w ∈ Wn be two distinct vertices in Qn − V (S). We show how to construct ′ a Hamiltonian path H between w and w in Qn − V (S). This construction is divided into three parts. Let P = (p0, p1, . . . , pM ) be a snaky path for the k-snake S. In the first part ′ we construct the path H = (H0,H1,...,HM ) such that Hi is a Hamiltonian path in Q4[pi] − V (S[pi]) for every i ∈ [M]0. In the second part we extend the path H′ into a path H∗ between the prescribed vertices w and w′. In the third part of ∗ the proof we extend H into a Hamiltonian path H in Qn − V (S) using snakeless ∗ n−4 4-cubes Q4[u] such that V (Q4[u]) ∩ V (H ) = ∅ where u ∈ {0, 1} .

Part I: Construction of the path H′. ′ We inductively construct the path H = (x0H0y0, x1H1y1, . . . , xM HM yM ) such that Hi is a Hamiltonian path in Q4[pi] − V (S[pi]) for every i ∈ [M]0, see Fig- ure 4.11. The construction of the path H′ consists of four steps. In the first two ′ steps we show how to choose the first vertex x0 of H and the edges yi−1xi for ′ every i ∈ [M]. In the last two steps we choose the last vertex yM of H and find a Hamiltonian path Hi = (xiHiyi) between xi and yi in Q4[pi] − V (S[pi]) for every ′ i ∈ [M]0. By joining them we obtain the path H .

Q4[p0] Q4[p1] Q4[pM ]

xM y0 y 0 H1 1 H HM x x1 0 H0

yM S S[p1] S[pM ] S[p0]

Figure 4.11: Part I of the proof of Lemma 4.13.

Step 1: We choose a vertex x0 in Q4[p0] − V (S[p0]) such that x0 is white. Step 2: For every i = 1,...,M we choose an edge yi−1xi such that it satisfies the following conditions and then we show that it exists.

• The vertex yi−1 is in Q4[pi−1] − V (S[pi−1]),

23 • the vertex xi is in Q4[pi] − V (S[pi]),

• it holds that yi−1 ≠ xi−1,

• the parity of yi−1 is opposite to the parity of the last vertex of S[pi−1], and

• if the length of S[pi−1] is four, then yi−1 ∈/ {u5, u6} as in Figure 4.3.

First, we consider the case when |S[pi−1]| ̸= 4. In the worst case scenario, the edge yi−1xi needs to avoid two vertices of S[pi−1] (if |S[pi−1]| = 3), two vertices of S[pi] (if |S[pi]| = 4), and the vertex xi−1. So there are at most five blocked choices for the edge yi−1xi, but there are 8 edges between subcubes Q4[pi−1] and Q4[pi] such that the parity of its endvertex in Q4[pi−1] is opposite to the parity of the last vertex of S[pi−1]. This leaves us with at least three choices for edge yi−1xi and so it exists. Note that if |S[pi]| = 4, then it may be xi ∈ {u5, u6} as in Figure 4.3. Second, we consider the case when |S[pi−1]| = 4. By Observation 4.12, the path S[pi] consists of a single vertex. Thus in the worst case scenario, the vertex yi−1 needs to avoid two vertices of S[pi−1], the vertex xi−1, and the vertices u5, u6. So once again there are at most five blocked choices for the edge yi−1xi, but there are 8 edges between subcubes Q4[pi−1] and Q4[pi] such that the parity of its endvertex in Q4[pi−1] is opposite to the parity of the last vertex of S[pi−1]. This leaves us with at least three choices for an edge yi−1xi and so it exists. Step 3: We choose a vertex yM in Q4[pM ] − V (S[pM ]) such that yM is white, yM ≠ xM and if the length of S[pM ] is four then yM ∈/ {u5, u6} as in Figure 4.3. The vertex yM has to avoid at most five vertices but there are eight white vertices in Q4[pM ] so it exists. Step 4: Notice that by our choice of vertices xi and yi for every i ∈ [M]0 the parity of xi is opposite to the parity of the first vertex of S[pi], the parity of yi is opposite to the parity of the last vertex of S[pi], and {xi, yi} ̸= {u5, u6} as in Figure 4.3. Thus by Claim 4.4, there exists a Hamiltonian path Hi in Q4[pi] − V (S[pi]) between xi and yi for every i ∈ [M]0. Now we connect these Hamiltonian paths H0, H1, …, HM into a single path ′ H . For every i ∈ [M] we connect the path Hi−1 to the path Hi using the edge ′ yi−1xi creating the desired path H = (x0H0y0, x1H1y1, . . . , xM HM yM ). The path H′ passes through all snaky 4-cubes, avoids all snakeless 4-cubes and also avoids S.

Part II: Extension of the path H′ into a path H∗ between w and w′. ′ ∗ In this part we extend the path H between x0 and yM into a path H between the prescribed vertices w and w′. But before we start let us introduce a helpful n−4 definition we use in this proof. We say that a 4-cube Q4[u] where u ∈ {0, 1} is covered by a path H if either Q4[u] is snaky and V (H) ∩ V (Q4[u]) = V (Q4[u]) \ V (S[u]) or Q4[u] is snakeless and V (Q4[u]) ∩ V (H) = V (Q4[u]). We can see that every snaky 4-cube is already covered by H′. ′ n−4 Let v, v ∈ {0, 1} denote two vertices in Qn−4 such that w is in Q4[v] and ′ ′ w is in Q4[v ]. Then there are four cases to consider which depend on whether the vertices v and v′ are snaky or snakeless. Case 1: Both v and v′ are snakeless vertices, see Figure 4.12. By Claim 4.11, ′ there exists a path U between v and p0 in Qn−4 such that it uses only snakeless

24 Q4[p0] Q4[p1] Q4[pM ] H0

x0 yM S

0 0 0 Q4[p0] Q4[v] Q4[v ] Q4[pM ]

x0 y0 0 U 0 V 0 M w w0

Figure 4.12: Case 1 in the proof of Lemma 4.13.

′ vertices and p0 is a snakeless neighbor of p0. By Claim 4.10, there exists a path ′ ′ ′ V between v and pM in Qn−4 such that it uses only snakeless vertices and pM is a snakeless neighbor of pM . ′ ′ ′ Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote the neighbor of ′ yM in Q4[pM ]. By Claim 4.6, there exists a disjoint cover of paths U and V which ′ ′ ′ ′ ′ consists of a path U between w and x0 in Qn and a path V between w and yM ′ ′ ′ in Qn. By adding the edges x0x0 and yM yM , we have extended the path H into ∗ ′ ′ ′ ′ ′ ′ ′ the path H = (wU x0, x0H yM , yM V w ) between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ). Case 2: Both v and v′ are snaky. Since both vertices w and w′ are in snaky 4-cubes they both belong to the path H′. Without loss of generality we can ′ ′ assume that w is closer to x0 on the path H than w is. There are four cases to consider regarding the vertices w and w′. ′ ′ ′ (a) w ≠ x0 and w ≠ yM : The vertices w and w divide the path H into ′ ′ ′ three subpaths F0, F1, and F2. Explicitly, H = (x0F0w, cF1c , w F2yM ) where ′ c, c ∈ Bn.

0 Q4[p0] Q4[v] Q4[v ] Q4[pM ] w c w0 F0 F2

x0 S yM

0 0 0 Q4[p0] Q4[q] Q4[q ] Q4[pM ] 0 yM x0 0 0 U 0 V d d0

′ Figure 4.13: Case 2a with dH′ (w, w ) = 2 in the proof of Lemma 4.13.

25 ′ First we take care of the case when dH′ (w, w ) = 2, see Figure 4.13. Then the ′ path F1 consists of a single vertex c = c . We choose two distinct neighbors d and d′ of the vertex c such that they are in two distinct snakeless 4-cubes which ′ ′ we denote by Q4[q] and Q4[q ] for q, q ∈ V (Qn−4). Note that by Corollary 4.8, ′ ′ the snakeless vertices q and q exist since n ≥ 8. Say that d is in Q4[q] and d is ′ in Q4[q ]. ′ By Claim 4.11, there exists a path U between q and p0 in Qn−4 such that ′ it uses only snakeless vertices and p0 is a snakeless neighbor of p0. By Claim ′ ′ 4.10, there exists a path V between q and pM in Qn−4 such that it uses only ′ snakeless vertices and pM is a snakeless neighbor of pM . By Claim 4.6, there exists a disjoint cover of paths U and V which consists of a path U ′ between d ′ ′ ′ ′ ′ and x0 in Qn and a path V between d and yM in Qn. By adding the edges x0x0, ′ ′ ′ yM yM , dc, and cd and removing the edges wc and w c, we have obtained the path ∗ ′ ′ ′ ′ ′ ′ ′ H = (wF0x0, x0U d, c, d V yM , yM F2w ) between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ).

0 Q4[p0] Q4[v] Q4[v ] Q4[pM ] 0 w F1 w F0 c c0 F2

x0 yM S

0 0 0 Q4[p0] Q4[q] Q4[q ] Q4[pM ]

x0 y0 0 U 0 V 0 M d d0

′ Figure 4.14: Case 2a with dH′ (w, w ) > 2 in the proof of Lemma 4.13.

′ Now we take care of the case when dH′ (w, w ) > 2, see Figure 4.14. Then ′ ′ ′ c ≠ c and F1 is a subpath of H between c and c of length at least 2. We choose a vertex d ∈ V (Qn) such that d is a neighbor of c and d is in a snakeless 4-cube ′ which we denote by Q4[q] for q ∈ V (Qn−4). We also choose a vertex d ∈ V (Qn) different from d such that d′ is a neighbor of c′ and d′ is in a snakeless 4-cube ′ ′ which we denote by Q4[q ] for q ∈ V (Qn−4). By Corollary 4.8, both vertices q and q′ exist. ′ By Claim 4.11, there exists a path U between q and p0 in Qn−4 such that ′ it uses only snakeless vertices and p0 is a snakeless neighbor of p0. By Claim ′ ′ 4.10, there exists a path V between q and pM in Qn−4 such that it uses only ′ snakeless vertices and pM is a snakeless neighbor of pM . By Claim 4.6, there exists a disjoint cover of paths U and V which consists of a path U ′ between d ′ ′ ′ ′ ′ and x0 in Qn and a path V between d and yM in Qn. By adding the edges x0x0, ′ ′ ′ ′ ′ yM yM , dc, and c d and removing the edges wc and w c , we have obtained the ∗ ′ ′ ′ ′ ′ ′ ′ ′ path H = (wF0x0, x0U d, cF1c , d V yM , yM F2w ) between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ).

26 0 Q4[p0] Q4[p1] Q4[v ] Q4[pM ] w0 F1 c F2

w yM S

0 0 Q4[q ] Q4[pM ]

y0 V 0 M d0

Figure 4.15: Case 2b in the proof of Lemma 4.13.

′ ′ ′ (b) w = x0 and w ≠ yM , see Figure 4.15: The vertex w divides the path H into paths F1 and F2 where F1 is the path between w and c ∈ Bn and F2 is the ′ ′ path between w and yM . By Corollary 4.9, there exists a snakeless neighbor q ′ ′ ′ of v in Qn−4 and let d denote the neighbor of c in Q4[q ]. ′ ′ By Claim 4.10, there exists a path V between q and pM in Qn−4 such that ′ ′ it uses only snakeless vertices and pM is a snakeless neighbor of pM . Let yM ′ ′ denote the neighbor of yM in Q4[pM ]. By Claim 4.5, there exists a path V ′ ′ between d and yM in Qn constructed by Hamiltonization of the path V . By ′ ′ ′ adding the edges yM yM and cd and removing the edge w c, we have obtained the ∗ ′ ′ ′ ′ ′ path H = (wF1c, d V yM , yM F2w ) between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (V ). ′ (c) w ≠ x0 and w = yM : This case is symmetric to the Case 2b. The vertex ′ w divides the path H into paths F0 and F1 where F0 is the path between x0 and w and F1 is the path between c ∈ Bn and yM . By Corollary 4.9, there exists a snakeless neighbor q of v in Qn−4 and let d denote the neighbor of c in Q4[q]. By ′ Claim 4.11, there exists a path U between q and p0 in Qn−4 such that it uses only ′ ′ snakeless vertices and p0 is a snakeless neighbor of p0. Let x0 denote the neighbor ′ ′ ′ of x0 in Q4[p0]. By Claim 4.5, there exists a path U between d and x0 in Qn ′ constructed by Hamiltonization of the path U. By adding the edges x0x0 and dc ∗ ′ ′ ′ and removing the edge wc, we have obtained the path H = (wF0x0, x0U d, cF1w ) ′ between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U). ′ ∗ ′ (d) w = x0 and w = yM : The desired path H between w and w is the path H′ and covers all snaky 4-cubes. Case 3: The vertex v is snakeless and the vertex v′ is snaky. Since w′ is in a ′ ′ snaky 4-cube Q4[v ] it belongs to the path H . Then there are three subcases to consider which depend on w′ being one of the endvertices of the path H′. ′ ′ (a) w = x0: By Claim 4.10, there exists a path V between v and pM in Qn−4 ′ such that it uses only snakeless vertices and pM is a snakeless neighbor of pM . ′ ′ Let yM denote the neighbor of yM in Q4[pM ]. Then by Claim 4.5, there exists a ′ ′ path V between yM and w in Qn constructed by Hamiltonization of the path V . ′ ∗ ′ ′ ′ ′ By adding the edge yM yM , we have obtained the path H = (wV yM , yM H w )

27 0 Q4[p0] Q4[p1] Q4[v ] Q4[pM ] w0 F0 c F1

x0 yM S

0 0 Q4[p0] Q4[v] Q4[q] Q4[pM ]

x0 y0 0 U 0 V 0 M w d

Figure 4.16: Case 3c in the proof of Lemma 4.13.

′ between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (V ). ′ (b) w = yM : This case is symmetric to the previous case. By Claim 4.11, ′ there exists a path U between v and p0 in Qn−4 such that it uses only snakeless ′ ′ vertices and p0 is a snakeless neighbor of p0. Let x0 denote the neighbor of x0 ′ ′ ′ in Q4[p0]. Then by Claim 4.5, there exists a path U between x0 and w in Qn ′ constructed by Hamiltonization of the path U. By adding the edge x0x0, we have ∗ ′ ′ ′ ′ ′ obtained the path H = (wU x0, x0H w ) between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U). ′ ′ (c) x0 ≠ w ≠ yM , see Figure 4.16: We choose a neighbor c ∈ Bn of w on the path H′ such that there exists a neighbor of c in a snakeless 4-cube such which differs from w. By Corollary 4.8, such snakeless 4-cube exists and we denote it n−4 by Q4[q] where q ∈ {0, 1} . Let d denote the neighbor of c in Q4[q] and by the choice of vertex c it holds that d ≠ w. There are two cases to consider which depend on the position of c on the path H′. ′ ′ If c is closer to x0 on the path H than w is, then let F0 be the subpath of ′ ′ ′ H between x0 and c and let F1 be the subpath of H between w and yM . By ′ Claim 4.11, there exists a path U between v and p0 in Qn−4 such that it uses only ′ snakeless vertices and p0 is a snakeless neighbor of p0. By Claim 4.10, there exists ′ a path V between q and pM in Qn−4 such that it uses only snakeless vertices and ′ pM is a snakeless neighbor of pM . ′ ′ ′ Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote the neighbor of ′ yM in Q4[pM ]. By Claim 4.6, there exists a disjoint cover of paths U and V which ′ ′ ′ ′ consists of a path U between w and x0 in Qn and a path V between d and yM ′ ′ ′ in Qn. By adding the edges x0x0, yM yM , and dc and removing the edge w c, we ′ ∗ ′ ′ ′ ′ ′ have extended the path H into the path H = (wU x0, x0F0c, dV yM , yM F1w ) ′ between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ). ′ ′ If c is closer to yM on the path H than w is, then this case is symmetric ′ ′ to the previous one. Let F0 be the subpath of H between x0 and w and let F1 ′ be the subpath of H between c and yM . By Claim 4.11, there exists a path U ′ ′ between q and p0 in Qn−4 such that it uses only snakeless vertices and p0 is a

28 ′ snakeless neighbor of p0. By Claim 4.10, there exists a path V between v and pM ′ in Qn−4 such that it uses only snakeless vertices and pM is a snakeless neighbor of pM . ′ ′ ′ Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote the neighbor of ′ yM in Q4[pM ]. By Claim 4.6, there exists a disjoint cover of paths U and V which ′ ′ ′ ′ consists of a path U between d and x0 in Qn and a path V between w and yM ′ ′ ′ in Qn. By adding the edges x0x0, yM yM , and dc and removing the edge w c, we ′ ∗ ′ ′ ′ ′ ′ have extended the path H into the path H = (wV yM , yM F1c, dU x0, x0F0w ) ′ between w and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ). Case 4: The vertex v is snaky and the vertex v′ is snakeless. This case is symmetric to Case 3.

∗ Part III: Extension of the path H into a Hamiltonian path H in Qn − V (S) between w and w′. In the last part of the proof we connect Hamiltonian paths in every yet still uncovered snakeless 4-cube to the path H∗ extending it to a Hamiltonian path ′ ∗ H in Qn − V (S) between w and w . Notice that due to the way the path H − was constructed in previous two parts it holds that for every u ∈ {0, 1}n 4 either Q4[u] is covered by H or V (Q4[u]) ∩ V (H) = ∅.

t

−→ Z

r = p0 d −→ Figure 4.17: A Hamiltonian path Z in Q3 from p0 to d with a fixed orientation.

− We choose a vertex d ∈ {0, 1}n 4 such that the parity of d is opposite to the parity of p0. By Proposition 3.5, there−→ exists a Hamiltonian path Z in Qn−4 between p0 and d, see Figure 4.17. Let Z denote a directed path between p0 and d created by giving every edge of−→Z the same orientation starting at p0 and ending at d. We now travel along Z from p to d and for every edge (r, t) of −→ 0 Z we make sure that both 4-cubes Q [r] and Q [t] are covered by the path H. −→ 4 4 When considering an edge (r, t) of Z the following invariant holds:

the 4-cube Q4[r] is covered by H and after the assigned action is performed,

the 4-cube Q4[t] is covered by H as well. (∗)

We now show the inductive process which extends the path H∗ into a Hamil- ′ tonian path in between w and w in Qn such that at the end of each inductive step the invariant (∗) holds. In the base of induction we can see the 4-cube Q [p ] is already covered by H∗. In the induction step we have a path H and 4 0 −→ a directed edge (r, t) of Z with Q4[r] covered by H. Then there are two cases to consider regarding the 4-cube Q4[t]. After that Q4[t] will be covered by H as well, satisfying the invariant (∗).

29 Case 1: The 4-cube Q4[t] is already covered by H. No action is needed as the invariant (∗) already holds.

Q4[t]

p0 q0

Q [r] x 4 0 p q

H0

y S[p0] 0

Figure 4.18: A detailed view on the edge rt of Figure 4.17 as in Case 2 of the Part III of the proof of Lemma 4.13.

Case 2: The 4-cube Q4[t] is not covered by H, see Figure 4.18. Recall that ′ in Part I we have covered every snaky 4-cube by H so Q4[t] must be snakeless. ∗ In Part II we have covered some snakeless 4-cubes by H and since Q4[t] is not covered by H it must be that V (Q4[t]) ∩ V (H) = ∅. Since V (Q4[r]) is covered by H we can choose an edge pq of H in Q4[r] such that pq is not an edge of S. Let ′ ′ p and q be the neighbors of p and q in Q4[t], respectively. By Proposition 3.5, ′ ′ there exists a Hamiltonian path T in Q4[t] between p and q . We join T to the path H by adding the edges pp′ and qq′ and removing the edge pq. Since T is a Hamiltonian path and H was extended by T the 4-cube Q4[t] is now covered by H and thus the invariant (∗) holds. −→ Since Z is a Hamiltonian path, the invariant guarantees that we have covered all 4-cubes that were not visited by H∗ in Part II. Thus H is now a Hamiltonian ′ path in Qn − V (S) between w and w .

4.6 Avoiding a balanced snake by a Hamiltonian path

Now we prove Lemma 4.14 which considers balanced k-snakes.

Lemma 4.14 Let S be a balanced k-snake in Qn such that n ≥ 7 and n ≥ k ≥ 6. Then Qn − V (S) is Hamiltonian laceable.

Proof Let b ∈ Wn and w ∈ Wn be two vertices in Qn − V (S). We show how to construct a Hamiltonian path H between b and w in Qn − V (S). This construction is divided into three parts.

30 n−4 Recall that we split Qn into subcubes Q4[u] for u ∈ {0, 1} as introduced in the beginning of Section 4.1. Let P = (p0, p1, . . . , pM ) be the snaky path for the k-snake S. Without loss of generality we can assume that the white endvertex ′ of S is in Q4[p0]. In the first part we construct a path H = (H0,H1,...,HM ) such that Hi is a Hamiltonian path in Q4[pi] − V (S[pi]) for every i ∈ [M]0. In the second part we extend the path H′ into a path H∗ between the prescribed vertices b and w. In the third part of the proof we extend H∗ into a Hamiltonian path H between b and w in Qn − V (S) using snakeless 4-cubes Q4[u] such that ∗ n−4 V (Q4[u]) ∩ V (H ) = ∅ where u ∈ {0, 1} .

Q4[p0] Q4[p1] Q4[pM ]

xM y0 y 0 H1 1 H HM x x1 0 H0

yM S S[p1] S[pM ] S[p0]

Figure 4.19: Part I of the proof of Lemma 4.14.

Part I: Construction of the path H′. ′ We inductively construct the path H = (x0H0y0, x1H1y1, . . . , xM HM yM ) such that Hi is a Hamiltonian path in Q4[pi] − V (S[pi]) for every i ∈ [M]0, see Fig- ure 4.19. The construction of the path H′ consists of four steps. In the first two ′ steps we show how to choose the first vertex x0 of H and the edges yi−1xi for ′ every i ∈ [M]. In the last two steps we choose the last vertex yM of H and find a Hamiltonian path Hi = (xiHiyi) between xi and yi in Q4[pi] − V (S[pi]) for every ′ i ∈ [M]0. By joining them, we obtain the path H . Note that when choosing the vertices xi and yi for some i ∈ [M]0 we have to make sure that if the length of S[pi] is four then {xi, yi} ̸= {u5, u6} as in Figure 4.3, otherwise it would not be possible to find a Hamiltonian path between xi and yi in Q4[pi] − V (S[pi]). Step 1: We choose a vertex x0 in Q4[p0] − V (S[p0]) such that x0 is black and if w ∈ V (Q4[p0]), then x0 is not a neighbor of w. We show that x0 exists. There are at most two black vertices in S[p0] (if |S[p0]| = 4) and if w ∈ V (Q4[p0]), then w has four black neighbors in Q4[p0]. So there are at most six vertices that can not be considered for the choice of x0 but there are eight vertices in Q4[p0]. Thus we have at least two candidates for the vertex x0 which proves its existence. Note that if the length of S[p0] is four, then it may be x0 ∈ {u5, u6} as in Figure 4.3, so we have to make sure that y0 ∈/ {u5, u6}. Step 2: For every i = 1,...,M we choose an edge yi−1xi such that it satisfies the following conditions and then we show that it exists.

• The vertex yi−1 is in Q4[pi−1] − V (S[pi−1]),

• the vertex xi is in Q4[pi] − V (S[pi]),

• yi−1 ≠ xi−1,

• the parity of yi−1 is opposite to the parity of the last vertex of S[pi−1], and

31 • if the length of S[pi−1] is four, then yi−1 ∈/ {u5, u6} as in Figure 4.3.

First, we consider the case when |S[pi−1]| ̸= 4. In the worst case scenario, the edge yi−1xi needs to avoid two vertices of S[pi−1] (if |S[pi−1]| = 3), two vertices of S[pi] (if |S[pi]| = 4), and the vertex xi−1. So there are at most five blocked choices for the edge yi−1xi, but there are 8 edges between subcubes Q4[pi−1] and Q4[pi] such that the parity of its endvertex in Q4[pi−1] is opposite to the parity of the last vertex of S[pi−1]. This leaves us with at least three choices for edge yi−1xi. If |S[pi]| = 4, then it may be xi ∈ {u5, u6} as in Figure 4.3. Second we consider the case when |S[pi−1]| = 4. By Observation 4.12, the path S[pi] consists of a single vertex. Thus in the worst case scenario, the vertex yi−1 needs to avoid two vertices of S[pi−1], the vertex xi−1, and the vertices u5, u6. So once again there are at most five blocked choices for the edge yi−1xi, but there are 8 edges between subcubes Q4[pi−1] and Q4[pi] such that the parity of its endvertex in Q4[pi−1] is opposite to the parity of the last vertex of S[pi−1]. This leaves us with at least three choices for an edge yi−1xi. Step 3: We choose a vertex yM in Q4[pM ] − V (S[pM ]) such that yM is white, yM ≠ xM and if the length of S[pm] is four, then ym ∈/ {u5, u6} as in Figure 4.3. There are eight white vertices in Q4[pM ] and at most five of them can not be considered as candidates for the vertex yM which leaves us with at least three choices for the vertex yM so it exists. Step 4: Notice that by our choice of vertices xi and yi for every i ∈ [M]0 the parity of xi is opposite to the parity of the first vertex of S[pi], the parity of yi is opposite to the parity of the last vertex of S[pi], and {xi, yi} ̸= {u5, u6} as in Figure 4.3. Thus by Claim 4.4, there exists a Hamiltonian path Hi in Q4[pi] − V (S[pi]) between xi and yi for every i ∈ [M]0. Now we connect these Hamiltonian paths H0, H1, …, HM into a single path ′ H . For every i ∈ [M] we connect the path Hi−1 to the path Hi using the edge ′ yi−1xi creating the desired path H = (x0H0y0, x1H1y1, . . . , xM HM yM ). The path H′ passes through all snaky 4-cubes, avoids all snakeless 4-cubes and also avoids S.

Part II: Extension of the path H′ into a path H∗ between b and w. ′ ∗ In this part we extend the path H between x0 and yM into a path H between the prescribed vertices b and w. But before we start let us introduce a helpful n−4 definition we use in this proof. We say that a 4-cube Q4[u] where u ∈ {0, 1} is covered by a path H if either Q4[u] is snaky and V (H) ∩ V (Q4[u]) = V (Q4[u]) \ V (S[u]) or Q4[u] is snakeless and V (Q4[u]) ∩ V (H) = V (Q4[u]). We can see that every snaky 4-cube is already covered by H′. ′ ′ n−4 ′ Let b , w ∈ {0, 1} denote the vertices in Qn−4 such that b is in Q4[b ] and ′ ′ ′ w is in Q4[w ]. Note that it can be b = w . Then there are five cases to consider which depend on whether the vertices b′ and w′ are snaky or snakeless and if both of them are snaky, then it depends on the distance between w and x0 on the path H. Case 1: Both b′ and w′ are snakeless vertices, see Figure 4.20. By Claim 4.11, ′ ′ there exists a path U between b and p0 in Qn−4 such that it uses only snakeless ′ vertices and p0 is a snakeless neighbor of p0. By Claim 4.10, there exists a path ′ ′ ′ V between w and pM in Qn−4 such that it uses only snakeless vertices and pM is a snakeless neighbor of pM .

32 Q4[p0] Q4[p1] Q4[pM ] H0

x0 yM S

0 0 0 0 Q4[p0] Q4[b ] Q4[w ] Q4[pM ]

x0 y0 0 U 0 V 0 M b w

Figure 4.20: Case 1 in the proof of Lemma 4.14.

′ ′ ′ Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote the neighbor of ′ yM in Q4[pM ]. By Claim 4.6, there exists a disjoint cover of paths U and V which ′ ′ ′ ′ consists of a path U between b and x0 in Qn and a path V between w and yM ′ ′ ′ in Qn. By adding the edges x0x0 and yM yM , we have extended the path H into ∗ ′ ′ ′ ′ ′ the path H = (bU x0, x0H yM , yM V w) between b and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ). ′ ′ Case 2: Both b and w are snaky and b is closer to x0 than w on the path ′ H . We consider four subcases depending on the equality of b and x0 and the

0 0 Q4[p0] Q4[b ] Q4[w ] Q4[pM ]

b F1 w F0 c c0 F2

x0 yM S

0 0 0 Q4[p0] Q4[q] Q4[q ] Q4[pM ]

0 0 x yM 0 U 0 V 0 d d0

Figure 4.21: Case 2(a) with dH′ (b, w) > 1 in the proof of Lemma 4.14. equality of w and yM . (a) b ≠ x0 and w ≠ yM : First, we take care of the case when b and w are ′ neighbors. Then we can divide the path H into subpaths F0 and F2 such that ′ H = (x0F0b, wF2yM ). By Corollary 4.9, there exists a snakeless neighbor of ′ ′ p0 and we denote it by p0. By Claim 4.10, there exists a path U between p0 ′ ′ and pM in Qn−4 such that it uses only snakeless vertices and pM is a snakeless ′ ′ ′ neighbor of pM . Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote

33 ′ ′ the neighbor of yM in Q4[pM ]. By Claim 4.5, there exists a path U between ′ ′ x0 and yM in Qn constructed by Hamiltonization of the path U. By adding the ′ ′ edges x0x0 and yM yM and removing the edge bw, we have obtained the path ∗ ′ ′ ′ H = (bF0x0, x0U yM , yM F2w) between b and w in Qn that covers all snaky 4- cubes and also snakeless 4-cubes of V (U). So from now on b and w are not neighbors, see Figure 4.21. Then the vertices ′ ′ b and w divide the path H into three subpaths F0, F1, and F2, i.e. H = ′ ′ (x0F0b, cF1c , wF2yM ) where c ∈ Wn and c ∈ Bn. We choose a vertex d in Qn such that d is a neighbor of c and d is in a snakeless 4-cube Q4[q] for q ∈ V (Qn−4). ′ ′ ′ ′ We choose a vertex d in Qn such that d is a neighbor of c and d is in a snakeless ′ ′ ′ 4-cube Q4[q ] for q ∈ V (Qn−4). By Corollary 4.9, both vertices q and q exist. Note that it may be q = q′. ′ By Claim 4.11, there exists a path U between q and p0 in Qn−4 such that ′ it uses only snakeless vertices and p0 is a snakeless neighbor of p0. By Claim ′ ′ 4.10, there exists a path V between q and pM in Qn−4 such that it uses only ′ snakeless vertices and pM is a snakeless neighbor of pM . By Claim 4.6, there exists a disjoint cover of paths U and V which consists of a path U ′ between d ′ ′ ′ ′ ′ and x0 in Qn and a path V between d and yM in Qn. By adding the edges x0x0, ′ ′ ′ ′ yM yM , cd, and c d and removing the edges bc and c w we have obtained the path ∗ ′ ′ ′ ′ ′ ′ H = (bF0x0, x0U d, cF1c , d V yM , yM F2w) between b and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ).

0 Q4[p0] Q4[p1] Q4[w ] Q4[pM ] F1 w c F2

b yM S

0 0 Q4[q ] Q4[pM ]

0 yM V 0 d0

Figure 4.22: Case 2(b) in the proof of Lemma 4.14.

′ (b) b = x0 and w ≠ yM , see Figure 4.22: The vertex w divides the path H into paths F1 and F2 where F1 is the path between b and c ∈ Bn and F2 is the ′ ′ path between w and yM . We choose a vertex d in Qn such that d is a neighbor ′ ′ ′ of c and d is in a snakeless 4-cube Q4[q ] for q ∈ V (Qn−4). By Corollary 4.9, the ′ ′ vertex q exists. By Claim 4.10, there exists a path V between q and pM in Qn−4 ′ such that it uses only snakeless vertices and pM is a snakeless neighbor of pM . ′ ′ Let yM denote the neighbor of yM in Q4[pM ]. By Claim 4.5, there exists a path ′ ′ ′ V between d and yM in Qn constructed by Hamiltonization of the path V . By ′ ′ adding the edges cd and yM yM and removing the edge cw, we have obtained the ∗ ′ ′ ′ path H = (bF1c, d V yM , yM F2w) between b and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (V ).

34 (c) b ≠ x0 and w = yM : This case is symmetric to the previous case. The ′ vertex b divides the path H into paths F0 and F1 where F0 is the path between x0 and b and F1 is the path between c ∈ Wn and yM . We choose a vertex d in Qn such that d is a neighbor of c and d is in a snakeless 4-cube Q4[q] for q ∈ V (Qn−4). By Corollary 4.9, the vertex q exists. By Claim 4.11, there exists a path U between ′ ′ q and p0 in Qn−4 such that it uses only snakeless vertices and p0 is a snakeless ′ ′ neighbor of p0. Let x0 denote the neighbor of x0 in Q4[p0]. By Claim 4.5, there ′ ′ exists a path U between d and x0 in Qn constructed by Hamiltonization of the ′ path U. By adding the edges cd and x0x0 and removing the edge cw, we have ∗ ′ ′ obtained the path H = (bF0x0, x0U d, cF1w) between b and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U). ∗ (d) b = x0 and w = yM : The desired path H between b and w is the path H′ and covers all snaky 4-cubes.

0 0 Q4[p0] Q4[w ] Q4[b ] Q4[pM ]

w F1 b F0 c0 c F2

x0 yM S

0 0 0 Q4[p0] Q4[q ] Q4[q] Q4[pM ]

0 0 d d y0 x0 M U 0 V 0

Figure 4.23: Case 3 with dH′ (b, w) > 1 in the proof of Lemma 4.14.

′ ′ Case 3: Both b and w are snaky and w is closer to x0 than b on the path H′. First, we take care of the case when b and w are neighbors on the ′ ′ path H . Then we can divide the path H into subpaths F0 and F2 such that ′ H = (x0F0w, bF2yM ). By Corollary 4.9, there exists a snakeless neighbor of ′ ′ p0 and we denote it by p0. By Claim 4.10, there exists a path U between p0 ′ ′ and pM in Qn−4 such that it uses only snakeless vertices and pM is a snakeless ′ ′ ′ neighbor of pM . Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote ′ ′ the neighbor of yM in Q4[pM ]. By Claim 4.5, there exists a path U between ′ ′ x0 and yM in Qn constructed by Hamiltonization of the path U. By adding the ′ ′ edges x0x0 and yM yM and removing the edge bw, we have obtained the path ∗ ′ ′ ′ H = (bF2yM , yM U x0, x0F0w) between b and w in Qn that covers all snaky 4- cubes and also snakeless 4-cubes of V (U). So from now on b and w are not neighbors on the path H′, see Figure 4.23. Notice that unlike in the previous case it holds that b ≠ x0 and w ≠ yM . The ′ vertices b and w divide the path H into three subpaths F0, F1, and F2. Explicitly, ′ ′ ′ H = (x0F0w, c F1c, bF2yM ) where c ∈ Bn and c ∈ Wn. We choose a vertex d in Qn such that d is a neighbor of c and d is in a snakeless 4-cube Q4[q] for ′ ′ ′ ′ q ∈ V (Qn−4). We choose a vertex d in Qn such that d is a neighbor of c and d

35 ′ ′ is in a snakeless 4-cube Q4[q ] for q ∈ V (Qn−4). By Corollary 4.9, both vertices q and q′ exist. Note that it may be q = q′. ′ By Claim 4.11, there exists a path U between q and p0 in Qn−4 such that ′ it uses only snakeless vertices and p0 is a snakeless neighbor of p0. By Claim ′ ′ 4.10, there exists a path V between q and pM in Qn−4 such that it uses only ′ snakeless vertices and pM is a snakeless neighbor of pM . By Claim 4.6, there exists a disjoint cover of paths U and V which consists of a path U ′ between d ′ ′ ′ ′ ′ and x0 in Qn and a path V between d and yM in Qn. By adding the edges x0x0, ′ ′ ′ ′ yM yM , cd, c d and removing the edges bc and wc , we have obtained the path ∗ ′ ′ ′ ′ ′ ′ H = (bF2yM , yM V d , c F1c, dU x0, x0F0w) between b and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ).

0 Q4[p0] Q4[p1] Q4[w ] Q4[pM ] w F0 c F1

x0 yM S

0 0 0 Q4[p0] Q4[b ] Q4[q] Q4[pM ]

x0 y0 0 U 0 V 0 M b d

Figure 4.24: Case 4 in the proof of Lemma 4.14.

Case 4: The vertex b′ is snakeless and the vertex w′ is snaky, see Figure 4.24. ′ ′ Since w is in a snaky 4-cube Q4[w ] it belongs to the path H . First, we take care of the case when w = yM . ′ ′ If w = yM then by Claim 4.11, there exists a path U between b and p0 in ′ Qn−4 such that it uses only snakeless vertices and p0 is a snakeless neighbor of ′ ′ p0. Let x0 denote the neighbor of x0 in Q4[p0]. Then by Claim 4.5, there exists ′ ′ a path U between x0 and b in Qn constructed by Hamiltonization of the path ′ ∗ ′ ′ ′ U. By adding the edge x0x0, we have obtained the path H = (bU x0, x0H w) between b and w in Qn. Now we can assume that w ≠ yM . Let c ∈ Bn denote the neighbor of w such ′ that w is closer to yM on the path H than c is. Recall that in Part I we chose x0 such that it is not a neighbor of w which means that c ≠ x0. Let d be a neighbor n−4 of c such that d is in a snakeless 4-cube which we denote Q4[q] for q ∈ {0, 1} . By Corollary 4.9, the vertex q exists. ′ ′ The vertex w divides the path H into the subpaths F0 and F1, i.e. H = ′ ′ (x0F0c, wF1yM ). By Claim 4.11, there exists a path U between b and p0 in Qn−4 ′ such that it uses only snakeless vertices and p0 is a snakeless neighbor of p0. By ′ Claim 4.10, there exists a path V between q and pM in Qn−4 such that it uses ′ only snakeless vertices and pM is a snakeless neighbor of pM . ′ ′ ′ Let x0 denote the neighbor of x0 in Q4[p0] and let yM denote the neighbor ′ of yM in Q4[pM ]. By Claim 4.6, there exists a disjoint cover of paths U and V

36 ′ ′ ′ which consists of a path U between b and x0 in Qn and a path V between d and ′ ′ ′ yM in Qn. By adding the edges x0x0, yM yM , and cd and removing the edge wc ′ ∗ ′ ′ ′ ′ we have extended the path H into the path H = (bU x0, x0F0c, dV yM , yM F1w) between b and w in Qn that covers all snaky 4-cubes and also snakeless 4-cubes of V (U) ∪ V (V ). Case 5: The vertex b′ is snaky and the vertex w′ is snakeless. This case is symmetric to Case 4.

∗ Part III: Extension of the path H into a Hamiltonian path H in Qn − V (S) between b and w. In the last part of the proof we connect Hamiltonian paths in every yet still uncovered snakeless 4-cube to the path H∗ extending it to a Hamiltonian path ∗ H in Qn − V (S) between b and w. Notice that due to the way the path H − was constructed in previous two parts it holds that for every u ∈ {0, 1}n 4 either Q4[u] is covered by H or V (Q4[u]) ∩ V (H) = ∅.

t

−→ Z

r = p0 d −→ Figure 4.25: A Hamiltonian path Z in Q3 from p0 to d with a fixed orientation.

− We choose a vertex d ∈ {0, 1}n 4 such that the parity of d is opposite to the parity of p0. By Proposition 3.5, there−→ exists a Hamiltonian path Z in Qn−4 between p0 and d, see Figure 4.25. Let Z denote a directed path between p0 and d created by giving every edge of−→Z the same orientation starting at p0 and ending at d. We now travel along Z from p to d and for every edge (r, t) of −→ 0 Z we make sure that both 4-cubes Q [r] and Q [t] are covered by the path H. −→ 4 4 When considering an edge (r, t) of Z the following invariant holds:

the 4-cube Q4[r] is covered by H and after the assigned action is performed,

the 4-cube Q4[t] is covered by H as well. (∗)

We now show the inductive process which extends the path H∗ into a Hamil- tonian path in between b and w in Qn such that at the end of each inductive step the invariant (∗) holds. In the base of induction we can see the 4-cube Q4[p0] is ∗ already covered−→ by H . In the induction step we have a path H and a directed edge (r, t) of Z with Q4[r] covered by H. Then there are two cases to consider re- garding the 4-cube Q4[t]. After that Q4[t] will be covered by H as well, satisfying the invariant (∗). Case 1: The 4-cube Q4[t] is already covered by H. No action is needed as the invariant (∗) already holds. Case 2: The 4-cube Q4[t] is not covered by H, see Figure 4.26. Recall that ′ in Part I we have covered every snaky 4-cube by H so Q4[t] must be snakeless. ∗ In Part II we have covered some snakeless 4-cubes by H and since Q4[t] is not

37 Q4[t]

p0 q0

Q [r] x 4 0 p q

H0

y S[p0] 0

Figure 4.26: A detailed view on the edge rt of Figure 4.25 as in Case 2 of the Part III of the proof of Lemma 4.14.

covered by H it must be that V (Q4[t]) ∩ V (H) = ∅. Since V (Q4[r]) is covered by H we can choose an edge pq of H in Q4[r] such that pq is not an edge of S. Let ′ ′ p and q be the neighbors of p and q in Q4[t], respectively. By Proposition 3.5, ′ ′ there exists a Hamiltonian path T in Q4[t] between p and q . We join T to the path H by adding the edges pp′ and qq′ and removing the edge pq. Since T is a Hamiltonian path and H was extended by T the 4-cube Q4[t] is now covered by H and thus the invariant (∗) holds. −→ Since Z is a Hamiltonian path, the invariant guarantees that we have covered all 4-cubes that were not visited by H∗ in Part II. Thus H is now a Hamiltonian path in Qn − V (S) between b and w.

Theorem 4.15 Let S be a k-snake in Qn where n ≥ k ≥ 6. Then Qn − V (S) is Hamiltonian laceable.

Proof If n = k = 6, then S is an isometric path in Q6 of length 6. By Proposition 3.7, the graph Q6−V (S) is Hamiltonian laceable since 6 ≤ 2·6−5 = 7. If n = 7 and k = 6, then the longest 6-snake in Q7 has length 8 [20]. By Proposition 3.7, the graph Q7−V (S) is Hamiltonian laceable since 8 ≤ 2·7−5 = 9. If n = k = 7, then S is an isometric path in Q7 of length 7. By Proposition 3.7, the graph Q7 − V (S) is Hamiltonian laceable since 7 ≤ 2 · 7 − 5 = 9. If n ≥ 8 and k ≥ 6, then by Lemma 4.13 and by Lemma 4.14, the graph Qn − V (S) is Hamiltonian laceable.

38 5. Avoiding k-coils

This chapter has a similar structure and an aim as the previous one. Instead of focusing on k-snakes we focus on k-coils which are generalization of induced cycles in hypercubes.

Definition 5.1 Let n and k be two integers such that n ≥ k ≥ 1 and n ≥ 2. A k-coil is a cycle C in Qn such that for every u, v ∈ V (C) it holds that if dQn (u, v) < k, then dC (u, v) = dQn (u, v).

By Observation 2.6, a 1-coil is a cycle in Qn, a 2-coil is an induced cycle in Qn (i.e. a coil), and an n-coil is an isometric cycle in Qn where n ≥ 2. Since Qn is bipartite every k-coil is balanced and so its length is even. Throughout this chapter we denote a k-coil by the letter C, its length by 2N and its vertices by ci for i ∈ [2N − 1]0 so that C = (c0, c1, . . . , cN , cN+1, . . . , c2N−1). This chapter explores Hamiltonian laceability of hypercubes without k-coils. Sun and Jou [39] showed that if n ≥ 4 and C is a cycle in Qn (i.e. a 1-coil) of length at most 2n − 4, then Qn − V (C) is Hamiltonian laceable and the bound on the length of C is tight. So Hamiltonian laceability of 1-coils has already been solved. Therefore, we always set k ≥ 2 when mentioning k-coils. Our main goal is to prove Theorem 5.11 stating that if C is a k-coil in Qn where n ≥ k ≥ 7, then the graph Qn − V (C) is Hamiltonian laceable. We start exploring k-coils by introducing several helpful observations and claims. Some basic properties of k-coils are already described in Section 2.4 and the history of k-coils along with some previous results is described in Section 3.2. Here we focus only on properties of k-coils that we directly refer to. We start by showing a notation that simplifies our work with k-coils. Let C = (c0, c1, . . . , cN , cN+1, . . . , c2N−1) be a k-coil in Qn where n ≥ k ≥ 2 and let x, y ∈ V (C) be its two distinct vertices. We can always rename the vertices ′ of C so that we obtain a k-coil C = (d0, d1, . . . , dN , dN+1, . . . , d2N−1) such that ′ V (C) = V (C ), d0 = x and there exists an integer j ∈ [N] such that dj = y, i.e. y is in the first half of C′. We now show how to obtain C′ from C. Let i, j ∈ [2N − 1]0 be two (distinct) indices such that ci = x and cj = y. If either i < j and j −i > N, or i > j and i−j ≤ N we swap x and y so that x = cj and y = ci. Now we just rotate C so its first vertex is x and we are finished. The following observation shows usefulness of such construction. It states that if we split a k-coil into two equal halves, both of these halves are actually k-snakes.

Observation 5.2 Let C = (c0, c1, . . . , cN , cN+1, . . . , c2N−1) be a k-coil in Qn where n ≥ k ≥ 2. Then the subpaths (c0, c1, . . . , cN ) and (cN , . . . , c2N−1, c0) of C are k-snakes in Qn.

Proof Note that by the previous construction we can obtain a k-coil C′ from ′ ′ C such that V (C) = V (C ), cN is the first vertex of C , and c0 is in the first ′ half of C . So it is sufficient just to prove that the path P = (c0, c1, . . . , cN ) is a k-snake.

39 ∈ Let ci, cj V (P ) denote two distinct vertices such that dQn (ci, cj) < k for i, j ∈ [N]0 and without loss of generality i < j. From the definition of a k-coil we obtain that dQn (ci, cj) = dC (ci, cj). But since |(ci, ci−1 mod 2N , ci−2 mod 2N , . . . , cj+2 mod 2N , cj+1 mod 2N , cj)| ≥ N ≥ |(ci, ci+1, . . . , cj−1, cj)| it must be that dC (ci, cj) = |(ci, ci+1, . . . , cj−1, cj)| = dP (ci, cj) which completes the proof.

5.1 Exploring k-coils

We start by restating the partitioning of the cube Qn into l-cubes where l ∈ [n] as we plan to use it again in the proof of Theorem 5.11 for l = 4. We also introduce some notation related to k-coils. We view the cube Qn as a Cartesian product of n−l Ql and Qn−l where l ∈ [n]. Recall that for v ∈ {0, 1} we denote by Ql[v] the l-dimensional subcube of Qn induced by vertices with the first n − l coordinates n−l fixed by v. We say that an l-cube Ql[u] for u ∈ {0, 1} is coily if it contains a vertex of a k-coil C. We refer to the vertex u as a coily vertex. Analogously, an n−l l-cube Ql[v] for v ∈ {0, 1} is coiless if it does not contain any vertex of C and we refer to the vertex v as a coiless vertex. The following observation is analogous to Observation 4.2 regarding k-snakes. It shows that a k-coil in Qn visits each l-dimensional subcube where n ≥ k > l ≥ 1 at most once.

Ql[x]

) v 1 (u, v P n d Q

C u P 0

dC (u, v)

Figure 5.1: A k-coil returning to the same l-cube Ql[x]. This results in a contra- ̸ ∈ diction dQn (u, v) = dC (u, v) for some vertices u, v V (C) such that dQn (u, v) < k as in the proof of Observation 5.3.

Observation 5.3 Let C be a k-coil in Qn and Ql[x] be an l-dimensional coily n−l subcube of Qn for n ≥ k > l ≥ 1 and some x ∈ {0, 1} . Then C ∩ Ql[x] is a connected subgraph of C.

Proof Notice that C ∩ Ql[x] is not necessarily a subpath of C as it is in Observation 4.2. If V (C) ⊆ V (Ql[x]), then the whole k-coil C (which by definition is connected) is in Ql[x] and so the statement holds. Now we take care of the case when V (C) ∩ V (Ql[x]) ≠ V (C), see Figure 5.1. We show that if C ∩ Ql[x] is not a connected subpath of C then there exist ∈ ̸ ∩ vertices u, v V (C) such that dQn (u, v) < k and dQn (u, v) = dC (u, v). If C Ql[x]

40 is not connected, it has at least two connected components. Let u and v be two vertices of V (C) ∩ V (Ql[x]) such that u is in a different connected component ≤ than v. Since dQn (u, v) l < k and u and v are not connected by C in Ql[x] it must be dC (u, v) > dQn (u, v) as we show in the following estimate of dC (u, v). The distance dC (u, v) is at least a the sum of one for the edge from u to some cube different from Ql[x], one for the edge from v to some cube different from

Ql[x], and the distance dQn (u, v) as u and v are not connected in Ql[x]. So due ≥ to the convexity of Qn it must be dC (u, v) 1 + 1 + dQn (u, v) which completes the proof.

This observation allows us to introduce some useful definitions. So from now on let k > l and let C be a k-coil in Qn for n ≥ k > l ≥ 1. If Ql[x] is an n−l l-dimensional coily subcube of Qn where x ∈ {0, 1} we use the notation C[x] to represent the (connected) path (or the cycle) C ∩ Ql[x]. Now we define a coily path P in Qn−l starting at x and preferring y where x and y are two distinct vertices of C and n ≥ k > l ≥ 1. We rename the vertices ′ of C to obtain a k-coil C = (c0, c1, . . . , cN , cN+1, . . . , c2N−1) such that c0 = x and there exists an index j ∈ [N] such that cj = y. First, we take care of the cases when the number of coily vertices is small. If there is only one coily vertex p0 ∈ V (Qn−l), then obviously P = (p0). If there are two coily vertices, then let p0 ∈ V (Qn−l) denote the coily vertex such that c0 is in Ql[p0] and let p1 denote the coily vertex different from p0. Then P = (p0, p1). So from now on let there be at least three coily vertices in Qn−l. Now we inductively construct the coily path P = (p0, p1, . . . , pM ) starting at ′ x and preferring y in Qn−l using C in the following way. Let p0 be the vertex of V (Qn−l) such that c0 is in Ql[p0]. In the inductive step we have a vertex pi−1 ∈ V (P ) and we show how to find pi. Let j be the largest index such that ′ cj is in C [pi−1]. Then pi is the vertex of Qn−l such that cj+1 is in Ql[pi] unless cj+1 mod 2N is already in Ql[p0] in which case the construction ends and we set M = i − 1. By Observation 5.3, the path P is well defined. Notice that every vertex of P is coily and every vertex of V (Qn−l) \ V (P ) is coiless.

c u1 2 u4 c5

u5 c u 1 2 b4

b2 w3 c4 w1 P4

u c u6 b0 3 3

Figure 5.2: There is no Hamiltonian path between u5 and u6 in Q4 − V (P4) due to the vertex c4 having degree two. The isometric path of length 4 is unique in Q4 up to automorphisms of Q4. Notice that each automorphism of Q4 that preserves P4 maps the set {u5, u6} to itself.

In a similar manner we define a coily path P which is a coily path starting at x preferring y for any two distinct vertices x, y of C.

41 From now on let l ≥ 4. Let C be a k-coil in Qn and let P be a coily path in Qn−l where n ≥ k > l ≥ 4. If the length of P is one, then by definition of a k-coil, C[p0] is an l-coil (also known as as isometric cycle in Ql[p0]). If the length of P is at least two, then by Observation 4.3 for every i ∈ [M]0 the path C[pi] is in fact an l-snake (also known as an isometric path in Ql[x]). If l = 4, then by Claim 4.4, for every i ∈ [M]0 the graph Q4[pi] − V (C[pi]) is Hamiltonian laceable except when the length of C[pi] is four and the endvertices of the desired Hamiltonian path are u5 and u6 as in Figure 5.2. Now we further extend Observation 5.3 to show that for two adjacent coily n−l vertices u, v ∈ {0, 1} of Qn−l the paths C[u] and C[v] must be directly con- nected by an edge of C.

Observation 5.4 Let C be a k-coil in Qn where n ≥ k > (l + 1) ≥ 5 and let n−l n−l u ∈ {0, 1} denote a coily vertex in Qn−l. Then for every v ∈ {0, 1} such that v is a coily neighbor of u in Qn−l it holds that (C[u],C[v]) is a connected subpath of C.

Ql[u] Ql[v] P 1 z P 0 ) y, z d( C

x dQn (x, y) = 1 y

dC (x, z)

Figure 5.3: A k-coil C passing through Ql[u] and an adjacent l-cube Ql[v] with- out going there directly from Ql[u] for n ≥ k > (l + 1) ≥ 5 leads to contradiction as in the proof of Observation 5.4.

Proof Let P 0 = C[u] and let P 1 = C[v]. If P 0 and P 1 are not connected by an edge of C, then we show that there exist two vertices x, z ∈ V (C) such ̸ that dQn (x, z) < k but dC (x, z) = dQn (x, z), contrary to the assumption that C is a k-coil. So let x be an arbitrary vertex of P 0 and z be an arbitrary 1 vertex of P , see Figure 5.3. Let y denote the neighbor of x in Ql[v]. Then ≤ dQn (x, z) = dQn (x, y) + dQn (y, z) 1 + l < k but dC (x, z) > dQn (x, z) as we show in the following estimate of dC (x, z). As x and z are not connected through cubes Ql[u] and Ql[v], the distance dC (x, z) is at least the sum of one for the edge from x leaving Ql[u], one for the edge from z leaving Ql[v], and dQn (x, z) to connect vertices x and z outside of Ql[u] and Ql[v]. So due to the convexity of Qn it must ≥ be dC (x, z) 2 + dQn (x, z) which completes the proof.

Corollary 5.5 Let C be a k-coil in Qn where n ≥ k > (l + 1) ≥ 5 and n ≥ l + 4. Then every coily vertex in Qn−l has at least two coiless neighbors.

42 Proof By Observation 5.4, every coily vertex in Qn−l has exactly two coily neighbors. Since n ≥ l + 4 and every vertex in Qn−l has (n − l) ≥ 4 neighbors, we obtain that every coily vertex has at least two coiless neighbors.

Corollary 5.6 Let C be a k-coil in Qn where n ≥ k > (l + 1) ≥ 5 and n ≥ l + 3. Then every coily vertex in Qn−l has at least one coiless neighbor.

As the last extension of Observation 5.3 we show that if C is a k-coil in Qn where n ≥ k > l+2 ≥ 6 and we have a coiless l-cube that has two coily neighbors, then these neighbors must have a common coily neighbor which is connected to both of them by a subpath of C.

Ql[x] Ql[t] d v l ≤ ) C[t] (c, d n d Q

c

Ql[r] Ql[s] C u

C[r] C[s]

dC (u, v)

Figure 5.4: A k-coil in Qn where n ≥ k > (l + 2) ≥ 6 passing through l-cubes Ql[r] and Ql[t] with a common coiless neighbor Ql[x] must also pass through their other common coily neighbor Ql[s] as in the proof of Observation 5.7.

Observation 5.7 Let C be a k-coil in Qn and let l be an integer such that n−l n ≥ k > (l + 2) ≥ 6. Let x, r, t ∈ {0, 1} be some vertices of Qn−l such that Ql[x] is an l-dimensional coiless subcube of Qn which is adjacent to two coily l-dimensional subcubes Ql[r] and Ql[t]. Then there exists a coily vertex − s ∈ {0, 1}n l such that it is a neighbor of both r and t and (C[r],C[s],C[t]) is a connected subpath of C.

Proof Let u be a vertex of C in Ql[r] and let v be a vertex of C in Ql[t], see Figure 5.4. Let c be the neighbor of u in Ql[x] and let d be the neighbor of v ≤ in Ql[x]. Then dQn (u, v) = 1 + dQn (c, d) + 1 l + 2 < k so by the definition of a k-coil it must be that dQn (u, v) = dC (u, v). Since the l-cubes Ql[r] and Ql[t] are not adjacent and the l-cube Ql[x] is coiless, there must exist a coily l-cube

43 n−l Ql[s] where s ∈ {0, 1} such that Ql[s] is adjacent to both Ql[r] and Ql[t]. Thus the path C[s] is connected to both paths C[r] and C[t] otherwise it could not be dQn (u, v) = dC (u, v).

5.2 Traveling between coily vertices.

In the previous chapter we introduced three special constructions that we used in the proof of Lemma 4.13 and Lemma 4.14. In Section 4.2, we showed Hamil- tonization of a path in Qn−l, in Section 4.3, we showed a disjoint covering of two paths in Qn−l, and finally in Section 4.4, we showed that there exists a path in Qn−l from an arbitrary snakeless vertex to a snaky vertex which is an endvertex of a snaky path in Qn−l. In the proof of Theorem 5.11 we still use the first two constructions. But since k-coils have no beginning or end, the third construction can not be used for k-coils. Instead, we replace it by a construction that allows us to travel between arbitrary coily subcubes at the expense of raising the parameter k by one.

Claim 5.8 Let C = (c0, c1, . . . , c2N−1) be a k-coil in Qn and let x, y be two coily vertices in Qn−l where n ≥ k > (l + 2) ≥ 6 and n ≥ l + 4. Then there exists a path R = (r0, r1, . . . , rq) in Qn−l such that every vertex of R is coiless, r0 is a neighbor of x, and rq is a neighbor of y.

Proof If x = y, then by Corollary 5.5, there exists a coiless neighbor r0 of x. Thus the resulting path is R = (r0) and from now on assume that the vertices x and y are distinct. Let P = (p0, p1, . . . , pM ) be a coily path in Qn−l starting at x preferring y. Then p0 = x and there exists an index z ∈ [M] such that pz = y. We start by taking care of the cases when z is small. If z = 1 then we choose vertices r0 and r1 such that r0 is a neighbor of p0, r1 is a neighbor of p1, and the direction of the edges p0r0 and p1r1 is the same. By Corollary 5.5, the vertices r0 and r1 exist and since r0 and r1 are neighbors the resulting path is R = (r0, r1). If z = 2 then the resulting path R depends on the common neighbor of p0 and p2 other than p1. We denote it by p. If p is coiless, then we set r0 = p and the resulting path is R = (r0). If p is coily, then by Observation 5.4, p has precisely two coily neighbors which are of course p0 and p2. Since p is coily as well, C = (p0, p1, p2, p) is a cycle of length four. Let r0 be a coiless neighbor of p0 and let r2 be a coiless neighbor of p2 such that direction of the edges p0r0 and p2r2 is the same. By Corollary 5.5, both r0 and r2 exist. The vertices r0 and r2 must have common coiless vertex which we denote by r1, giving us the resulting path R = (r0, r1, r2). So from now on, z ≥ 3. In what follows, we inductively construct the path R such that every vertex of R is coiless and it is a neighbor of some coily vertex. Note that for the constructed path R there may exist a vertex p ∈ V (P ) such that it is not a neighbor of any of the vertices in R. But we will show that for any two adjacent vertices c and d of P , at least one of them is a neighbor of some vertex of R. In the base of induction we show how to find the vertex r0. We simply choose an arbitrary coiless vertex r0 ∈ V (Qn−l) such that r0 is a neighbor of p0. By Corollary 5.5, the vertex r0 exists.

44 In the induction step i → i + 1 we have a coiless vertex ri such that it has at least one coily neighbor. Our goal is to find a coiless vertex ri+1 such that ri+1 is a neighbor of ri and ri+1 is also a neighbor of some coily vertex and now we show which one. Let j ∈ [z] be the minimum index such that pj is a coily neighbor of ′ ri a let j ∈ [z] be the maximum index such that pj′ is the coily neighbor of ri. By Observation 5.7, there are only two possibilities for indices j and j′. Either ′ ′ j = j or j = j + 2. We want to find ri+1 such that it is a neighbor of pj′+1. As this is a bit tricky, we first explain all the pitfalls. Notice that if j ≠ j′ the choice of ri+1 as the neighbor of pj′+1 means that the vertex pj+1 will be skipped. This means that no vertex of R will be the neighbor of pj+1. Vertices pj and pj+2 will have a coiless neighbor in R. So as needed, for every two adjacent vertices of P (in this case pj and pj+1 or pj+1 and pj+2) at least one of them will be a neighbor of some vertex of R. The problem is when z = j+1 i.e. pj+1 is the coily vertex we want to travel to, and it might be skipped. To avoid this, we split the induction step into two cases. In Case 1 we find a coiless vertex ri+1 such that it is adjacent to the vertices ri and pj′+1. In Case 2 we use a different approach and we find two vertices ri+1 and ri+2 such that both of them are coiless, neighbors of coily and ri+2 is a neighbor of pz. This ensures that we do not skip the vertex pz and the last vertex rq is in fact a neighbor of pz. Now the induction step can start. Recall that the index j′ ∈ [z] is the max- imum index such that pj′ is the coily neighbor of ri. There are two cases to consider.

pj+2 = pj0

ri pj0+1 ri+1

pj pj+1

′ Figure 5.5: Case 1 in the proof of Claim 5.8 when j ≠ j . We have a vertex ri and we want to find a vertex ri+1 such that it is coiless, adjacent to a coily vertex pj′+1, and also adjacent to ri. The edge riri+1 has the same direction as the edge pj′ pj′+1.

Case 1: Precisely one of the choices (a), or (b), or (c) holds.

(a) The index j′ ≠ z − 2.

′ (b) The index j = z − 2 and there does not exist a vertex pz+1.

′ (c) The index j = z − 2 and there exists a vertex pz+1 and the direction of the edge pz−2ri is not equal to the direction of the edge pzpz+1.

′ First we take care of the case when j = z. Then ri is already a neighbor of pz so we set q = i and finish the induction.

45 Now we show how to find a coiless vertex ri+1 such that it is a neighbor of ri n−l and pj′+1, see Figure 5.5. Let ri+1 ∈ {0, 1} denote the neighbor of ri in Qn−l such that the direction of the edge riri+1 is equal to the direction of the edge pj′ pj′+1. Then ri+1 is a neighbor of pj′+1 and all we need to do is to show that the vertex ri+1 is coiless. Assume by contradiction that ri+1 is coily and thus there exists an integer ′ ′ u ∈ [M]0 such that ri+1 = pu. Obviously u ≠ j . If u > j then this contradicts ′ with the choice of j as the largest number such that pj′ is a coily neighbor of ri ′ (since pu is a neighbor of ri as well). If u < j then according to Observation 5.4 the path C[pu] must be directly connected to the path C[pj′+1] since the l-cubes ′ Ql[pu] and Ql[pj′+1] are both adjacent and coily. So it must be either u = j +2, or u = j′. Both of these choices contradict the assumption that u < j′. Therefore, Ql[ri+1] is coiless. ′ If j = z − 1, then ri+1 is a neighbor of pz so we set q = i + 1 and finish the induction.

ri+1 pz+1

pz ri+2

0 ri ri+1

pz−2 pz−1

Figure 5.6: Case 2 in the proof of Claim 5.8. It shows the construction of two vertices ri+1 and ri+2 so that we can finish traveling to a coiless neighbor of pz (which in this case is ri+2).

′ Case 2: The index j = z − 2, there exists a vertex pz+1, and the direction of the edge pz−2ri is equal to the direction of the edge pzpz+1, see Figure 5.6. First we explain why the approach in Case 1 fails for this particular case. If we used ′ ′ the method in Case 1 to find a vertex ri+1 such that ri+1 is a coiless neighbor of ′ ri and pz−1, we would end up with a vertex ri+1 that is a neighbor of pz−1 and pz+1. So no vertex of R would be a neighbor of pz. We now show how to find the vertices ri+1 and ri+2 such that they are both adjacent to P and ri+2 is a neighbor of pz. Then we show that both ri+1 and ri+2 are coiless. We choose a neighbor ri+1 of ri such that the direction of riri+1 equals the direction of pz−1pz. The vertex ri+1 is a neighbor of pz+1. Let ri+2 be the vertex of Qn−l such that it is a neighbor of ri+1 and the direction of the edge ri+1ri+2 is equal to the direction of the edge pzpz+1. Thus the vertex ri+2 is the neighbor of pz−2 and also pz. Now we prove that both vertices ri+1 and ri+2 are coiless. We start with the vertex ri+2. If ri+2 was coily, then pz would have three coily neighbors pz−1, pz+1, and ri+2. This contradicts Observation 5.4 which forbids coily vertices to have more than two adjacent coily neighbors. So ri+2 is coiless. If ri+1 was coily, then

46 by Observation 5.7, one of the vertices ri or ri+2 would have to be coily as well. But we already know that both of them are coiless so ri+1 must be coiless as well. So we set q = i + 2 and the induction finishes.

5.3 Avoiding a k-coil by a Hamiltonian path

In this section we prove Lemma 5.10 which is a key part of the proof of Theo- rem 5.11 which we prove here as well. We just need the following observation stating that if we have two adjacent coily vertices u and v of Qn−l such that the length of C[u] is l and there exists at least one coily vertex different from u and v, then C[v] consists of a single vertex.

Observation 5.9 Let C be a k-coil in Qn where n ≥ k > l ≥ 1 and let u, v ∈ n−l {0, 1} be two adjacent coily vertices of Qn−l such that the length of the path C[u] is l. Then the path C[v] consists of a single vertex unless V (C[u]) ∪ V (C[v]) = V (C).

Proof By Observation 4.3, the path C[u] is an isometric path in Ql[u]. The length of C[u] is l, so for every i ∈ [l] there exists an edge e of C[u] such that direction of e is i. We show by contradiction that the path C[v] must consists of precisely one vertex. Assume that the length of C[v] is at least one and without loss of generality the length of C[v] is exactly one, i.e. C[v] = (x, y) where x, y ∈ V (C[v]). Then there exists an integer d ∈ [l] such that direction of the edge xy is d. Also there exists an edge e of C[u] such that the direction of e is d. Let c denote the first ̸ vertex of C[u]. Then dQn (c, y) = l < k but dC (c, y) = l + 2 = dQn (c, y) which contradicts the definition of a k-coil.

Lemma 5.10 Let C be a k-coil in Qn such that n ≥ k ≥ 7 and n ≥ 8. Then Qn − V (C) is Hamiltonian laceable.

Proof First, we take care of an edge case when the length of C is at most 10. By Proposition 3.8, the graph Qn − V (C) is Hamiltonian laceable as |C| ≤ 2n − 4 ≤ 2 · 8 − 4 = 12. So from now on let the length of C be at least 12. Now we can move to the proof itself. Let b ∈ Bn and w ∈ Wn be two vertices in Qn − V (C). We show how to construct a Hamiltonian path H between b and w in Qn − V (C). This construction is divided into three parts. n−4 Recall that we split Qn into subcubes Q4[u] for u ∈ {0, 1} as introduced in the beginning of Section 5.1. Let P = (p0, p1, . . . , pM ) be a coily path for ′ the k-coil C. In the first part, we construct a cycle H = (H0,H1,...,HM ) in Qn − V (C) such that Hi is a Hamiltonian path in Q4[pi] − V (C[pi]) for every ′ ∗ i ∈ [M]0. In the second part, we transform the cycle H into a path H between the prescribed vertices b and w. In the third part of the proof we extend H∗ into a Hamiltonian path H in Qn − V (C) by visiting coiless 4-cubes Q4[u] for every n−4 ∗ u ∈ {0, 1} such that V (Q4[u]) ∩ V (H ) = ∅ (i.e. 4-cubes that have not been visited in Part I and Part II).

47 Since the length of C is at least 12 the length of P must be at least 3 as we now show. The length of P can not be one, otherwise C would be an isometric cycle in Q4[p0] of length at most 2 · 4 = 8. The length of P can not be two, otherwise C[p0] would be an isometric path in Q4[p0] of length at most 4 and C[p1] would be an isometric path in Q4[p1] of length at most 4. So C would be an isometric cycle of length at most 10. Part I: Construction of a cycle H′. ′ We inductively construct a cycle H = (x0H0y0, x1H1y1, . . . , xM HM yM ) such that Hi is a Hamiltonian path in Q4[pi] − V (C[pi]) for every i ∈ [M]0. The construction of H′ consists of three steps. In the first step we choose the edge yM x0. In the second step we choose the edges yi−1xi for every i ∈ [M]. In the third step we find a Hamiltonian path Hi = (xiHiyi) between xi and yi in ′ Q4[pi] − V (C[pi]) for every i ∈ [M]0. By joining them we obtain the cycle H . Note that when choosing the vertices xi and yi for some i ∈ [M]0 we have to make sure that if the length of C[pi] is four then {xi, yi} ̸= {u5, u6} as in Figure 5.2, otherwise it would not be possible to find a Hamiltonian path between xi and yi in Q4[pi] − V (C[pi]). Step 1: We choose an edge yM x0 such that yM is in Q4[pM ] − V (C[pM ]), x0 is in Q4[p0] − V (C[p0]), the parity of yM is opposite to the parity of the last vertex of C[pM ], and if the length of C[pM ] is four then yM ∈/ {u5, u6} as in Figure 5.2. We now show that such edge exists. First, we consider the case when the length of C[pM ] is four. By Observa- tion 5.9, the path C[p0] consists of a single vertex. Thus the vertex yM has to avoid two vertices of C[pM ] and the vertices u5 and u6, as in Figure 5.2. There are eight edges between the subcubes Q4[pM ] and Q4[p0] such that the parity of its endvertex in Q4[pM ] is opposite to the parity of the last vertex of C[pM ]. This leaves us with at least four choices for the edge yM x0 and so it exists. Second, we consider the case when the length of C[pM ] is at most three. In the worst case scenario the edge yM x0 has to avoid two vertices of C[pM ] (if |C[pM ]| = 3) and two vertices of C[p0] (if |C[p0]| = 4). There are eight edges between the subcubes Q4[pM ] and Q4[p0] such that the parity of its endvertex in Q4[pM ] is opposite to the parity of the last vertex of C[pM ]. This leaves us with at least four choices for the edge yM x0 and so it exists. Step 2: For every i = 1,...,M we choose an edge yi−1xi such that it satisfies the following conditions and then we show that it exists.

• The vertex yi−1 is in Q4[pi−1] − V (C[pi−1]),

• the vertex xi is in Q4[pi] − V (C[pi]),

• it holds that yi−1 ≠ xi−1,

• the parity of yi−1 is opposite to the parity of the last vertex of C[pi−1],

• if i = M then xM ≠ yM , and

• if the length of C[pi−1] is four then yi−1 ∈/ {u5, u6} as in Figure 5.2.

First, we consider the case when the length of C[pi−1] is four. By Observa- tion 5.9, the path C[pi] consists of a single vertex. The vertex yi−1 has to avoid two vertices of C[pi−1], the vertex xi−1, the vertices u5 and u6, as in Figure 5.2,

48 and if i = M, then xM has to avoid yM as well. There are eight edges between the subcubes Q4[pi−1] and Q4[pi] such that the parity of its endvertex in Q4[pi−1] is opposite to the parity of the last vertex of C[pi−1]. This leaves us with at least two choices for the edge yi−1xi and so it exists. Second, we consider the case when the length of C[pi−1] is at most three. In the worst case scenario the edge yi−1xi has to avoid two vertices of C[pi−1] (if |C[pi−1]| = 3), two vertices of C[pi] (if |C[pi]| = 4), the vertex xi−1, and if i = M then xM has to avoid yM as well. There are eight edges between the subcubes Q4[pi−1] and Q4[pi] such that the parity of its endvertex in Q4[pi−1] is opposite to the parity of the last vertex of C[pi−1]. This leaves us with at least two choices for the edge yi−1xi and so it exists. Step 3: Notice that by our choice of vertices xi and yi for every i ∈ [M]0 the parity of xi is opposite to the parity of the first vertex of C[pi], the parity of yi is opposite to the parity of the last vertex of C[pi], and {xi, yi} ̸= {u5, u6} as in Figure 5.2. Thus by Claim 4.4, there exists a Hamiltonian path Hi in Q4[pi] − V (C[pi]) between xi and yi for every i ∈ [M]0. ′ Now we connect these Hamiltonian paths H0, H1, …, HM into a cycle H . For every i ∈ [M] we connect the path Hi−1 to the path Hi using the edge yi−1xi. Finally, we connect paths HM and H0 using the edge yM x0 creating the desired ′ cycle H = (x0H0y0, x1H1y1, . . . , xM HM yM ). It passes through all coily 4-cubes, avoids all coiless 4-cubes and also avoids C.

Part II: Transformation of the cycle H′ into a path H∗ between b and w. In this part we transform the cycle H′ into a path H∗ between the prescribed vertices b and w. But before we start let us introduce a helpful definition we use n−4 throughout this proof. We say that for u ∈ {0, 1} the 4-cube Q4[u] is covered by a path H (or by a cycle H) if either Q4[u] is coily and V (H) ∩ V (Q4[u]) = V (Q4[u]) \ V (C[u]), or Q4[u] is coiless and V (Q4[u]) ∩ V (H) = V (Q4[u]). Notice that due to the way the cycle H′ was constructed in the Part I, every coily 4-cube is already covered by H′. ′ ′ n−4 ′ Let b , w ∈ {0, 1} denote the vertices in Qn−4 such that b is in Q4[b ] and ′ ′ ′ w is in Q4[w ]. Note that it can be b = w . Then there are four cases to consider which depend on whether the vertices b′ and w′ are coily or coiless. Case 1: Both b′ and w′ are coily vertices, see Figure 5.7. Both coily 4-cubes ′ ′ ′ Q4[b ] and Q4[w ] are already covered by H which means that b and w belong to the cycle H′. If b and w are adjacent on H′ we just remove the edge bw from ′ ∗ ′ the cycle H to obtain the path H = (bH w) between b and w in Qn. The construction ends with no new 4-cubes covered by H∗. From now on we can assume that b and w are not adjacent on H′. The vertices ′ b and w divide the cycle H into the path F0 between b and c and the path F1 between w and u where c is the black neighbor of w on the cycle H′ and u is the ′ ′ white neighbor of b on the cycle H such that H = (bF0c, wF1u). Since b and w are not adjacent on H′, it holds that c ≠ b and u ≠ w. By Claim 5.8, there exists a path R in Qn−4 − V (P ) between p and q where p is a (coiless) neighbor of b′ and q is a (coiless) neighbor of w′. Let v be the neighbor of u in Q4[p] and let d be the neighbor of c in Q4[q]. By Claim 4.5, there ′ exists a path R between v and d in Qn constructed by Hamiltonization of the path R. By removing the edges ub and cw from H′ and adding the edges uv and

49 Q4[p0] Q4[p1] Q4[pi]

F 1 H0

C

0 0 Q4[b ] Q4[w ]

w b

u F0 c

v d

R0

Q4[p] Q4[q]

Figure 5.7: Case 1 in the proof of Lemma 5.10.

′ ∗ ′ cd we transform the cycle H into the path H = (bF0c, dR v, uF1w) between b and w in Qn that covers precisely all coily 4-cubes and also the (coiless) 4-cubes of V (R). Case 2: The vertex b′ is coily and the vertex w′ is coiless, see Figure 5.8. ′ ′ The coily 4-cube Q4[b ] is already covered by H which means that b belongs to ′ ′ ′ the cycle H . We choose two adjacent vertices v and v in Qn−4 such that v is ′ coily, v is coiless, and there exists a path V between w and v in Qn−4 − V (P ). By Corollary 5.6, the vertex v exists and note that every vertex of V is coiless. First we take care of the case when v and b′ are adjacent. Let c be the neighbor ′ ′ of b on H in Q4[b ] and let d be the neighbor of c in Q4[v]. By Claim 4.5, there ′ exists a path V between w and d in Qn constructed by Hamiltonization of the path V . By removing the edge cb from H′ we transform the cycle H′ into the ∗ ′ ′ path H = (bH c, dV w) between b and w in Qn that covers precisely all coily 4-cubes and also the (coiless) 4-cubes of V (V ). So from now on b′ is not adjacent to v. By Claim 5.8, there exists a path R in Qn−4 − V (P ) between p and q where p is a (coiless) neighbor of b′ and q is a (coiless) neighbor of v′. Note that it may ′ ′ be q = v. Let c be the neighbor of b on H in Q4[b ]. We choose an edge rs of ′ ′ H in Q4[v ] such that r is black (and s is white), r ≠ b, s ≠ c, and the edge rs ′ ′ divides the cycle H = (bH c) into the path F0 between b and r and the path F1 ′ between s and c. Explicitly, H = (bF0r, sF1c). Let t be the neighbor of r in Q4[q], let u be the neighbor of s in Q4[v], and let d be the neighbor of c in Q4[p]. By Claim 4.6, there exists a disjoint cover of paths ′ ′ R and V which consists of a path R between d and t in Qn and a path V between ′ w and u in Qn. By removing the edges cb and rs from H and adding the edges cd,

50 Q4[p0] Q4[p1] Q4[pi]

F 1 H0

C

0 0 Q4[b ] Q4[v ]

b s c F0 r

d t u

R0

V 0 w

0 Q4[p] Q4[v] = Q4[q] Q4[w ]

Figure 5.8: Case 2 in the proof of Lemma 5.10.

′ ∗ ′ ′ rt, and su we transform the cycle H into the path H = (bF0r, tR d, cF1s, uV w) between b and w in Qn that covers precisely all coily 4-cubes and also the (coiless) 4-cubes of V (R) ∪ V (V ). Case 3: Both vertices b′ and w′ are coiless. We choose two adjacent vertices ′ ′ d and d in Qn−4 such that d is coily, d is coiless, and there exists a path U ′ between b and d in Qn−4 − V (P ). By Corollary 5.6, the vertex d exists and note that every vertex of U is coiless. There are two cases to consider which depend on the existence of a path between w′ and some vertex of U. ′ (a) There exists a path in Qn−4 − V (P ) between w and some vertex of U, see ′ Figure 5.9. We choose a vertex q of U such that the path V0 between w and q in Qn−4 − V (P ) is the shortest possible. Since V0 is the shortest path it must be V (U) ∩ V (V0) = {q}. Let V1 be a subpath of U in Qn−4 between q and d. Note that it may be V1 = (q). We join together the paths V0 and V1 into a single path ′ V in Qn−4 between w and d. ′ So far we have two paths in Qn−4 − V (P ). The path U between b and d and the path V between w′ and d. Recall that d is a coiless neighbor of the coily ′ ′ ′ vertex d . Let rs be an edge of H in Q4[d ] such that r is black (and s is white). Let u be the (white) neighbor of r in Q4[d] and let v be the (black) neighbor of s in Q4[d]. By Claim 4.6, there exists a disjoint cover of paths U and V which ′ ′ consists of a path U between b and u in Qn and a path V between w and v ′ in Qn. By removing the edge rs from H and adding the edges ur and vs we transform the cycle H′ into the path H∗ = (bU ′u, rH′s, vV ′w) between b and w in Qn that covers all coily 4-cubes and also the coiless 4-cubes of V (U) ∪ V (V ). ′ (b) There does not exist a path in Qn−4 − V (P ) between w and any vertex of ′ ′ U, see Figure 5.10. We choose two adjacent vertices v and v in Qn−4 such that v

51 Q4[p0] Q4[p1] Q4[pi]

H0

C

0 Q4[d ]

s r

u v V 0 U 0 b w

0 0 Q4[b ] Q4[d] = Q4[q] Q4[w ]

Figure 5.9: Case 3a in the proof of Lemma 5.10.

′ is coily, v is coiless, and there exists a path V between w and v in Qn−4 − V (P ). By Corollary 5.6, the vertex v exists and note that every vertex of V is coiless ′ ′ ′ and V (U) ∩ V (V ) = ∅. We choose an edge tu of H in Q4[v ] such that t is black, ′ ′ ′ ′ u is white, and t is not a neighbor of w. We choose an edge ec of H in Q4[d ] such that e is white, e is different from u′ and not adjacent to b, c′ is black and ′ ′ ′ ′ ′ different from t, and H = (c F0t, u F1e) where F0 is a subpath of H between c ′ ′ and t and F1 is a subpath of H between e and u . By Claim 5.8, there exists a path R in Qn−4 − V (P ) between p and q where p is a (coiless) neighbor of d′ and q is a (coiless) neighbor of v′. Let c be the ′ ′ neighbor of c in Q4[d] and let u be the neighbor of u in Q4[v]. Let r be the neighbor of e in Q4[p] and let s be the neighbor of t in Q4[q]. Note that it can be V (R) ∩ V (U) ≠ ∅ or V (R) ∩ V (V ) ≠ ∅ but not both as that would imply the ′ existence of a path in Qn−4 − V (P ) between w and some vertex of U. We now handle the possible cases separately. If V (R)∩V (U) ≠ ∅, then by Claim 4.6, there exists a disjoint cover of paths U ′ ′ and R which consists of a path U between b and c in Qn and a path R between ′ r and s in Qn. By Claim 4.5, there exists a path V between w and u in Qn constructed by Hamiltonization of the path V . By removing the edges ec′ and u′t from H′ and adding the edges cc′, re, st, and uu′ we transform the cycle H′ ∗ ′ ′ ′ ′ ′ into the path H = (bU c, c F0t, sR r, eF1u , uV w) between b and w in Qn that covers all coily 4-cubes and also the coiless 4-cubes of V (U) ∪ V (V ) ∪ V (R). If V (R) ∩ V (V ) ≠ ∅, then by Claim 4.6, there exists a disjoint cover of paths ′ ′ V and R which consists of a path V between w and u in Qn and a path R ′ between r and s in Qn. By Claim 4.5, there exists a path U between b and c in ′ Qn constructed by Hamiltonization of the path U. By removing the edges ec and

52 Q4[p0] Q4[p1] Q4[pi]

F1 H0

C

0 0 Q4[d] Q4[d ] Q4[v ] Q4[v]

u e u0 F c c0 0 t

s r V 0 R0

U 0

Q4[p] Q4[q]

b w 0 0 Q4[b ] Q4[w ]

Figure 5.10: Case 3b in the proof of Lemma 5.10. u′t from H′ and adding the edges cc′, re, st, and uu′ we transform the cycle H′ ∗ ′ ′ ′ ′ ′ into the path H = (bU c, c F0t, sR r, eF1u , uV w) between b and w in Qn that covers all coily 4-cubes and also the coiless 4-cubes of V (U) ∪ V (V ) ∪ V (R). If V (R) ∩ V (U) = ∅ and V (R) ∩ V (V ) = ∅, then by Claim 4.5, there exists ′ a path U between b and c in Qn constructed by Hamiltonization of the path ′ U. By Claim 4.5, there exists a path V between w and u in Qn constructed by Hamiltonization of the path V . By Claim 4.5, there exists a path R′ between r and s in Qn constructed by Hamiltonization of the path R. By removing the edges ec′ and u′t from H′ and adding the edges cc′, re, st, and uu′ we transform the cycle ′ ∗ ′ ′ ′ ′ ′ H into the path H = (bU c, c F0t, sR r, eF1u , uV w) between b and w in Qn that covers all coily 4-cubes and also the coiless 4-cubes of V (U) ∪ V (V ) ∪ V (R). Case 4: The vertex b′ is coiless and the vertex w′ is coily. This case is sym- metric to Case 2.

Part III: Extension of the path H∗ into a Hamiltonian path H between b and w in Qn − V (C). In the last part of the proof we connect Hamiltonian paths in every yet still uncovered coiless 4-cube to the path H∗ extending it to a Hamiltonian path H ∗ in Qn − V (C) between b and w. Notice that due to the way the path H was − constructed in previous two parts it holds that for every u ∈ {0, 1}n 4 either

53 Q4[u] is covered by H or V (Q4[u]) ∩ V (H) = ∅.

t

−→ Z

r = p0 d −→ Figure 5.11: A Hamiltonian path Z in Q3 from p0 to d with a fixed orientation.

− We choose a vertex d ∈ {0, 1}n 4 such that the parity of d is opposite to the parity of p0. By Proposition 3.5, there−→ exists a Hamiltonian path Z in Qn−4 between p0 and d, see Figure 5.11. Let Z denote a directed path between p0 and d obtained by giving every edge−→ of Z the same orientation starting at p0 and ending at d. We now travel along Z from p to d and for every edge (r, t) of −→ 0 Z we make sure that both 4-cubes Q [r] and Q [t] are covered by the path H. −→ 4 4 When considering an edge (r, t) of Z the following invariant holds:

the 4-cube Q4[r] is covered by H and after the assigned action is performed,

the 4-cube Q4[t] is covered by H as well. (∗)

We now show the inductive process which extends the path H∗ into a Hamil- tonian path in between b and w in Qn such that at the end of each inductive step the invariant (∗) holds. In the base of induction we can see the 4-cube Q4[p0] is ∗ already covered−→ by H . In the induction step we have a path H and a directed edge (r, t) of Z with Q4[r] covered by H. Then there are two cases to consider re- garding the 4-cube Q4[t]. After that Q4[t] will be covered by H as well, satisfying the invariant (∗). Case 1: The 4-cube Q4[t] is already covered by H. No action is needed as the invariant (∗) already holds. Case 2: The 4-cube Q4[t] is not covered by H, see Figure 5.12. Recall that in ′ Part I we have covered every coily 4-cube by H so Q4[t] must be coiless. In Part ∗ II we have covered some coiless 4-cubes by H and since Q4[t] is not covered by H it must be that V (Q4[t]) ∩ V (H) = ∅. Since V (Q4[r]) is covered by H we can ′ ′ choose an edge pq of H in Q4[r] such that pq is not an edge of C. Let p and q be the neighbors of p and q in Q4[t], respectively. By Proposition 3.5, there exists ′ ′ a Hamiltonian path T in Q4[t] between p and q . We join T to the path H by adding the edges pp′ and qq′ and removing the edge pq. Since T is a Hamiltonian path and H was extended by T the 4-cube Q4[t] is now covered by H and thus the invariant (∗) holds. −→ Since Z is a Hamiltonian path, the invariant guarantees that we have cov- ered by H all 4-cubes that were not visited by H∗ in Part II. Thus H is now a Hamiltonian path in Qn − V (C) between b and w.

Theorem 5.11 Let C be a k-coil in Qn such that n ≥ k ≥ 7. Then Qn − V (C) is Hamiltonian laceable.

54 Q4[t] T

p0 q0

Q [r] x 4 0 p q

H0

y C[p0] 0

Figure 5.12: A detailed view on the edge rt of Figure 5.11 as in Case 2 of the Part III of the proof of Lemma 5.10.

Proof If n = k = 7, then C is an isometric cycle in Q7. By Proposition 3.9, the graph Q7 − V (C) is Hamiltonian laceable. If n ≥ k ≥ 7 and n ≥ 8, then by Lemma 5.11 the graph Qn − V (C) is Hamiltonian laceable.

55 6. Lemma on n-dragons in small dimensions

We have already covered induced paths and cycles in hypercubes and their gen- eralizations. Now we briefly explore induced trees in hypercubes and their gen- eralization. An induced tree in a hypercube is called a dragon.

Definition 6.1 Let n and k be two integers such that n ≥ k ≥ 1.A k-dragon is ∈ a tree T in Qn such that for every u, v V (T ) it holds that if dQn (u, v) < k, then

dT (u, v) = dQn (u, v).

The following observation shows that every subpath of a k-dragon is a k-snake.

Observation 6.2 Let T be a k-dragon in Qn for n ≥ k ≥ 1. Then every subpath P of T is a k-snake in Qn.

Proof Let P be a subpath of T and let u, v be two vertices of P such that dP (u, v) < k. Since u, v are also the vertices of T it also must be dT (u, v) < k

and from the definition of a k-dragon we obtain dQn (u, v) = dT (u, v). As tree T does not contain cycles it must be also be dT (u, v) = dP (u, v).

The following observation shows that a 1-dragon is a tree in Qn, a 2-dragon is an induced tree in Qn (i.e. a dragon), and an n-dragon is an isometric tree in Qn.

Observation 6.3 Let T be a k-dragon in Qn for n ≥ k ≥ 1. Then, the following statements hold.

(a) If k = 1, then T is a tree in Qn.

(b) If k = 2, then T is an induced tree in Qn.

(c) If k = n, then T is an isometric tree in Qn.

Proof Let u and v be two vertices of T .

(a) If k = 1, then the condition dQn (u, v) < 1 holds only for identical vertices u = v of T . So there are no restrictions on the tree T and thus 1-dragons in Qn are ordinary trees in Qn.

(b) If k = 2, then the condition dQn (u, v) < 2 holds either for identical vertices u = v of T and as we know from (a) it imposes no restriction on T , or for vertices u, v ∈ V (T ) such that uv is an edge of Qn. So every two vertices of T that are adjacent in Qn must be also adjacent in T which is precisely the definition of an induced path in Qn. (c) Let k = n. By Observation 6.2, every subpath of an n-dragon is a n- snake, i.e. an isometric path in Qn. We know that if P is an isometric subpath of Qn, then no two distinct edges of P have the same direction. Since T is connected every two distinct edges of T can not have the same direction which is an equivalent definition of an isometric tree in Qn.

56 In my Bachelor thesis [32] I have already explored isometric trees in hyper- cubes, i.e. n-dragons. I have proved that if T is a balanced n-dragon in Qn where n ≥ 5 and if S is an almost-balanced m-dragon in Qm where m ≥ 6, then both graphs Qn − V (T ) and Qm − V (S) are Hamiltonian laceable. Both statements were proved by a double induction with the base of the induction proved only partially. Lemma 6.5 was just verified by a computer in [32] and here we prove it in the following section.

6.1 Proof of Lemma 6.5

Before we prove Lemma 6.5 we need a very specific lemma that is proved by listing every needed Hamiltonian path.

0 1 Q4 Q4 B4 u1 u w5 3 A3 B5 P 1

0 w1 P b4 x3 b2 w3 A5

B6

u2 x1 b0 A4 B2

A6 A2 A1 B3 x2 B1 v y

0 Figure 6.1: The first edge of the path H (dashed blue edges in Q4 and the last 1 edge cw of path H (dashed blue edges in Q4) in Case 3 in the proof of Lemma 6.5. 0 1 Note that not all edges between Q4 and Q4 are depicted.

Lemma 6.4 Let U = {u1, u2, u3} ⊆ V (Q4), F = {A1,A2,A3,A4,A5,A6} ⊆ E(Q4) and v, b0, w1, b4 ∈ V (Q4) as in Figure 6.1. Then for every u ∈ U and every e ∈ F there exists a Hamiltonian path between u and v in Q4−({b0, w1, b4}∪V (e)).

Proof In Figure 6.5 we present all eighteen Hamiltonian paths between u and 0 v in Q4 − (V (P ) ∪ V (e)) for every u ∈ U and every e ∈ F . The figure can be found at the end of this section.

T2 w1 b2 b0 w3

b4 w5

Figure 6.2: Tree T2 used in Lemma 6.5.

57 Lemma 6.5 Let T2 be the tree on Figure 6.2 isometrically embedded in Q5. Then Q5 − V (T2) is Hamiltonian laceable.

Proof Let b ∈ B5 \{b0, b2, b4} and w ∈ W5 \{w1, w3, w5}. We show an existence 0 of a Hamiltonian path H between b and w in Q5 − V (T2). Let P = (b0, w1, b4) 1 and P = (w3, b2, w5) be the paths of T2. We denote the direction of w1b2 by i, then the edges of direction i split Q5 into two subcubes. We denote the subcube 0 i,0 1 i,1 that contains P by Q4 and the subcube that contains P by Q4 . We fix the direction i. Then there are three cases to consider regarding the position of b and w.

0 1 0 1 Q4 Q4 Q4 Q4 w b b

x y 0 H1 w H 0 H0 H1 H1 v H1 u d c 1 b4 w5 b4 w5 P 0 P 1 P 0 P 1

b0 w1 w3 b0 w1 w3 T2 b2 T2 b2

Figure 6.3: Cases 1 and 2 in the proof of Lemma 6.5.

0 1 Case 1: The vertex w is in Q4 and the vertex b is in Q4, see Figure 6.3. We choose an edge uv of direction i distinct from w1b2 such that u ∈ W5 \{w} is 0 ∈ \{ } 1 3 − ≥ in Q4 and v B5 b is in Q4. Such edge uv exists since 2 3 1. By Proposition 3.7, there exists a Hamiltonian path H0 between w and u 0 − 0 1 − 1 in Q4 V (P ) and a Hamiltonian path H1 between v and b in Q4 V (P ). By joining these paths we obtain a Hamiltonian path H = (bH1v, uH0w) between b and w in Q5 − V (T2). 1 Case 2: The vertices b, w are in the same subcube; say in Q4, see Figure 6.3. ∈ 1 Let c B5 be a vertex in Q4 different from both b and b2. By Proposition 3.7, 1 − 1 there exists a Hamiltonian path H1 between b and c in Q4 V (P ). Let y be the neighbor of w on the path H such that y is closer to b on the path H1 than w is. Note that it may be y = b. Then the edge wy splits the path H1 into 0 1 the subpaths H1 between b and y and H1 between w and c. Let us denote the 0 neighbors of c and y in Q4 by d and x, respectively. By Proposition 3.7, there exists a Hamiltonian path H0 between x and d 0 − 0 0 1 in Q4 V (P ). We join the path H0 with the paths H1 and H1 by removing the edge yw and adding the edges xy and cd. That is, we obtain a Hamiltonian 0 1 − path H = (bH1 y, xH0d, cH1 w) between b and w in Q5 V (T2). 0 1 Case 3: The vertex b is in Q4 and the vertex w is in Q4, see Figure 6.4. Let ′ d be the neighbor of b such that the edge bd is one of the edges A0, B0, C0, A0, ′ ′ B0, C0 in Figure 6.1 and let c be the neighbor of w such that the edge cw is one ′ ′ ′ of the edges A1, B1, C1, A1, B1, C1 in Figure 6.1. Then bd is the first edge of the

58 desired Hamiltonian path H and cw is the last edge of H. Let vy be the edge in Figure 6.1. Notice that v ≠ d and y ≠ c. 0 1 We denote the neighbor of c in Q4 by u and the neighbor of d in Q4 by x. Note that u ∈ {u1, u2, u3} and x ∈ {x1, x2, x3}. By Lemma 6.4, there exists a 0 − 0 ∪ Hamiltonian path H0 between u and v in Q4 (V (P ) V (bd)). Notice, that there 0 1 exists an isomorphism from Q4 to Q4 that maps the vertices u1, u2, u3, v, b0, w1, b4 on the vertices x1, x2, x3, y, w3, b2, w5 and the edges A1, A2, A3, A4, A5, A6 on the edges B1, B2, B3, B4, B5, B6, respectively. Thus by Lemma 6.4, there also exists 1 − 1 ∪ a Hamiltonian path H1 between x and y in Q4 (V (P ) V (cw)). We join the paths H0 and H1 by adding the edge vy and join this path with the vertices b and w by adding the edges bd, dx, uc, cw. We have obtained the Hamiltonian path H = (b, d, xH1y, vH0u, c, w) between b and w in Q5 − V (T2).

0 1 Q4 Q4 b d x w

u c H0 H1

v y

b4 w5 P 0 P 1

b0 w1 w3 T2 b2

Figure 6.4: Case 3 in the proof of Lemma 6.5.

59 u1 u3

w1 b4 w1 b4 w1 b4

u b0 2 b0 b0 A1 A1 A1 v v v u1 u1

w1 b4 w1 b4 w1 b4

u2

b0 b0 b0

A2 A2 A2 v v v u1 u3

A3 A3 A3 w1 b4 w1 b4 w1 b4

u2

b0 b0 b0

v v v u1 u3

w1 b4 w1 b4 w1 b4

u2 b0 A3 b0 A3 b0 A3

v v v u1 u3

w1 b4 w1 b4 w1 b4

A5 A5 A5 u2

b0 b0 b0

v v v u1 u3

w1 b4 w1 b4 w1 b4

b0 u2 b0 b0 A6 A6 A6 v v v

Figure 6.5: Hamiltonian paths (thick green) between u ∈ U and v in Q4 − (V (P 0) ∪ V (e)) for every vertex u ∈ U and every edge e ∈ F (dashed blue) where U = {u1, u2, u3} ⊆ V (Q4) and F = {A1,A2,A3,A4,A5,A6} ⊆ E(Q4). This proves Lemma 6.4. 60 7. Conclusion

Here we summarize the results we have obtained, discuss how we think they can be improved, and present some open problems. We have focused on avoiding k-snakes, k-coils, and n-dragons by a Hamilto- nian path with prescribed endvertices. In Chapter 4 we proved Theorem 4.15 stating that if S is a k-snake in Qn where n ≥ k ≥ 6, then Qn − V (S) is Hamilto- nian laceable. In Chapter 5 we proved Theorem 5.11 stating that if C is a k-coil in Qn where n ≥ k ≥ 7, then Qn − V (C) is Hamiltonian laceable. By Equation 3.3, the length of a k-coil may even be exponential with n for a fixed k. In Chapter 6 we introduced the notion of a dragon and a k-dragon and we also proved Lemma 6.5. By proving this lemma, we have finished the proof from my Bachelor thesis [32] stating that if T is a balanced n-dragon in Qn where n ≥ 5 and if S is an almost-balanced m-dragon in Qm where m ≥ 6, then both graphs Qn − V (T ) and Qm − V (S) are Hamiltonian laceable. Now we discuss in detail how we can improve the results above. We present some ideas that we believe can in most (or all) cases improve the bounds on n and k. But it is necessary to thoroughly verify them before they can be used with certainty. We start with Theorem 4.15 regarding k-snakes. Its proof mainly consists of proving Lemma 4.13 and Lemma 4.14 which proofs are divided into Part I, Part II, and Part III.

Corollary 7.1 Let S be a k-snake in Qn where n ≥ k ≥ 6. Then there exists a Hamiltonian path in Qn − V (S).

This corollary does not require a Hamiltonian path with prescribed vertices. It can be proved separately only by using a combination of Part I and Part III of the proofs of Lemma 4.13 and Lemma 4.14. Part II of the proof is not needed and neither is Observation 4.7. Thus we can improve the bound on k and show that if S is a k-snake in Qn where n ≥ k ≥ 5, then there exists a Hamiltonian path in Qn − V (S). Q − V (P ) w0 3 2 x w Q3 − V (P3)

w3 b2 w1 b P2

P3 b0 w1 b2

w b0

′ Figure 7.1: The nonexistence of Hamiltonian paths between w and w in Q3 − ′ V (P2) on the left (due to the common neighbor x of w and w having the degree two) and between b and w is Q3 − V (P3) on the right.

61 Recall that in the proofs of Lemma 4.13 and Lemma 4.14 we divide Qn into 4- cubes. Can we split Qn into 3-cubes instead while still proving both lemmas and possibly improving the bounds on n and k? At first the answer seems negative. If P2 is an isometric path of length 2 in Q3 and P3 an isometric path of length 3 in Q3, then neither Q3 − V (P2), or Q3 − V (P3) is Hamiltonian laceable, see Figure 7.1. Also the number of vertices in Q3 − V (P2) and Q3 − V (P3) seems to be too low for our estimates in Part I. But the counterexamples in Figure 7.1 are unique. Also by further extending Observation 4.12 a pattern of lengths of isometric paths in snaky 3-cubes starts to emerge. So instead of rough estimates in Part I we can choose vertices xi and yi in snaky 3-cubes more carefully. We believe that by replacing 4-cubes by 3-cubes we can improve the bounds on k and n in Corollary 7.1 and maybe even in Theorem 4.15 itself. Also note that when dividing Qn into 4-cubes in Section 4.1 we fix the first n−4 dimensions. But the proof of Theorem 4.15 does not rely on the dimensions we choose so they can be arbitrary. By specifying the cutting dimensions it is possible to, for example, avoid some unpleasant cases. Now we focus on Theorem 5.11 regarding k-coils. Its proof consists mainly of proving Lemma 5.10 which proof is also divided into Part I, Part II, and Part III.

Corollary 7.2 Let C be a k-coil in Qn where n ≥ k ≥ 7. Then there exists a Hamiltonian path in Qn − V (C).

Once again by proving this corollary separately using only a combination of Part I and Part III of the proof of Lemma 5.10, the only observation we need is Observation 5.3. So we can show that if C is a k-coil in Qn where n ≥ k ≥ 5, then there exists a Hamiltonian path in Qn − V (C). The same techniques that we suggested to improve the bounds on n and k in theorems considering k-snakes like replacing 4-cubes with 3-cubes, extending Observation 5.9, and specifying the cutting dimensions can be used with k-coils as well. Finally, we shift our focus to Chapter 6 in which we have introduced k-dragons. We believe that it is worth to study their properties and whether they can be avoided by a Hamiltonian path. Unfortunately, our method that we used in the proofs which focused on avoiding k-snakes and k-coils seems to fail with k- dragons. The reason is that in order to even consider avoiding k-dragons by a Hamiltonian path we have to focus only on balanced and almost-balanced k- dragons. When dividing Qn into l-cubes for l ≥ 1 a subgraph of a k-dragon in all l-cubes does not have to be balanced or almost-balanced. This problem does not seem to disappear even when we try to limit the maximum degree of a k-dragon. Thus the issue of Hamiltonicity of a hypercube Qn without a k-dragon for n > k ≥ 1 remains open.

62 Bibliography

[1] N. Castañeda and I. Gotchev. Proof of Locke’s conjecture (submitted), 2009. Prof. Gotchev’s Home Page http://www.math.ccsu.edu/gotchev/ [cit- ed 10.05.2016].

[2] N. Castañeda, I. Gotchev, and F. Latour. Hamiltonian laceability of hy- percubes with faults of charge one. Congressus Numerantium, 198:15–30, 2009.

[3] N. Castañeda, I. Gotchev, and F. Latour. Path coverings with prescribed ends of the n-dimensional binary hypercube. Congressus Numerantium, 197:193 – 205, 2009.

[4] N. Castañeda and I. S. Gotchev. Path coverings with prescribed ends in faulty hypercubes. Graphs and Combinatorics, 31(4):833–869, 2014.

[5] N. Castañeda, I. S. Gotchev, F. Latour, and V. Gochev. On two conjectures about faulty hypercubes,. Graph Theory Notes N. Y., LVII:34–38, 2009.

[6] C.-T. Chang, C.-Y. Chang, and J.-P. Sheu. Bluecube: constructing a hy- percube parallel computing and communication environment over bluetooth radio system. In Parallel Processing, pages 447–454, 2003.

[7] Y. Chebiryak and D. Kroening. An efficient sat encoding of circuit codes. In 2008 International Symposium on Information Theory and its Applications, 2008.

[8] D. W. Davies. Longest “separated” paths and loops in an n cube. IEEE Transactions on Electronic Computers, EC-14(2):261–261, 1965.

[9] P. Diaz-Gomez and D. Hougen. Genetic algorithms for hunting snakes in hypercubes: Fitness function analysis and open questions. In Software En- gineering, Artificial Intelligence, Networking, and Parallel/Distributed Com- puting, pages 389–394, 2006.

[10] D. Ž. Djoković. Distance-preserving subgraphs of hypercubes. Journal of Combinatorial Theory, Series B, 14(3):263–267, 1973.

[11] R. J. Douglas. Some results on the maximum length of circuits of spread k in the d-cube. Journal of Combinatorial Theory, 6(4):323 – 339, 1969.

[12] T. Dvořák. Hamiltonian cycles with prescribed edges in hypercubes. SIAM J. Discret. Math., 19(1):135–144, 2005.

[13] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Co., New York, NY, USA, 1979.

[14] R. Graham and H. Pollak. On the addressing problem for loop-switching. Bell Syst Tech J, 50(8):2495–2519, 1971.

63 [15] F. Gray. Pulse code communication, 1953. US Patent 2,632,058.

[16] P. Gregor and R. Škrekovski. Long cycles in hypercubes with distant faulty vertices. Discrete Mathematics and Theoretical Computer Science, 11(1):185–198, 2009.

[17] R. Hammack, W. Imrich, and S. Klavžar. Handbook of product graphs. CRC press, 2011.

[18] H. Harborth and A. Kemnitz. Hamiltonicity in vertex deleted hypercubes. Congressus Numerantium, 195:33–47, 2009.

[19] I. Havel. On hamiltonian circuits and spanning trees of hypercubes. Časopis pro pěstování matematiky, 109(2):135–152, 1984.

[20] S. Hood, D. Recoskie, J. Sawada, and D. Wong. Snakes, coils, and single- track circuit codes with spread k. Journal of Combinatorial Optimization, pages 1–21, 2013.

[21] W. H. Kautz. Unit-distance error-checking codes. Electronic Computers, IRE Transactions on, EC-7(2):179–180, 1958.

[22] D. Kinny. Monte-carlo search for snakes and coils. In Multi-disciplinary Trends in Artificial Intelligence, volume 7694 of Lecture Notes in Computer Science, pages 271–283. Springer Berlin Heidelberg, 2012.

[23] V. Klee. What is the maximum length of a d-dimensional snake? The American Mathematical Monthly, 77(1):pp. 63–65, 1970.

[24] K. J. Kochut. Snake-in-the-box codes for dimension 7. Journal of Combina- torial Mathematics and Combinatorial Computations, 20:20–175, 1996.

[25] I. Leader and E. Long. Long geodesics in subgraphs of the cube. Discrete Mathematics, 326(1):29–33, 2014.

[26] F. T. Leighton. Introduction to parallel algorithms and architectures: array, trees, hypercubes. Morgan Kaufmann Publishers Inc., 1991.

[27] M. Lewinter and W. Widulski. Hyper-hamilton laceable and caterpillar- spannable product graphs. Computers & Mathematics with Applications, 34(11):99–104, 1997.

[28] S. C. Locke and R. Stong. Spanning cycles in hypercubes: 10892. American Mathematical Monthly, 110(5):440–441, 2003.

[29] J. Matoušek and J. Nešetřil. Invitation to Discrete Mathematics. Oxford University Press, 1998.

[30] B. Parhami. Introduction to Parallel Processing: Algorithms and Architec- tures. Kluwer Academic Publishers, Norwell, MA, USA, 1999.

64 [31] W. D. Potter, R. W. Robinson, J. A. Miller, K. J. Kochut, and D. Z. Redys. Using the genetic algorithm to find snake-in-the-box codes. In Proceedings of the 7th International Conference on Industrial and Engineering Applications of Artificial Intelligence and Expert Systems, IEA/AIE ’94, pages 421–426, Newark, NJ, USA, 1994. Gordon and Breach Science Publishers, Inc.

[32] D. Pěgřímek. Hamiltonian cycles in hypercubes with removed vertices. Bach- elor thesis, Charles University in Prague, 2013.

[33] D. Pěgřímek and P. Gregor. Hamiltonian laceability of hypercubes without isometric subgraphs. Graph and Combinatorics, 2015. (submitted).

[34] Y. Saad and M. H. Schultz. Topological properties of hypercubes. IEEE Trans. Comput., 37(7):867–872, 1988.

[35] C. Savage. A survey of combinatorial gray codes. SIAM Review, 39(4):605– 629, 1997.

[36] M. Schlosser, M. Sintek, S. Decker, and W. Nejdl. Agents and Peer-to- Peer Computing: First International Workshop, AP2PC 2002 Bologna, Italy, pages 112–124. Springer Berlin Heidelberg, 2003.

[37] G. Simmons. Almost all n-dimensional rectangular lattices are hamilton– laceable. In The 9th Southeastern Conf. on Combinatoric Graph Theory and Computing, Boca Raton, 1977.

[38] R. C. Singleton. Generalized snake-in-the-box codes. Electronic Computers, IEEE Transactions on Electronic Computers, EC-15(4):596–602, 1966.

[39] C.-M. Sun and Y.-D. Jou. Hamiltonian laceability of hypercubes with some faulty elements. In Proceedings of the 2009 IEEE International Conference on Networking, Sensing and Control, pages 626–630, 2009.

[40] A. Toce, A. Mowshowitz, and P. Stone. Hyperd: A hypercube topology for dynamic distributed federated databases. In 5th Annual Conference of the International Technology Alliance (ACITA), 2011.

[41] E. Wynn. Constructing circuit codes by permuting initial sequences. CoRR, abs/1201.1647.

[42] P. R. Östergard and V. H. Pettersson. On the maximum length of coil-in- the-box codes in dimension 8. Discrete Applied Mathematics, 179(0):193 – 200, 2014.

65