Abstract 1 Introduction 2 Preliminaries 3 Overview of the proof for the 𝟐×𝟐×𝟐 4 Hamilton Laceability of 𝑮𝗥,𝗨 5 Extending Laceability to 𝑮𝓡 References Appendix A GAP Code for Computational Checks

Solving Small Rubik’s Cubes as Slowly as Possible

Jenny Quan ORCID Carnegie Mellon University, Pittsburgh, PA, USA Noah Kim ORCID Carnegie Mellon University, Pittsburgh, PA, USA Bernardo Subercaseaux ORCID Carnegie Mellon University, Pittsburgh, PA, USA John Mackey ORCID Carnegie Mellon University, Pittsburgh, PA, USA
Abstract

We study, for different Rubik’s puzzles, whether from any starting state one can solve the puzzle as slowly as possible, visiting every reachable state exactly once before reaching the solved configuration. This question corresponds to the existence of Hamiltonian paths (ending in the solved state) in the Cayley graphs associated with these puzzles. A major conjecture attributed to Lovász is that every Cayley graph has a Hamiltonian path. An even stronger version of the conjecture, considered by Dupuis and Wagon (2015) and Gregor et al. (2024), is that every Cayley graph of degree at least 3 is either bipartite and has Hamiltonian paths between any pair of vertices on opposite parts, or is non-bipartite and has Hamiltonian paths between any pair of vertices. Our study of slowly solving Rubik’s puzzles amounts to studying this Strong Lovász Conjecture in their respective Cayley graphs. We first verify the Strong Lovász Conjecture computationally for small Rubik’s puzzles like the 1×2×3 or 1×3×3 cuboids, which have under 200 states. This approach, however, becomes infeasible for the 2×2×2, which has over 3.6 million states. Our main result is then showing that the Strong Lovász Conjecture holds for the 2×2×2 cube, using a careful graph-theoretic construction based on the subgroup induced by the 𝖱 and 𝖴 turns.

Keywords and phrases:
Hamilton connectivity, Rubik’s Cube, Finite group theory
Funding:
Bernardo Subercaseaux: supported by NSF grant DMS-2434625.
Copyright and License:
[Uncaptioned image] © Jenny Quan, Noah Kim, Bernardo Subercaseaux, and John Mackey; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Paths and connectivity problems
Editor:
John Iacono

1 Introduction

Little Ernie, a clever Hungarian boy, often gets reprimanded at the dinner table by his mom for playing with the Rubik’s cube. His mom, fed up one day with the constant noise of the cube, tells Ernie “It’s over; this will be your last solve”. Clever Ernie, in turn, decides to maximize his fun by taking as many steps as possible in what will be his final solve. But how many steps can he prolong the solve for? While he could obviously keep turning a single face forever, without making any progress, this wouldn’t be any fun for Ernie. Moreover, Ernie’s mom is no fool, and would realize that Ernie has had the cube in the exact same state before, which could end up with tragically scattered cube pieces all over the floor.

Being Hungarian, little Ernie has a good command of combinatorics and quickly realizes that his problem is equivalent to finding the longest path from the starting scrambled state of the cube to the solved state, and thus ideally, a Hamiltonian path. In this paper, we address the mathematical question at the core of Ernie’s dilemma: is there a Hamiltonian path from any starting state that ends in the solved state?

While any 2×2×2 cube can be solved in at most 14 moves (or 11 if we count 180 moves as one) [27], we will show in this paper that Ernie can succeed in solving such a cube, without repeating any state, for at least 3,674,158 steps.

This seemingly innocent question concerning Rubik’s puzzles is a concrete instance of a much more general problem in graph theory: understanding the relationship between symmetry and connectivity. Concretely, a famous open question of Lovász [16] is whether every vertex-transitive graph has a Hamiltonian path. A slightly weaker variant, also referred to as Lovász conjecture, is whether every Cayley graph has a Hamiltonian path. Curran and Gallian have written a nice, albeit somewhat old, survey on Hamiltonicity properties of Cayley graphs [6].

In this article, we are interested in the much stronger notion of Hamilton-connectivity: a graph G is said to be Hamilton-connected if for every pair of vertices u,vV(G) there is a Hamiltonian path from u to v. Unfortunately, bipartite graphs cannot be Hamilton-connected for a rather trivial parity reason (illustrated in Figure 1): all Hamiltonian paths of a graph on n vertices have n1 edges, and thus if n1 is odd, then all Hamiltonian paths end in the opposite part of the graph they started from. If n1 is even, then n is odd, and thus the two parts of the graph must have different sizes. But then it is not possible to have a Hamiltonian path that starts in the smaller part.

(a) Even n. Endpoints of Hamiltonian paths must be on opposite sides.
(b) Odd n. Hamiltonian paths cannot start on the smaller side.
Figure 1: Illustration of the impossibility of Hamilton-connectivity for bipartite graphs.

This motivates the notion of Hamilton-laceability: a bipartite graph (AB,E) is said to be Hamilton-laceable if for every pair of vertices aA and bB there is a Hamiltonian path between a and b. To avoid having to case on whether a graph is bipartite or not, we consider the following notion.

Definition 1 (H-connected).

A graph G is said to be H-connected if it is either Hamilton-connected, or bipartite and Hamilton-laceable.

We can now state the conjecture at the core of our work, which is a slight variant of the “Strong Lovász Conjecture” [11], considered earlier by Dupuis and Wagon [9].

Conjecture 2.

Every Cayley graph of degree at least 3 is H-connected.

Naturally, in the statement above, the degree of the graph refers to the degree of any of its vertices, since Cayley graphs are regular (see Definition 4). The purpose of the mild degree condition is simply to avoid cycles as a trivial exception.

Conjecture 2 is known to hold for Cayley graphs arising from some families of groups, such as Abelian groups [5], Hamiltonian groups [1], groups of order less than 48 [29], or groups generated by transpositions [2]. Unfortunately, none of these classes encompasses the graphs arising from Rubik’s cubes (see Section 2).

Our main contribution is thus to study Conjecture 2 in the context of Rubik’s cubes, where it corresponds to the possibility of solving cubes as slowly as possible. Our main result is the following (stated informally since a full statement requires defining the exact groups and generators of the Rubik’s cubes, as we do in Section 2).

Theorem 3 (Informal).

The Cayley graphs of the 1×2×3, 1×3×3, 1×2×4,1×2×5 and 2×2×2 Rubik’s cubes are all H-connected.

Related Work.

For a general reference on the mathematical treatment of Rubik’s cubes (and other puzzles) as groups, we direct the reader to the nice book of Mulholland [18], or his interactive notes [19]. The most studied question regarding Rubik’s cube puzzles is that of “God’s number”, corresponding to the diameter of the associated Cayley graph [17, 14, 13, 25, 24], with the most prominent result being the fact that in the Half Turn Metric, where 180 face rotations count as one move, the diameter of the 3×3×3 cube is 20 [25]. The asymptotic diameter of an n×n×n cube is known to be Θ(n2lgn) [7], and optimal solutions from a given position are known to be NP-hard to compute [8]. Norskog has found Hamiltonian cycles on both the 2×2×2 and 3×3×3 puzzles [21, 20]. It is worth clarifying that finding a single Hamiltonian cycle is much weaker than Hamilton-connectivity or Hamilton-laceability. For instance, while a cycle graph Cn trivially has a Hamiltonian cycle, it does not have Hamiltonian paths between vertices that are not adjacent.

2 Preliminaries

We will treat groups G=(A,) in multiplicative notation, using ab to denote ab. Recall that, given a subset SA of the elements of group G, the subgroup generated by S, denoted S, is the subgroup of all elements that can be expressed as a combinations of elements of S and their inverses, or more formally, as finite products of the form s1σ1s2σ2skσk with σi{1,1}. When S=G, we say that S generates G, or that S is a set of generators for G.

The group of the 2×2×2 Rubik’s cube, which we will denote , can be generated by just three moves: 𝖱 (rotating the right face clockwise by 90), 𝖴 (rotating the top face clockwise by 90) and 𝖥 (rotating the front face clockwise by 90). By labeling the 24 stickers as shown in Figure 2, we think of this group as a subgroup of S24, with the following generators:

𝖱 =(2 19 22 10)(4 17 24 12)(13 14 16 15)
𝖴 =(1 2 4 3)(5 17 13 9)(6 18 14 10)
𝖥 =(3 13 22 8)(4 15 21 6)(9 10 12 11).

In other words, the formal definition of is simply 𝖱,𝖴,𝖥. It is worth clarifying right away that, while in certain contexts it is convenient to define 180 turns as a single move (this is known as the Half Turn Metric), for our purposes of visiting each state exactly once, we believe it makes more sense to consider 90 turns only. The reason is that, when performing a 180 turn, the cube must still go momentarily through the intermediate state corresponding to a 90 turn, which we would want to count as a visited state.

Figure 2: Illustration of the 2×2×2 Rubik’s cube with a labeling of its stickers, and the three basic moves 𝖱,𝖴,𝖥.

Our treatment of the cube is mostly graph theoretic. Intuitively, the graph of a Rubik’s puzzle has all the possible configurations of the puzzle as vertices, and there are edges between configurations that are one move away.

Definition 4 (Cayley Graph).

Given a group Γ and a set of generators SΓ, the Cayley graph Cay(Γ,S) is the undirected graph whose vertex set is Γ and whose edges are the sets {a,b} such that a1b(SS1).

Let G denote Cay(,{𝖱,𝖴,𝖥}), and note that Definition 4 implies that G is a 6-regular graph, since for each vertex (i.e., puzzle states) there are 6 possible edges; 3 stemming from {𝖱,𝖴,𝖥}, and 3 from their inverses {𝖱1,𝖴1,𝖥1}. As it is common in the Rubik’s cube literature, we will use notation 𝖱 to denote 𝖱1, and analogously for 𝖴 and 𝖥.

Given a graph G=(V,E), a graph automorphism is a function φ:VV such that for every pair of vertices u,vV, it holds that {u,v}E if and only if {φ(u),φ(v)}E.

Definition 5 (Vertex transitivity).

A graph G=(V,E) is said to be vertex transitive if for every pair of vertices u,vV, there is an automorphism φ of G such that φ(u)=v.

We will use throughout a standard fact: Cayley graphs are always vertex transitive.

Lemma 6.

For any group Γ, and generating set SΓ, the Cayley graph Cay(Γ,S) is vertex transitive.

To prove Lemma 6 it suffices to consider, for every pair of vertices u,v, to consider the automorphism xvu1x (see [17, Lemma 3] for a proof that matches our notation).

We have therefore that G is vertex transitive. We will next see that G is bipartite, which requires introducing some notation regarding permutations.

Recall that the parity of a permutation σ:{1,,n}{1,,n} corresponds to the parity of the number of inversions (i.e., pairs i,j such that i<j but σ(i)>σ(j)). For example, (2,1,4,3) is an even permutation since it has 2 inversions, whereas (2,3,4,1) is odd. A folklore fact about the parity of permutations is that a permutation is odd if and only if it consists of an odd number of cycles of even length [26, §1]. Therefore, the permutations 𝖱,𝖴,𝖥 and their inverses, which consist of 3 cycles of length 4, are odd permutations. It follows that G is bipartite, with the two parts being O:={vV(G):v is odd}, and E:={vV(G):v is even}, as applying any move (an odd permutation) to an element of O yields an element of E, and viceversa.

Small Puzzles

We start by exploring the possibilities and limits of computational methods to directly confirm Conjecture 2 in Rubik’s puzzles with relatively few states. First, we consider the 1×2×3 cuboid (illustrated in Figure 3(a)), which has only 48 states. Let us denote its group 1×2×3. We consider its associated graph Cay(1×2×3,{𝖱,𝖴,𝖣}), illustrated in Figure 3(b), where the moves 𝖱,𝖴,𝖣 are defined in the natural way by 180 twists of the right, top, and bottom face, respectively. Similarly, we consider the 1×3×3 cuboid, which has 192 states under its natural 4 generators, and the 1×2×4 cuboid, with 144 states under its natural 5 generators (left, right, top, bottom, and one of the two intermediate slices), and finally, we consider as well the 1×2×5, with 1152 states, as a stress test.

(a) Net of the 1×2×3 cuboid. Moves are defined as for the 2×2×2 cube, and thus we omit enumerating stickers.
(b) The Cayley graph of the 1×2×3 cuboid. Edges corresponding to 𝖱 are colored red, while those corresponding to 𝖴 and 𝖣 are colored black and green, respectively. A Hamiltonian path s1246t is highlighted.

Since the Hamiltonian path problem is NP-complete, we opted for SAT solving (for a general reference, see [4]). There is a body of research on different SAT encodings and techniques to deal with Hamiltonian paths or cycles [22, 28, 31, 30, 12]. For simplicity, we used the incremental approach of [28]. A summary of results is presented in Table 1. We used the CaDiCaL solver [3] due to its incremental interface, running experiments on a personal computer (MacBook Pro M1 2020). As these graphs are bipartite and vertex-transitive, we considered an arbitrary vertex s and found Hamiltonian paths ending in each state t on the opposite part of s; Table 1 displays the maximum, minimum, and average runtime over the choices of t. In a nutshell, satisfiability solving allows us to efficiently confirm the first part of Theorem 3, but it already reaches its limit around the 1×2×5 cuboid, implying the 2×2×2 puzzle requires different techniques. All our code, using the PySat library [15], is publicly available at https://github.com/bsubercaseaux/rubik-hamiltonian/.

Table 1: Summary of computational results.
Cuboid dims. Bipartite |V| |E| Avg ± stddev [s] Max [s] Min [s] Total [s]
1×2×3 Yes 48 72 0.005±0.007 0.028 0.001 0.12
1×2×4 Yes 144 288 0.113±0.587 4.365 0.008 8.13
1×3×3 Yes 192 384 0.024±0.023 0.209 0.011 2.33
1×2×5 Yes 1152 2880 1.438±3.529 57.143 0.319 828.11

3 Overview of the proof for the 𝟐×𝟐×𝟐

Recall that G denotes the Cayley graph for the 2×2×2 Rubik’s cube. As this graph contains over 3.6 million nodes, the previous SAT-solving technique for proving Hamilton laceability becomes infeasible. We will instead construct Hamiltonian paths using a group-theoretic approach. Our construction is based on considering the subgroup 𝖱,𝖴, which has 29,160 elements, and proving:

  1. 1.

    (Subgroup Laceability) that its associated Cayley graph G𝖱,𝖴:=Cay(𝖱,𝖴,{𝖱,𝖴}) is Hamilton laceable, and

  2. 2.

    (Cycle stitching) that we can “stitch together” parts of the Hamiltonian paths from the different cosets of 𝖱,𝖴 to form Hamiltonian paths for G. Figure 5 illustrates this part.

Let us first elaborate on the subgroup laceability step. Since G𝖱,𝖴 is a Cayley graph and thus vertex transitive, it will suffice to show the existence of a path from an arbitrary odd aV(G𝖱,𝖴) to 1 (the solved state, which is also the identity element). In order to do this, we start by showing that there exists an “almost Hamiltonian” path π2 between a and 1, which does not repeat vertices but might not visit certain structured subsets of the vertices. Our strategy will then be to extend these almost Hamiltonian paths into true Hamiltonian paths, in the way illustrated by Figure 4.

To state the sufficient condition for the extendability of these π2 paths, let us say that a set of two vertices forms a couple if it is of the form {b,b𝖴}, where b is even. Then, the condition for a path π2 to be extendable into a Hamiltonian path is that for every such couple of vertices in G𝖱,𝖴,

  1. 1.

    Either b and b𝖴 are both in π2, or they are both not in π2.

  2. 2.

    If the vertices of the couple {b,b𝖴} are not in π2, then the vertices b𝖴 and b𝖴𝖴 are both in π2, and {b𝖴,b𝖴𝖴} is an edge in π2.

Figure 4: Intuitively, a path π2 for G𝖱,𝖴 whose properties are as described Section 3 can be modified to visit every vertex, giving us a Hamiltonian path for G𝖱,𝖴.

Figure 4 shows how, given a path π2 with these properties, we can intuitively extend π2 to form a Hamiltonian path on G𝖱,𝖴. However, it is not immediately obvious that such a π2 exists, so we begin by constructing an “almost-almost Hamiltonian” path π1 whose properties are a relaxed version of those of π2, and from which we will obtain π2 later on. We partition V(G𝖱,𝖴) into cycles, and given a vertex aV(G𝖱,𝖴), let [a] denote the cycle-part to which a belongs; a similar cycle decomposition for the 1×2×3 cuboid is displayed in Figure 3(b). We want π1 to have the following properties: for any couple of vertices {b,b𝖴},

  1. 1.

    Either b and b𝖴 are both in π1, or they are both not in π1.

  2. 2.

    If the vertices of the couple {b,b𝖴} are not in π1, then at least one of the following is true.

    1. (a)

      The vertices b𝖴 and b𝖴𝖴 are both in π1, and {b𝖴,b𝖴𝖴} is an edge in π1.

    2. (b)

      None of the vertices in [b] are visited by π1.

    3. (c)

      None of the vertices in [b𝖴] are visited by π1.

  3. 3.

    Either π1 visits all cycle-parts at least once, or it is possible to augment π1 to form a new path, π1, such that the set of cycle-parts visited by π1 is a strict superset of the set of cycle-parts visited by π1.

Once we have a π1 that satisfies the above properties, we will argue that we can create a path π2 that satisfies the properties for π1 and also visits every cycle, which will be enough to ensure π2 is indeed almost Hamiltonian.

(a) Hamiltonian paths within cosets.

(b) Hamiltonian path in the quotient graph.
(c) Stitched Hamiltonian path.
Figure 5: Schematic “stitching” of Hamiltonian paths across subgroup cosets.

Once proved that G𝖱,𝖴 is Hamilton laceable, we will consider the quotient graph, which describes how the different cosets of the subgroup 𝖱,𝖴 are related. It turns out that this quotient graph is very dense, which allows us to use a classic result of Ore [23] to argue it must be Hamilton connected. We finish the proof by using the Hamilton connectedness of the quotient graph will allow us to thread the Hamiltonian paths from the different cosets into one large Hamiltonian path, as illustrated in Figure 5.

4 Hamilton Laceability of 𝑮𝗥,𝗨

4.1 Partitioning 𝑮𝗥,𝗨 into cycles

We begin by formally defining the cycle-partition. Let a,bV(G𝖱,𝖴). We say that ab if either:

  1. 1.

    a is even and b=a(𝖱𝖴)k𝖱σ for some k,σ{0,1}

  2. 2.

    a is odd and b=a𝖴(𝖱𝖴)k𝖱σ for some k,σ{0,1}

We will next show that is an equivalence relation, and intuitively, its equivalence classes will correspond to the cycle of vertices visited by repeating the sequence 𝖱𝖴 an arbitrary number of times.

Lemma 7.

The relation is an equivalence relation.

Proof.

We make use of the fact that a(𝖱𝖴)15=a. For even a, we observe that a=a(𝖱𝖴)15𝖱0 and for odd a, a=a𝖴(𝖱𝖴)14𝖱=a(𝖱𝖴)15. This suffices to show reflexivity.

For symmetry, suppose ab. If a is even, then b=a(𝖱𝖴)k𝖱σ implies

b𝖴σ(𝖱𝖴)15σk=a(𝖱𝖴)k𝖱σ𝖴σ(𝖱𝖴)15σk=a.

Similarly, if a is odd, then one can check that b(𝖱)1σ(𝖱𝖴)14k=a. Thus, ba.

Now assume ab and bc. We observe that the parity of b is dependent on the parity of a and σ. In particular, b is even if and only if σ=0 with a even or if σ=1 with odd a. We now prove that ac by cases depending on the parities of a and b:

  • (a and b are both even) Since bc, then

    c=b(𝖱𝖴)𝖱τ=a(𝖱𝖴)k(𝖱𝖴)𝖱τ.
  • (a is even and b is odd)

    c=b𝖴(𝖱𝖴)𝖱τ=a(𝖱𝖴)k𝖱𝖴(𝖱𝖴)𝖱τ=a(𝖱𝖴)k++1𝖱τ.
  • (a and b are both odd)

    c=b𝖴(𝖱𝖴)𝖱τ=(a𝖴(𝖱𝖴)k𝖱)𝖴(𝖱𝖴)𝖱τ=a𝖴(𝖱𝖴)k++1𝖱τ
  • (a is odd and b is even)

    c=b(𝖱𝖴)𝖱τ=(a𝖴(𝖱𝖴)k)(𝖱𝖴)𝖱τ=a𝖴(𝖱𝖴)k+𝖱τ.

In all cases, ac, so is transitive. Since is reflexive, symmetric, and transitive, we conclude the proof.

Definition 8.

For aG𝖱,𝖴, let [a]={b:ba} denote the equivalence class of a given by the equivalence relation .

Intuitively, we can think of [a] as the set of positions reached by repeating the moves 𝖱 and 𝖴 in an alternating manner. If a is even, the first move in the alternating sequence is 𝖱, and if a is odd, the alternating moves begin with 𝖴.

Lemma 9.

For all aG𝖱,𝖴, |[a]|=30

Proof.

First suppose a is even. It can be verified computationally that 𝖱𝖴 has order 15 (see Appendix A). So [a]even={a(𝖱𝖴)k:k} has size 15. Then [a]odd=[a]even𝖱 also has size 15, so

|[a]|=|[a]even|+|[a]odd|=15+15=30.

Thus we can equivalently define [a] by

[a]={{a(𝖱𝖴)k𝖱σ:0k<15,σ{0,1}}for a even,{a𝖴(𝖱𝖴)k𝖱σ:0k<15,σ{0,1}}for a odd.

We can visualize the equivalence classes with respect to the graph G𝖱,𝖴 as 30-cycles, as illustrated in Figure 6.

Figure 6: A subgraph of G𝖱,𝖴 induced by an equivalence class. Red edges represent the moves 𝖱 and 𝖱, while green edges represent the moves 𝖴 and 𝖴.

Let Q be the graph whose vertex set is {[a]:a𝖱,𝖴} and where two vertices A,BV(Q) are adjacent if and only if there exists an aA and bB such that either a=b𝖴 or a=b𝖴. Given two cycle-classes A=[a] and B=[b] that are adjacent in this sense, we are interested in the appearance of G𝖱,𝖴[AB]. The following few lemmas explore how a cycle-class interacts with its neighbors.

Lemma 10.

For any two even a,bV(G𝖱,𝖴), the function f:xba1x is a graph automorphism that satisfies:

  1. 1.

    f(a)=b,

  2. 2.

    for any c,dV(G𝖱,𝖴), f(cd)=f(c)d,

  3. 3.

    for all cV(G𝖱,𝖴), such that [f(c)]=f([c]).

Proof.

To check that f is indeed a graph automorphism, let c,dV(G𝖱,𝖴), and note that f(c)1f(d)=(ba1c)1(ba1d)=c1d, from where

{c,d}E(G𝖱,𝖴) c1d{𝖱,𝖴}
f(c)1f(d){𝖱,𝖴}
{f(c),f(d)}E(G𝖱,𝖴).

To verify the first condition, we have f(a)=ba1a=b. To verify the second condition, let c,dV(G𝖱,𝖴), and note that f(cd)=ba1cd=f(c)d.

For the third condition, suppose without loss of generality that cV(G𝖱,𝖴) is even (the odd case is almost identical) and observe that

[f(c)]= {f(c)(𝖱𝖴)k𝖱σ:0k<15,σ{0,1}}
= {f(c(𝖱𝖴)k𝖱σ):0k<15,σ{0,1}}
= f([c]).

Thus f satisfies the conditions required by the lemma.

Lemma 11.

The graph Q is vertex-transitive.

Proof.

It suffices to show that for all A,BV(Q), there exists an automorphism f such that f(A)=B. Let A,BV(Q), and choose aA and bB both even. Apply Lemma 10 on a and b to obtain f. By Lemma 10, f maps Q to itself, and since f(a)=b, we have that f(A)=B.

Figure 7: A subgraph of G𝖱,𝖴 induced by an equivalence class and its neighbors with respect to Q. Blue edges represent the moves 𝖴 and 𝖴 that connect positions of different equivalence classes.
Lemma 12.

For all even aV(G𝖱,𝖴), we have [a𝖴𝖴]=[a(𝖴𝖱)k𝖴𝖴] if and only if k is a multiple of 5.

Proof.

This can be verified computationally for a=1 (see Appendix A). Thus, we have that k is a multiple of 5 if and only if [1𝖴𝖴]=[1(𝖴𝖱)k𝖴𝖴], and since 1 is the group identity, we have

k is a multiple of 5[𝖴𝖴]=[(𝖴𝖱)k𝖴𝖴]. (1)

For an even vertex a where a1, let f be the automorphism given by Lemma 10 with f(1)=a. Then, combining Equation 1 with the properties of f given by Lemma 10, we obtain

k is a multiple of 5[𝖴𝖴]=[(𝖴𝖱)k𝖴𝖴]f([𝖴𝖴])=f([(𝖴𝖱)k𝖴𝖴])[f(𝖴𝖴)]=[f((𝖴𝖱)k𝖴𝖴)][f(1)𝖴𝖴]=[f(1)(𝖴𝖱)k𝖴𝖴][a𝖴𝖴]=[a(𝖴𝖱)k𝖴𝖴].

Lemma 13.

The graph Q is 5-regular, and for any AV(Q) and even aA, the neighbors of A in Q are exactly the elements of the set

{[a(𝖴𝖱)k𝖴𝖴]:0k<5}.

Proof.

It can be checked that the vertex [1] has degree 5, so by vertex-transitivity (Lemma 11), Q is 5-regular. Let AV(Q) and pick any even aA. By Lemma 12, no two elements in the set {a(𝖴𝖱)k𝖴𝖴:0k<5} are in the same equivalence class, so {[a(𝖴𝖱)k𝖴𝖴]:0k<5} has size 5. It remains to show that each of these elements is adjacent to A in Q. Indeed, for any 0k<5, b=a(𝖴𝖱)k𝖴 is odd and, solving for a we have a=b𝖴(𝖱𝖴)k, so [b]=[a]=A. As a(𝖴𝖱)k𝖴𝖴=b𝖴 is adjacent to bA, we have that [a(𝖴𝖱)k𝖴𝖴] is adjacent to A. A visualization of the results of Lemma 12 and Lemma 13 (In particular, the 5-regularity of Q) is shown by Figure 7.

4.2 Constructing Hamiltonian paths

We turn towards the construction of Hamiltonian paths in G𝖱,𝖴. Given an even aV(G𝖱,𝖴), we will construct a path π1 from 1 to a with certain properties that allow us to extend π1 into π2, where π2 visits every cycle-class at least once and also has properties that allow us to extend it into a Hamiltonian path.

We begin by rigorously defining the properties of π1, and by arguing that paths with such properties exist. Examples of paths with these properties are shown in Figure 8 and Figure 9(a).

Lemma 14.

Let aV(G𝖱,𝖴) be odd. Then there exists a path π1 from 1 to a with the following properties:

  1. 1.

    (Pair inclusion) For all even bV(G𝖱,𝖴), b𝖴π1 if and only if bπ1

  2. 2.

    (Cycle options) Let C={[c]:cπ1}. For all even b[c]C[c] such that bπ1, either b𝖴π1 or [b𝖴]C.

  3. 3.

    (Neighbor-connectivity) For all AC{[a]}, if B is a neighbor of A with respect to Q, then there exists an even dA such that dπ1 and d𝖴B.

  4. 4.

    (Path construction invariant) For all even bπ1, the vertex immediately following b in π1 is either b𝖴 or b𝖴.

Proof.

Let πQ=S1S2Sm be a shortest path in Q from [1] to [a].

By Lemma 13, for all i such that 1i<m, given an even vertex aiSi, there exists a unique ki (based on ai and Si+1) such that 10ki14 and ai(𝖴𝖱)ki𝖴𝖴Si+1.

Consider the sequence a1,,am defined by a1:=1 and ai+1:=ai(𝖴𝖱)ki𝖴𝖴 for 1im1. Intuitively, this is the same as constructing our path greedily; we construct our π1 such that π1 covers as much of each Si as possible whilst traversing S1S2Sm.

For 1i<m, let π1i be the path that starts at ai and records the positions visited by the sequence of moves (𝖴𝖱)ki𝖴, ending on ai(𝖴𝖱)ki𝖴. Note am is even and amSm=[a]. As a is odd, a𝖴(𝖱𝖴)km=am for some km such that 0km14. Then am(𝖴𝖱)km𝖴=a. Let π1m be the path that starts at am and records the positions visited by performing the sequence of moves (𝖴𝖱)km𝖴, ending on a.

Then π1=π11π12π1m is a path in G𝖱,𝖴 that starts on 1 and ends on a. It remains to show that π1 satisfies the desired properties.

Figure 8: An example of π1 from where m=3, k1=13, k2=12, and k3=1.

Note that any even position a in π1 is followed immediately by a𝖴, so condition 4 is satisfied. As π1 visits an equal number of even and odd positions, condition 1 is satisfied as well.

To prove condition 2, suppose for the sake of contradiction that there is an even b[c]C[c] such that bπ1, b𝖴π1, and [b𝖴]C. Since [b]C and π1 is contained in j=1mSj, we have that [b]πQ and [b𝖴]πQ. Suppose [b]=Si.

Since bπ1, it follows that b=ai(𝖴𝖱)k for some kik<15. Note ai𝖴𝖴Si1 (if it exists) and ai(𝖴𝖱)ki𝖴𝖴Si+1 (if it exists).

Since [b𝖴] is odd, [b𝖴]=[b𝖴𝖴], and by Lemma 12, [b𝖴𝖴]=[ai(𝖴𝖱)k𝖴𝖴]. Because 𝖴𝖴=𝖴𝖴, we have that [b𝖴]=[ai(𝖴𝖱)k𝖴𝖴]. Now we note that since 10ki<k<15, k is neither a multiple of 5 nor does it differ from ki by a multiple of 5, so [ai(𝖴𝖱)k𝖴𝖴] is neither Si1 nor Si+1. Thus, while [b𝖴] and [b]=Si are both in πQ, πQ does not visit these two vertices consecutively. Since [b𝖴] and [b] are adjacent in Q, this contradicts the fact that πQ is a shortest path.

To prove condition 3, let A=Si where i<m. By Lemma 13, B=[ai(𝖴𝖱)k𝖴𝖴] for some 0k4. Then d=ai(𝖴𝖱)k is in both π1 and A, and

d𝖴=ai(𝖴𝖱)k𝖴=ai(𝖴𝖱)k𝖴𝖴𝖴[ai(𝖴𝖱)k𝖴𝖴]=B.

Thus π1 satisfies all four conditions, as desired.

Theorem 15 (Godsil and Royle [10]).

A vertex-transitive graph with valency k has vertex connectivity at least 23(k+1)

Lemma 16.

The graph Q is 2-connected.

Proof.

By Lemma 11 and Lemma 13, Q is a vertex-transitive graph with valency 5. Then by Theorem 15, Q has connectivity at least 23(5+1)=4. Thus Q is 4-connected, meaning it is also 2-connected.

(a) An example of π1 where |C|=1.
(b) The resulting π1 using π1 as shown in Figure 9(a).
Figure 9: Illustration of the modification used in the π1 construction.

We will now argue that we can extend π1 to visit more cycles while preserving its properties. Intuitively, we take our original path, find a neighboring cycle, deviate from our original path for a moment and fully fill out an untouched neighboring cycle, and finally pick up where we left off with the original path. An example of such a modification can be seen in the difference between Figure 9(a) and Figure 9(b).

Lemma 17.

Let π1 be a path and C be a set as described in Lemma 14. Suppose CV(Q). Then there exists a path π1 and C={[c]:cπ1} such that CC and π1 satisfies the conditions for π1 given by Lemma 14.

Proof.

We will case on whether |C|>1.

  • Case 1. If |C|=1, then as 1π1, it follows that C={[1]}, so all vertices in π1 are in [1]. Then as 𝖴[1], it follows that π1=v1v2πa for some path πa where v1=1 and v2=𝖴.

    Let πb be the path that begins on 1 and records the positions visited by performing the sequence of moves 𝖴𝖱(𝖴𝖱)14𝖴. Then πb ends on the position 𝖴𝖱(𝖴𝖱)14𝖴=𝖴𝖴𝖴=𝖴. A visualization thereof is shown with Figure 9(a) and Figure 9(b). Let π1=πbπa, so C={[1],[𝖴]}, so CC. Since the set of vertices visited by π1 is exactly the union of the set of vertices visited by π1 and [𝖴], condition 1 of Lemma 14 is satisfied.

    For condition 2, suppose bC and bπ1. Then since all vertices in [𝖴] are in π1, it follows that bC. Then either b𝖴π1, in which case b𝖴π1, or [b𝖴]C. In the latter case, either [b𝖴]=[𝖴], which implies b𝖴π1, or [b𝖴][𝖴], which implies [b𝖴]C.

    For condition 3, we only need to check A=[𝖴]. Note that all vertices in A are in π1. By Lemma 13, for any neighboring B, there exists an even dA such that B=[d𝖴𝖴]. Since d𝖴𝖴B is even, d𝖴𝖴𝖴=d𝖴B. As all vertices in A=[𝖴] are also in π1, we have that dπ1, and we are done.

    Condition 4 is satisfied because π1=πbπa, where vertices πa satisfy the condition because πa is a subpath of π1 and vertices in πb satisfy the condition because πb begins on 1, an even vertex, and is constructed by the move sequence 𝖴𝖱(𝖴𝖱)14𝖴.

  • Case 2. If |C|>1, then C{[a]} is nonempty. By Lemma 16, the graph of Q with the vertex [a] removed is connected, so there exists a BCi that is adjacent to some ACi{[a]}. By the third clause of Lemma 14, there exists an even dA such that dπ1 and d𝖴B. Since BC, d𝖴π1, so the vertex immediately following d in π1 must be d𝖴. Note that

    d𝖴=d𝖴𝖴𝖴=d𝖴𝖱(𝖴𝖱)14𝖴.

    Let πa be the prefix of π1 that ends at d, exclusive. Let πb be the path that starts at d and records the positions visited by performing the move sequence 𝖴𝖱(𝖴𝖱)14𝖴, ending on the position d𝖴. Let πc be a suffix of π1 that begins immediately after d𝖴. Let π1=πaπbπc. Then C=C{B}, so CC. It remains to prove that π1 satisfies the properties given by Lemma 14. Since π1 traverses exactly the union of B and the set of points traversed by π1, condition 1 remains true.

    For condition 2, we have that C={[c]:cπ1}. Suppose bC and bπ1. Then bπ1. Since all points in B are also in π1, we also have that bC. As π1 satisfies property 2 from Lemma 14, it follows that either b𝖴π1 or [b𝖴]C. If b𝖴π1, then b𝖴π1. Otherwise, [b𝖴]C, so either [b𝖴]=B, in which case b𝖴π1, or [b𝖴]C.

    For condition 3, suppose AC{[a]} and B is a neighbor of A with respect to Q. We will case on whether AC{[a]}. If AC{[a]}, then because π1 satisfies condition 3, there exists an even dA such that d𝖴B and dπ1, which means dπ1 as well. If AC{[a]}, then A=B. Then there exists a dB such that either d𝖴B or d𝖴B. If d𝖴B, then d must be even, since if d is odd, then d𝖴BB, so we are done. Otherwise, if d𝖴=d(𝖱𝖴)k𝖱B, then d must be odd, so d𝖴A is even and d𝖴B is even. Then d𝖴𝖴=d𝖴𝖴B.

    To show condition 4 is true for π1=πaπbπc, since πa and πc are both subpaths of π1 that start on even positions (and π1 satisfies condition 4), it suffices to show that πb satisfies condition 4. This can be verified by observing that πb starts on d – which is an even position – and is formed by the move sequence 𝖴𝖱(𝖴𝖱)14𝖴.

By applying Lemma 17 iteratively, we obtain a path with the properties of π1 that also visits every cycle, upon which new properties emerge.

Lemma 18.

Let aV(G𝖱,𝖴) be odd. Then there exists a path π2 from 1 to a with the following properties:

  1. 1.

    For all even bV(G𝖱,𝖴), b𝖴π2 if and only if bπ2

  2. 2.

    For all even bV(G𝖱,𝖴), either bπ2 or b𝖴π2

  3. 3.

    For all even bπ2, the vertex immediately following b in π2 is either b𝖴 or b𝖴.

Proof.

Let π1,1 be a path given by Lemma 14, and define Ci={[c]:cπ1,i}. Given π1,i satisfying the properties given by Lemma 14, suppose CiQ. Then by Lemma 17, there exists a π1,i+1 such that CiCi+1. By repeating this argument (no more than |Q| times), there is a π1,n such that Cn=Q and π1,n satisfies the properties of Lemma 14. Let π2=π1,n. Note π2 satisfies properties 1 and 3 by properties 1 and 4 from Lemma 14. Furthermore, {[c]:cπ2}=Cn=Q and [c]CnCn=G𝖱,𝖴, so property 2 follows from the property 2 from Lemma 14.

We will now argue that a path π2 as described in Lemma 18 can be extended into a Hamiltonian path. We make use of the fact that 𝖴=𝖴𝖴𝖴. If we have b𝖴𝖴 and b𝖴 as consecutive vertices in π2, and b and b𝖴 are not in π2, then we can extend π2 to include b and b𝖴 by performing 𝖴𝖴𝖴 in place of 𝖴 on b𝖴𝖴.

Theorem 19.

The graph G𝖱,𝖴 is Hamilton laceable.

Proof.

Since G𝖱,𝖴 is vertex-transitive, it suffices to show that for an arbitrary odd aV(G𝖱,𝖴), there exists a path from 1 to a that is Hamiltonian for G𝖱,𝖴. Fix a. Let π2(1)=π2 be a path from 1 to a as given by Lemma 18. If π2(1) is Hamiltonian, we are done. Otherwise, we claim that there exists a path π2(2) from 1 to a that satisfies the conditions for π2 from Lemma 18 and is strictly longer than π2(1). If the claim holds, then by repeating this argument (no more than |G𝖱,𝖴|1 times) we must end with a Hamiltonian path.

We now prove the claim. Suppose the path π2(i), for some i1, is not Hamiltonian, and thus there is some vertex bπ2(i). Then, by the first clause of Lemma 18, we can assume without loss of generality that b is even and b𝖴π2(i). Then, by the second clause of Lemma 18, b𝖴π2(i). As bπ2(i), it follows from the third clause of Lemma 18 that the vertex before b𝖴 in π2(i) is c:=b𝖴𝖴. Thus, c is followed immediately by c𝖴=c𝖴𝖴𝖴=b𝖴 in π2(i), while b=c𝖴𝖴 and b𝖴=c𝖴 are both not in π2(i). Let πa be the prefix of π2(i) that ends with c and let πb be the suffix of π2(i) that begins on c𝖴. Then, π2(i+1):=πa(b)(b𝖴)πb is a path from 1 to a, strictly longer than π2(i), and also holds the conditions from Lemma 18. This establishes the claim, and thus concludes the proof.

5 Extending Laceability to 𝑮𝓡

We turn to prove Hamilton laceability for G. First, observe that for arbitrary aV(G), we have that G[a𝖱,𝖴] is isomorphic to G𝖱,𝖴. This gives us the following generalization of Theorem 19.

Corollary 20.

For any a, G[a𝖱,𝖴] is Hamilton laceable.

Let Q be the graph whose vertex set is /𝖱,𝖴 and where two vertices A,B are adjacent if there exist a0A, b0B even and a1A, b1B odd such that {a0,b1} and {a1,b0} are both edges in G. It can be checked computationally that ||=3,674,160 and |𝖱,𝖴|=29,160, so |Q|=3,674,160/29,160=126 (see Appendix A).

Lemma 21.

The graph Q is vertex-transitive.

Proof.

Let a𝖱,𝖴,b𝖱,𝖴 be two arbitrary vertices in Q. We want to show that there exists a graph automorphism that maps a𝖱,𝖴 to b𝖱,𝖴 Define a function f on /𝖱,𝖴 by

x𝖱,𝖴ba1x𝖱,𝖴.

Note f is well-defined because if x𝖱,𝖴=x𝖱,𝖴, then x=xh for some h𝖱,𝖴. Then

f(x𝖱,𝖴)=f(xh𝖱,𝖴)=ba1xh𝖱,𝖴=ba1x𝖱,𝖴=f(x𝖱,𝖴).

Since f1:x𝖱,𝖴ab1x𝖱,𝖴 is a two-sided inverse, f is bijective.

To show that f preserves edges, suppose C and D are adjacent by edges {c0,d1} and c1,d0. Then ba1c0,ba1c1f(C) and ba1d0,ba1d1f(D), where {c0,d1} and {c1,d0} are both edges in G, so f(C) is adjacent to f(D).

Thus f is a graph automorphism, and it can be easily checked that f maps a𝖱,𝖴 to b𝖱,𝖴.

Lemma 22.

The graph Q is 90-regular

Proof.

It follows from Lemma 21 that Q is regular. Additionally, it can be checked computationally that the vertex 𝖱,𝖴 has degree 90 (see Appendix Appendix A), so Q is 90-regular.

Lemma 23.

The graph Q is 3-connected

Proof.

By Lemma 21 and Lemma 22, Q is a vertex-transitive graph with a valency of 90. It follows from Theorem 15 that Q has vertex-connectivity at least 23(90+1)>3. Thus Q is 3-connected.

Theorem 24 (Ore [23]).

Let G be a 2-connected graph on n vertices satisfying d(x)+d(y)n+1 for every pair of non-adjacent vertices x,yG. Then, G is Hamilton connected.

Lemma 25.

The graph Q is Hamilton connected, and so is the induced subgraph Q:=Q{1𝖱,𝖴}.

Proof.

By Lemma 23, both Q and Q are 2-connected. Recall that Q is a 90-regular graph on 126 vertices, and as Q is the same graph but with one vertex removed, every remaining vertex has degree at least 89. Therefore, both Q and Q satisfy the hypotheses of Theorem 24 (d(x)+d(y)=180127 for Q, and d(x)+d(y)178126 for Q) and are thus Hamilton connected. Finally, we prove our main result:

Theorem 26.

The graph G is Hamilton laceable.

Proof.

First, observe that by vertex transitivity it suffices to consider an arbitrary odd position b and show that there is a Hamiltonian path whose endpoints are b and 1. Now the proof is by cases depending on whether b𝖱,𝖴 or not.

  • Case 1. Suppose b𝖱,𝖴. By Lemma 25, we can find a Hamiltonian path πQ=S1S2S126 on Q such that 1S1 and bS126. Then we can find distinct b1,b2,,b126, all odd, such that b126=b and for all 1i<126, biSi and bi is adjacent to some ai+1Si+1. Furthermore, let a1=1. For all 1i126, ai is even and bi is odd, so by Corollary 20 we can find a path πi that begins at ai, ends at bi, and is Hamiltonian for G[Si]. Then π1π2π126 is a path that starts at a1=1, ends at b126=b, and is Hamiltonian for G.

  • Case 2. Now suppose b𝖱,𝖴. We can find a path π0=bx1 that is Hamiltonian for G𝖱,𝖴. Then x{𝖱,𝖴,𝖱,𝖴}. It can be checked that for any x{𝖱,𝖴,𝖱,𝖴}, x𝖥𝖥𝖱,𝖴, so x𝖥𝖱,𝖴𝖥𝖱,𝖴. Then by Lemma 25, we can find a Hamiltonian path πQ=S1S2S125 on Q such that x𝖥S1 and 𝖥S125. We can find b1,b2,,b126, all odd, such that b125=𝖥 and for all 1i<125, biSi and bi is adjacent to some ai+1Si+1. Let a1=x𝖥. By Corollary 20 for all 1i125, we can find a path πi that begins at ai, ends at bi, and is Hamiltonian for G[Si]. Let π0 be such that π0=π01. Then π0π1π2π1251 is a path that starts on b, ends on 1, and is Hamiltonian for G.

References

  • [1] B. Alspach and Y. Qin. Hamilton-Connected Cayley Graphs on Hamiltonian Groups. European Journal of Combinatorics, 22(6):777–787, 2001. doi:10.1006/eujc.2001.0456.
  • [2] T. Araki. Hyper hamiltonian laceability of Cayley graphs generated by transpositions. Networks. An International Journal, 48(3):121–124, 2006. doi:10.1002/net.20126.
  • [3] A. Biere, T. Faller, K. Fazekas, M. Fleury, N. Froleyks, and F. Pollitt. CaDiCaL 2.0. In Arie Gurfinkel and Vijay Ganesh, editors, Computer Aided Verification - 36th International Conference, CAV 2024, Montreal, QC, Canada, July 24-27, 2024, Proceedings, Part I, volume 14681 of Lecture Notes in Computer Science, pages 133–152. Springer, 2024. doi:10.1007/978-3-031-65627-9_7.
  • [4] A. Biere, M. Heule, H. van Maaren, and T. Walsh. Handbook of Satisfiability: Volume 185 Frontiers in Artificial Intelligence and Applications. IOS Press, NLD, 2009.
  • [5] C. C. Chen and N. F. Quimpo. On strongly hamiltonian abelian group graphs. In K. L. McAvaney, editor, Combinatorial Mathematics VIII, pages 23–34, Berlin, Heidelberg, 1981. Springer Berlin Heidelberg.
  • [6] S. J. Curran and J. A. Gallian. Hamiltonian cycles and paths in Cayley graphs and digraphs — A survey. Discrete Mathematics, 156(1):1–18, 1996. doi:10.1016/0012-365X(95)00072-5.
  • [7] E. D. Demaine, M. L. Demaine, S. Eisenstat, A. Lubiw, and A. Winslow. Algorithms for solving rubik’s cubes. In European Symposium on Algorithms, pages 689–700. Springer, 2011.
  • [8] E. D. Demaine, S. Eisenstat, and M. Rudoy. Solving the Rubik’s Cube Optimally is NP-complete. In Rolf Niedermeier and Brigitte Vallée, editors, 35th Symposium on Theoretical Aspects of Computer Science (STACS 2018), volume 96 of Leibniz International Proceedings in Informatics (LIPIcs), pages 24:1–24:13, Dagstuhl, Germany, 2018. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.STACS.2018.24.
  • [9] M. Dupuis and S. Wagon. Laceable knights. ARS MATHEMATICA CONTEMPORANEA, 9, 2014. doi:10.26493/1855-3974.420.3c5.
  • [10] C. Godsil and G. Royle. Algebraic Graph Theory. Graduate Texts in Mathematics. Springer New York, NY, 2001. doi:10.1007/978-1-4613-0163-9.
  • [11] P. Gregor, H. P. Hoang, A. Merino, and O. Mička. Generating All Invertible Matrices by Row Operations. In Julián Mestre and Anthony Wirth, editors, 35th International Symposium on Algorithms and Computation (ISAAC 2024), volume 322 of Leibniz International Proceedings in Informatics (LIPIcs), pages 35:1–35:14, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ISAAC.2024.35.
  • [12] Marijn J. H. Heule. Chinese remainder encoding for hamiltonian cycles. In Chu-Min Li and Felip Manyà, editors, Theory and Applications of Satisfiability Testing - SAT 2021 - 24th International Conference, Barcelona, Spain, July 5-9, 2021, Proceedings, volume 12831 of Lecture Notes in Computer Science, pages 216–224. Springer, 2021. doi:10.1007/978-3-030-80223-3_15.
  • [13] S. Hirata. Graph-theoretical estimates of the diameters of the rubik’s cube groups, 2024. doi:10.48550/arXiv.2407.12961.
  • [14] S. Hirata. Probabilistic estimates of the diameters of the rubik’s cube groups, 2024. doi:10.48550/arXiv.2404.07337.
  • [15] A. Ignatiev, A. Morgado, and J. Marques-Silva. PySAT: A Python toolkit for prototyping with SAT oracles. In SAT, pages 428–437, 2018. doi:10.1007/978-3-319-94144-8_26.
  • [16] L. Lovász. Problem session (problem 11). In N.Sauer R.Guy, H.Hanam, Gordon J.Schonheim, and Breach, editors, Combinatorial Structures and Their Applications, 1970.
  • [17] A. Merino and B. Subercaseaux. A demigod’s number for the Rubik’s cube, 2024. arXiv:2501.00144.
  • [18] J. T. Mulholland. Math 302: Combinatorial mathematics. http://www.sfu.ca/˜jtmulhol/math302/notes/permutation-puzzles-book.pdf. [Accessed 12-16-2025].
  • [19] J. T. Mulholland. Permutation puzzles - rubik’s cube. https://www.sfu.ca/˜jtmulhol/math302/puzzles-rc.html. [Accessed 12-16-2025].
  • [20] B. Norskog. Hamiltonian circuit for the entire 2x2x2 cube group — speedsolving.com. https://www.speedsolving.com/threads/hamiltonian-circuit-for-the-entire-2x2x2-cube-group.34318/, 2011. [Accessed 12-27-2025].
  • [21] B. Norskog. A Hamiltonian circuit for Rubik’s. https://bruce.cubing.net/ham333/rubikhamiltonexplanation.html, 2012. [Accessed 12-27-2025].
  • [22] R. Ohashi, T. Soh, D. Le Berre, H. Nabeshima, M. Banbara, K. Inoue, and N. Tamura. SAT-Based CEGAR Method for the Hamiltonian Cycle Problem Enhanced by Cut-Set Constraints. In Jeremias Berg and Jakob Nordström, editors, 28th International Conference on Theory and Applications of Satisfiability Testing (SAT 2025), volume 341 of Leibniz International Proceedings in Informatics (LIPIcs), pages 24:1–24:10, Dagstuhl, Germany, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SAT.2025.24.
  • [23] O. Ore. Hamilton connected graphs. Journal de Mathématiques Pures et Appliquées, 42:21–27, 1963.
  • [24] T. Rokicki, J. Dethridge, H. Kociemba, and M. Davidson. God’s Number is 26 in the Quarter Turn Metric. https://cube20.org/qtm/. [Accessed 12-16-2025].
  • [25] T. Rokicki, H. Kociemba, M. Davidson, and J. Dethridge. The Diameter of the Rubik’s Cube Group Is Twenty. SIAM Review, 56(4):645–670, 2014. doi:10.1137/140973499.
  • [26] J. J. Rotman. An Introduction to the Theory of Groups. Springer New York, 1995. doi:10.1007/978-1-4612-4176-8.
  • [27] J. Scherphuis. Mini Cube, the 2x2x2 Rubik’s Cube. https://www.jaapsch.net/puzzles/cube2.htm. [Accessed 26-12-2025].
  • [28] T. Soh, D. Le Berre, S. Roussel, M. Banbara, and N. Tamura. Incremental SAT-Based Method with Native Boolean Cardinality Handling for the Hamiltonian Cycle Problem. In Eduardo Fermé and João Leite, editors, Logics in Artificial Intelligence, pages 684–693, Cham, 2014. Springer International Publishing.
  • [29] D. Witte Morris and K. Wilk. Cayley graphs of order kp are hamiltonian for k<48. The Art of Discrete and Applied Mathematics, 3(2):#P2.02, May 2020. doi:10.26493/2590-9770.1250.763.
  • [30] N. Zhou. In pursuit of an efficient sat encoding for the hamiltonian cycle problem. In Principles and Practice of Constraint Programming: 26th International Conference, CP 2020, Louvain-La-Neuve, Belgium, September 7–11, 2020, Proceedings, pages 585–602, Berlin, Heidelberg, 2020. Springer-Verlag. doi:10.1007/978-3-030-58475-7_34.
  • [31] N. Zhou. Encoding the Hamiltonian Cycle Problem into SAT Based on Vertex Elimination. In Paul Shaw, editor, 30th International Conference on Principles and Practice of Constraint Programming (CP 2024), volume 307 of Leibniz International Proceedings in Informatics (LIPIcs), pages 40:1–40:8, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.CP.2024.40.

Appendix A GAP Code for Computational Checks

Listing 1: GAP code for computational checks. Also publicly available at https://github.com/bsubercaseaux/rubik-hamiltonian/.
# 2x2x2 Rubik’s Cube group tests
# --- Generators on 24 "stickers" (clockwise when looking at that face) ---
R := (2,19,22,10)(4,17,24,12)(13,14,16,15);;
U := (1,2,4,3)(5,17,13,9)(6,18,14,10);;
F := (3, 13,22,8)(4,15,21,6)(9,10,12,11);;
cube_2x2x2 := Group(R, U, F);;
Print("Order(cube_2x2x2) = ", Order(cube_2x2x2), "\n");; # Should be 3674160
# Check for Lemma 9
RU := R * U;;
subRU := Group(RU);;
Print("Order(subRU) = ", Order(subRU), "\n");; # Should be 15
# Check for Lemma 12
# Helper: check evenness of a permutation
IsEven := g -> SignPerm(g) = 1;
# Cycle class [g] for EVEN g, per Definition 8 / Lemma 9 discussion:
# [g] = { g*(RU)^k*R^sigma : 0<=k<15, sigma in {0,1} }
CycleClassEven := function(g)
local k, L;
if not IsEven(g) then
Error("CycleClassEven expects an even element");
fi;
L := [];
for k in [0..14] do
Add(L, g * (RU^k)); # sigma = 0
Add(L, g * (RU^k) * R); # sigma = 1
od;
return Set(L); # make order/copies irrelevant for equality tests
end;
UU := U^-1 * U^-1; # U^{-1}U^{-1} = U^{-2}, this is even
UpRp := U^-1 * R^-1;
base := CycleClassEven(UU);
Print("k values where [U^{-2}] = [(U^{-1}R^{-1})^k U^{-2}]:\n");
for k in [0..14] do
if base = CycleClassEven((UpRp^k) * UU) then
Print(k, " ");
fi;
od;
Print("\nExpected: 0 5 10\n");
# Section 5
R_U_subgroup := Group(R, U);;
Print("Order(R_U_subgroup) = ", Order(R_U_subgroup), "\n"); # Should be 29160
# --- Lemma 22 check: deg_{Q_R}(<R,U>) = 90 ---
Print("Index(<R, U, F>,<R, U>) = ", Index(cube_2x2x2,R_U_subgroup), "\n");; # should be 126
# Vertices of Q_R are LEFT cosets gH
cosets := LeftCosets(cube_2x2x2, R_U_subgroup);;
Print("|Q_R| = ", Length(cosets), "\n");; # should be 126
# Precompute representatives so we can locate cosets quickly
reps := List(cosets, Representative);;
# Map x in cube_2x2x2 to the index i such that x is in reps[i]*R_U_subgroup (i.e., xR_U_subgroup is that coset)
CosetIndex := function(x)
local i;
for i in [1..Length(reps)] do
# x in reps[i]*R_U_subgroup <=> reps[i]^-1 * x in R_U_subgroup
if (reps[i]^-1 * x) in R_U_subgroup then
return i;
fi;
od;
Error("CosetIndex: could not locate coset for given element");
end;
# Identify the vertex R_U_subgroup itself (the coset containing the identity)
id := Identity(cube_2x2x2);;
idIdx := CosetIndex(id);;
Finv := F^-1;;
# --- Definition of adjacency in Q_R specialized to A = H ---
# B is adjacent to R_U_subgroup iff:
# - there is some EVEN a in R_U_subgroup with a*F^{+-1} landing in B (odd vertex in B),
# - and some ODD a in R_U_subgroup with a*F^{+-1} landing in B (even vertex in B).
#
# So compute:
# evenHit = { (a*F^{+-1})R_U_subgroup : a in R_U_subgroup even }
# oddHit = { (a*F^{+-1})R_U_subgroup : a in R_U_subgroup odd }
# Neighbors are Intersection(evenHit, oddHit), excluding R_U_subgroup itself.
evenHit := [];;
oddHit := [];;
for a in Elements(R_U_subgroup) do
if IsEven(a) then
Add(evenHit, CosetIndex(a * F));
Add(evenHit, CosetIndex(a * Finv));
else
Add(oddHit, CosetIndex(a * F));
Add(oddHit, CosetIndex(a * Finv));
fi;
od;
evenHit := Set(evenHit);;
oddHit := Set(oddHit);;
neighbors := Intersection(evenHit, oddHit);;
# Remove self if it appears (it *shouldn’t* be adjacent to itself)
if idIdx in neighbors then
RemoveSet(neighbors, idIdx);
fi;
Print("deg_{Q_R}(<R,U>) = ", Length(neighbors), "\n");;
Print("Expected: 90\n");