A Demigod’s Number for the Rubik’s Cube
Abstract
It is by now well-known that any state of the Rubik’s Cube can be solved in at most 20 moves, a result often referred to as “God’s Number”. However, this result took Rokicki et al. around 35 CPU years to prove and is therefore very challenging to reproduce. We provide a novel approach to obtain a worse bound of 36 moves with high confidence, but that offers two main advantages: (i) it is easy to understand, reproduce, and verify, and (ii) our main idea generalizes to bounding the diameter of other vertex-transitive graphs by at most twice its true value, hence the name “demigod number”. Our approach is based on the fact that, for vertex-transitive graphs, the diameter at most twice the average distance (of which we give a much simpler proof than in the literature). Then, by sampling uniformly random states and using a modern solver to obtain upper bounds on their distance, a standard concentration bound allows us to confidently state that the average distance is around , from where the diameter is at most .
Keywords and phrases:
Diameter, Rubik’s Cube, Experimental mathematicsFunding:
Arturo Merino: supported by ANID FONDECYT Iniciación No 11251528.Copyright and License:
2012 ACM Subject Classification:
Mathematics of computing Paths and connectivity problemsSupplementary Material:
Software: https://github.com/bsubercaseaux/RubikDemiGodNumberarchived at
swh:1:dir:f60b4499805826762e42e46629f51691d98ec32c
Editor:
John IaconoSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The Rubik’s Cube, illustrated in Figure 1, is arguably one of the most iconic puzzles ever created, and one of the best-selling toys of all time; its beautiful balance of simplicity (it only has 6 faces, with 54 colored stickers) and complexity (it has over possible states) has captured the attention of millions of people around the world since its invention in 1974. Naturally, such a combinatorially rich puzzle has raised a variety of interesting mathematical questions, with the most famous one being:
What is the minimum number of moves required to solve the Rubik’s Cube from any starting position?
To make this question precise, we consider the half-turn metric, in which turning either of the 6 faces of the cube by any amount (i.e., , , or ) counts as a single move. After a series of incremental improvements detailed in Table 1, Rokicki et al. [19] proved that moves are always enough to solve any Rubik’s Cube in the half-turn metric, a result often referred to as “God’s Number”. This result, however, was obtained by a mixture of mathematical ideas and extensive computation, taking around 35 CPU years. As a result, verifying the correctness of the so-called God’s Number is extremely challenging, and the required computations have likely never been reproduced independently. While the result is widely believed to be true, our goal is to provide an alternative approach (providing a weaker bound) that can be easily understood and reproduced in e.g., a classroom setting.
| Year | Lower bound | Upper bound |
|---|---|---|
| 1981 | 18 | 52 |
| 1990 | 18 | 42 |
| 1992 | 18 | 39 |
| 1992 | 18 | 37 |
| 1995 | 18 | 29 |
| 1995 | 20 | 29 |
| 2005 | 20 | 28 |
| 2006 | 20 | 27 |
| 2007 | 20 | 26 |
| 2008 | 20 | 25 |
| 2008 | 20 | 23 |
| 2008 | 20 | 22 |
| 2010 | 20 | 20 |
Summary
Our approach is based on the following observation: in any vertex-transitive graph (i.e., a graph where every vertex “looks the same”), the diameter (i.e., the maximum distance between any two vertices) is at most twice the mean distance between vertices, . This observation corresponds to a question posed by Alan Kaplan [21], which was answered in the more general context of homogeneous compact metrics spaces by Herman and Pakianathan [7]. Our proof, however, is elementary and self-contained, and we believe it can be a nice addition to a first course on graph theory.
We apply the previous observation to the Cayley graph of the Rubik’s Cube (defined formally in Section 2, this graph has the possible states of the cube as vertices and edges between pairs of states that are one “move” away from each other) – if we knew the average distance between states of the Rubik’s Cube, we could bound its diameter by at most twice this value. While we cannot directly compute the exact value of for the Rubik’s Cube111Recall that it has over many states., we can provide a good estimate by sampling random pairs of states and computing an upper bound on their distance through standard Rubik’s algorithms (i.e., Kociemba’s Two-Phase Algorithm [13]). Each of these upper bounds for the distance between a pair of states is certified by a short sequence of moves, so one can trust the result without needing to trust the solving algorithm itself. Then, through simple concentration bounds, we will argue that the empirical average of we obtain is overwhelmingly likely to be a good estimate of the true mean distance , and therefore an audience should reasonably trust that the diameter of the Rubik’s Cube is at most (since it must be an integer). As the first step, we will prove the following theorem.
Theorem 1.
Given a state of the Rubik’s Cube, let be the distance from to the solved state. Let be a set of states of the Rubik’s Cube sampled uniformly at random, and let be the random variable corresponding to the average distance between states in and the solved state. Then, if denotes the diameter of the Rubik’s Cube, we have
Note immediately that Theorem 1 implies that if (and thus since the diameter is an integer), then the probability of obtaining for is roughly . However, this experience can be observed repeatedly, which is therefore a great degree of probabilistic evidence for . Unfortunately, Theorem 1 is somewhat computationally expensive, as it requires the number of samples to be around million if we desire a probability of error under . As we show in Section 4, this would take roughly hours of computation. In order to see how to reduce the required computation, let us briefly discuss how Theorem 1 is obtained. To obtain an upper bound on , we can leverage the observation and look for an upper bound on , which we can do with a probabilistic guarantee by considering an empirical average . However, a priori it could be that the true average is much larger than our empirical estimate due to a small number of states that are very far and we are not likely to sample randomly – a “long tail” phenomenon. Our solution to this problem is using a “Human’s number”, which is an unconditional modest upper bound on . For instance, the so-called “beginner’s method” suffices to obtain an upper bound of moves. A proof sketch is provided in the appendix, but we expect readers familiar with the beginner’s method to find this bound trivial, since it is far from being tight.
Lemma 2 (Human’s Number).
Any position of the Rubik’s Cube can be solved in at most 205 moves.
Thus, in general, our work can be interpreted as a method for transforming a “Human’s number” into a “Demigod number” that is easy to trust and at most twice the real “God’s number”. Now, going back to the problem of how to reduce the number of samples, the constant in Theorem 1 is a consequence of the constant 205 in Lemma 2. We can improve on this by showing first that in a large percentage of the cases, we can use an upper bound of instead of . Indeed, let us say that a state is “far from being solved” if it requires strictly more than moves to be solved. Naturally, the “God’s number” result corresponds to saying that no state is “far from being solved”, but proving this requires a great computational effort. Instead, we use a much simpler argument: if the proportion of states that are “far from being solved” were to be bigger than, say, , then we would certainly expect to see a state that is “far from being solved” after random samples. Yet, experimentally we do not see any such state after samples, which makes the possibility of more than of total states being “far from being solved” extremely slim. This way, we can separate into:
Finally, we believe that our approach can be used as an example to motivate philosophical conversations about plausibility, a notion explored at large by George Polya in his book “Mathematics and Plausible Reasoning” [16]. In a nutshell, the idea is that while certain types of reasoning do not provide full proof of a statement, they can provide a high degree of confidence in its truth [2]. This is the case, for example, with probabilistic primality tests, which may allow us to confidently assert that a number , with hundreds of millions of digits is prime, without providing a proof in the traditional sense of the word. Then, if we proved in the traditional sense that a certain number-theoretic statement is true provided is prime, our confidence in the primality of should translate into confidence in statement .
2 Preliminaries
Let us introduce the notation and definitions required to work over the Rubik’s cube mathematically. We will see the Rubik’s cube as a group, a standard idea (see e.g., [4, 1]) that we make explicit nonetheless to make our work as self-contained as possible.
Let denote the group of permutations of elements under the composition operation, denoted by . For example, is the permutation defined by:
and thus, for instance,
We identify each state of the Rubik’s cube with a permutation of its stickers, of which there are (9 per each of the 6 faces), and as moving faces in the Rubik’s cube results in a permutation of its stickers, the Rubik’s cube can be seen as a subgroup of , as illustrated in Figure 2.222More in general, a classic theorem of Cayley states that any group is isomorphic to a subgroup of a symmetric group [10, Section 1.3]. Furthermore, as no moves affect the relative position of the center stickers (), we can see the Rubik’s cube as a subgroup of . To complete the definition of the Rubik’s cube group, we need to define the “moves”, which correspond to the following permutations (omitting the values that are not affected by the move):
and similarly, D, F, and B can be deduced from Figure 2. The moves R’, L’, U’, etc., correspond to the inverse of the moves R, L, U, etc., respectively. A sequence of moves is simply a composition of moves, omitting the composition symbol, e.g., R U2 corresponds to the permutation .
Let , the Rubik’s cube group, be the subgroup of generated by the standard moves, i.e., As described earlier, is clearly isomorphic to a subgroup of due to the centers of each face being unaffected by the generators. Finally, note that this group perspective blurs the difference between sequences of moves and states of the cube; every move corresponds to a state of the cube (the result of applying the move to the solved state), and every state reachable from the solved state by moves corresponds to an equivalence class of all move sequences reaching that state.
Definition 3 (Cayley Graph).
Given a group and a set of generators , the Cayley graph is the graph whose vertex set is and where two vertices are adjacent if there exists a generator such that .
We will use to denote the Cayley graph of the Rubik’s cube group under the following set of generators:
Note that the reason we include e.g., R’ and R2 in is that we want to count those as single moves of the cube. Counting as moves leads to a different metric, usually called the Quarter-turn Metric, where God’s number is 26 [18].
Definition 4 (Diameter).
The diameter of a graph is the maximum distance between any two vertices, where the distance between two vertices is the length of the shortest path between them. That is,
In this language, “God’s number” is simply the diameter of the Rubik’s cube graph .
Definition 5 (Mean distance).
The mean distance of a graph is the average distance between any two vertices, that is,
Definition 6 (Graph automorphism).
An automorphism over a graph is a bijection such that for any two vertices , we have that if and only if .
Using the previous definition repeatedly leads to the following trivial lemma.
Lemma 7.
If is an automorphism over a graph , then for any two vertices , we have that .
Definition 8 (Vertex Transitivity).
A graph is vertex-transitive if for any two vertices , there exists an automorphism such that .
We now state a folklore idea that will be key to our analysis of the Rubik’s cube graph.
Lemma 9.
Every Cayley graph is vertex-transitive, and in particular, the Rubik’s cube graph is vertex-transitive.
Proof.
Let be a group and a set of generators. We must prove that there is an automorphism such that for any two vertices . Let us define
This definition directly implies , and is clearly bijective since is an inverse for . It remains to prove that for any two vertices , we have that if and only if . Where, by definition of the Cayley graph, a pair of vertices is in if there exists a generator such that , and equivalently, if . Now observe that
from where we conclude by noting that
We conclude this section with a simple lemma stating that in a vertex-transitive graph, given that all nodes are “essentially the same”, we can think of the mean distance as the average distance from a fixed node, instead of between all pairs.
Lemma 10.
Let be any vertex in a vertex-transitive graph . Then we have
Proof.
First, note that by definition of mean distance, and using , we have
Because of vertex-transitivity, for any vertex , there exists an automorphism such that . Therefore, using Lemma 7, we have
But as is a bijection for every , we have and thus
3 The Relationship Between Diameter and Mean Distance
In this section, we explore the relationship between the diameter and the mean distance of a graph, and show that for vertex-transitive graphs the diameter is at most twice the mean distance. While this result is implied by [7], we offer a more elementary exposition.
First, let us note that in arbitrary graphs, the diameter can be much larger than the mean distance .
Proposition 11 (Folklore, cf. [22]).
For every , there are graphs on vertices such that .
Proof.
We can construct a graph by taking a clique on vertices and attaching to it a path on vertices, as illustrated in Figure 3.
The diameter of this graph is . Noting that , the mean distance can be calculated as follows:
Furthermore, Wu et al. proved that this bound is asymptotically tight, meaning that [22]. It turns out, however, that such a gap between and is not possible in vertex-transitive graphs, where and are always a constant factor away.
Theorem 12.
For any vertex-transitive graph of diameter and mean distance we have .
Proof.
Let be any pair of vertices such that , and use Lemma 10 to write
| (1) |
from where
| (Triangle inequality) | ||||
We can see that this is tight by considering a cycle on vertices, where and using Lemma 10,
Similarly, for the hypercube graph , we have and
In fact, we can prove a general result that encompasses both of the previous examples: a class of graphs that is even “more symmetric” than vertex-transitive have . Let us introduce the required definitions.
Definition 13 (Distance Transitivity).
A graph is distance transitive, if for every (not necessarily distinct) four vertices with , there exists an automorphism of such that and .
Note that vertex-transitivity implies distance-transitivity (by taking and ), but the converse is not true.
Definition 14 (Antipodal graphs).
Given a graph of diameter , we say a vertex is antipodal to a vertex if . A graph is said to be antipodal if for every vertex there exists exactly one vertex that is antipodal to .
We can now state the following result, whose proof is presented in Appendix B to avoid disrupting the flow of the main text.
Theorem 15.
Let be an antipodal distance-transitive graph of diameter and mean distance . Then,
4 The Demigod Number for the Rubik’s Cube
Theorem 12 allows us to translate upper bounds for the average distance into upper bounds for the diameter. This is particularly useful, as the average distance is easier to certify with high confidence than the diameter. In order to provide an upper bound of the average distance we will follow the following strategy:
-
We will sample a large number (500 000) of uniformly random states of the Rubik’s Cube.
-
For each state, we use an efficient solver333We use https://github.com/efrantar/rob-twophase since it was the fastest solver we could find online. to obtain an upper bound on the distance, which is certified by the move sequence that the solver outputs.
-
We use a simple concentration bound to argue that the empirical average of the distances is a good estimate of the true average distance.
Indeed, let us prove Theorem 1 right away, after which we will explain the precise methodology used to efficiently obtain a diameter upper bound with high confidence. Besides Theorem 17, we need the following standard concentration inequality.
Lemma 16 (Hoeffding’s inequality).
Let be independent random variables, all with expectation , and such that . Then, if , we have for every that
Theorem 1. [Restated, see original statement.]
Given a state of the Rubik’s Cube, let be the distance from to the solved state. Let be a set of states of the Rubik’s Cube sampled uniformly at random, and let be the random variable corresponding to the average distance between states in and the solved state. Then, if denotes the diameter of the Rubik’s Cube, we have
Proof.
Let be the Rubik’s Cube graph, which is vertex-transitive by Lemma 9. Let denote the vertex of corresponding to the solved state. Then, let be i.i.d random variables corresponding to the distance between a uniformly random vertex of and . Using Lemma 10 we have , and by Lemma 2, we have that . Also, . Therefore, applying Lemma 16 with , we get
As by Theorem 12, we conclude
4.1 Randomly sampling cubes
To obtain our estimates on and to determine we need an effective procedure for sampling states of the Rubik’s Cube uniformly at random. While in a general Cayley graph this is not necessarily efficient, with the study of mixing times of random walks being a hairy problem, the particular structure of the Rubik’s Cube allows us to sample uniformly at random in a very efficient way.
Indeed, imagine that we take out all 20 (8 corner pieces, 12 edge pieces) non-center “cubies”444A cubie is a rather standard term to denote one of the pieces of physical Rubik’s cube, which involves two stickers if it is an edge, and three if it is a corner. of the Rubik’s Cube and rearrange them into a new cube. The following theorem states under what conditions such a rearrangement is a valid state of the cube (i.e., a state that can be reached from the solved state through legal moves).
Theorem 17 (Fundamental Theorem of Cubology, [14, Theorem 20.2.1], [15]).
A rearrangement of the cubies is valid if and only if
-
The permutation of the corners has the same parity as the permutation of the edges. (See [14, Theorem 20.2.1] for a formal definition)
-
The number of corners that are oriented clockwise equals the number of corners that are oriented counterclockwise modulo three. (See Figure 4c for an example of corner orientation.)
-
The number of flipped edges is even. (See Figure 4a for an example of flipping an edge.)
Interestingly, Theorem 17 implies an efficient algorithm for sampling. Consider the following three non-valid operations in the cube:
Performing these three operations leads to 12 cube configurations (there are 2 choices for flipping the edge, 2 choices for swapping the corners, and 3 choices for turning the corner). Theorem 17 implies that out of these 12 configurations, exactly one of them is valid, no matter the state the rest of the cube is in. Thus, the algorithm that reassembles the cube at random and rejects invalid states by Theorem 17, takes (in expectation), 12 reassembles to uniformly sample a state of the cube. Furthermore, the algorithm that reassembles the cube at random and fixes an invalid state by performing the three operations of Figure 4 takes only 1 re-assembly of the cube to sample uniformly.
In summary, while disassembling a Rubik’s Cube and reassembling into the solved state is considered a rather lame way of solving the cube, reassembling it randomly (and fixing the state if it is invalid) is an efficient way to sample uniformly at random from the cube.
Finally, note that, by vertex-transitivity, sampling a random pair in the cube has the same distance distribution as sampling one state of the cube and giving the distance to a fixed state. We will use the solved state as the fixed state in our computations and experiments.
4.2 Experimental results
Using the aforementioned methodology, we sampled 500 000 uniformly random states of the Rubik’s Cube. Out of these, no state required more than moves to be solved, and the empirical mean distance obtained was . The process took under hours on a personal computer (MacBook Pro M3, 36 GB of RAM, cores). A histogram is displayed in Figure 5. Our experiments can be found in https://github.com/bsubercaseaux/RubikDemiGodNumber/.
4.3 Obtaining the Demigod’s number
While Theorem 1 already provides us with a way of obtaining an upper bound for the diameter, its sample complexity is not very practical. To obtain a probability of error of, say, , we could set
from where running a solver on each sample for seconds, on parallel threads, would take a couple of days. Getting to a probability of error of would require about a year. Therefore, we now apply a simple method to reduce the sample complexity. We begin by showing that it is highly unlikely that many states of the cube are “far apart”. To this end, we say that a pair of states of the cube is “far apart” if their distance is 21 or more, otherwise, we say that the states are “close”. We then consider the following statement:
| (2) |
If is true, then by sampling enough pairs of states at random we would expect to observe a pair of states that are far apart. We formalize this idea in the following lemma whose proof is straightforward.
Lemma 18.
If the statement (from (2)) is true, then the probability of sampling pairs of cube states uniformly at random and observing 0 pairs of states that are far apart is at most .
We now consider the mean distance between close vertices, ; that is,
Moreover, we consider the empirical mean between close vertices, which we denote by ; that is, we sample pairs at random, compute the distance, discard the results whenever the pairs are far apart, and average the results. Then, we can use Lemma 16 with to state that and are close to each other with high probability, obtaining the following lemma.
Lemma 19.
Let be the empirical mean distance over samples. Then,
By Lemma 18, if we assume statement , then the probability of observing no pair of states that are far apart when sampling 500 000 pairs of states is at most
However, that is exactly what we observed, and it can be easily certified by exhibiting the sequences of moves that transform one state into the other (included in our supplementary material). Therefore, we have very significant empirical evidence (i.e., confidence interval) for the statement being false. Equivalently, we have empirical evidence for:
| “at most 0.03% of the pairs of states of the cube are far apart.” | (3) |
Furthermore, the empirical mean observed with samples was .
Since by Lemma 19, we have significant empirical evidence that
| (4) |
As , using a union bound, and Theorem 12, the probability of seeing our empirical observations if the Rubik’s Cube diameter were to be or larger, is no more than
and thus we have shown how to obtain a high degree of confidence with relatively few samples. Following this same approach for 90 minutes of computation results in a probability of error of roughly , and thus during a lecture one could convince an audience of a -in- chance that the diameter of the Rubik’s Cube is larger than .
5 Discussion
We have presented a novel approach to bounding the number of moves required to solve any state of the Rubik’s Cube, which relies on three simple aspects of the cube: (i) its vertex-transitivity, (ii) our ability to efficiently sample uniformly random states from it, and (iii) good empirical algorithms. Because these properties extend to a variety of combinatorial puzzles (both to puzzles in the Rubik’s family, such as the Piraminx or the Megaminx, as well as unrelated puzzles like the 15-puzzle on a torus), we expect that this methodology can be used to obtain similar results for other puzzles without spending the computational resources required to fully explore their state graphs. Moreover, while God’s number is known for the cube, it remains widely open for larger puzzles [20] (with a gap larger than by a factor of between lower bound and upper bound already for the cube), where our approach could be useful provided a good algorithm without requiring theoretical guarantees on it. In terms of related work, So Hirata has recently released two interesting papers concerning the diameter of Rubik’s puzzles [8, 9], which attack the problem from different angles; either considering the girth of the cube’s graph or using estimations for its branching factor. On a more theoretical line of work, Demaine et al. proved that computing the diameter of an Rubik’s cube is NP-hard [6]555More in general, computing the diameter of a Cayley graph is NP-hard given a group presentation [3]., and that the diameter of the cube is [5].
A particular characteristic of our approach is that our result has an intermediate epistemic status between a theorem and a heuristic. The situation, more in general, is closely related to the question of how much power randomness gives to computation. In the context of mathematical results, such a question may be phrased as follows:
Are there properties of finite mathematical objects that can only be certified efficiently to a high degree of confidence by probabilistic algorithms, but that we never can be certain of through a short proof?
For instance, consider primality testing; whether a given number is prime or not is a fully deterministic fact, in the same way as the average distance of the Rubik’s Cube graph is. However, in order to practically obtain knowledge of such deterministic facts, we leverage the computational benefit of randomness, which allows us (at least in current practice), to determine facts that otherwise would be out of reach. The cost, however, is the possibility of error in the associated randomized algorithms, which forbids us from claiming to have definite proofs of the facts of interest. As usual, we can get such probability of error to be as small as we deem necessary for convincing ourselves, at a modest computational price, while keeping the curse of never reaching confidence. An interesting (albeit brief) discussion of this general issue can be found in Gil Kalai’s blog [12].
Going back to our case, we have shown that, if one assumes momentarily that the diameter of the Rubik’s Cube graph is larger than , then observing an empirical mean distance of around over samples, none of which required more than moves, has probability under . We encourage the readers to reproduce this computation by themselves, which should take less than a day in any modern computer. We believe this makes an extremely compelling case for the diameter of the Rubik’s Cube graph being at most while using a fraction of the computation required by previous approaches. Moreover, we hope that this same line of attack can be useful for analyzing other puzzles or graphs.
References
- [1] Christoph Bandelow. Inside Rubik’s Cube and Beyond. Birkhäuser Boston, 1982. doi:10.1007/978-1-4684-7779-5.
- [2] Jonathan Borwein and David Bailey. Mathematics by Experiment: Plausible Reasoning in the 21st Century. A K Peters/CRC Press, New York, 2 edition, 2011. doi:10.1201/b10704.
- [3] Jin-Yi Cai, George Havas, Bernard Mans, Ajay Nerurkar, Jean-Pierre Seifert, and Igor Shparlinski. On Routing in Circulant Graphs. In Takano Asano, Hideki Imai, D. T. Lee, Shin-ichi Nakano, and Takeshi Tokuyama, editors, Computing and Combinatorics, pages 360–369, Berlin, Heidelberg, 1999. Springer. doi:10.1007/3-540-48686-0_36.
- [4] JJ Chen. Group theory and the Rubik’s cube, 2004.
- [5] Erik D. Demaine, Martin L. Demaine, Sarah Eisenstat, Anna Lubiw, and Andrew Winslow. Algorithms for solving rubik’s cubes. In Camil Demetrescu and Magnús M. Halldórsson, editors, Algorithms - ESA 2011 - 19th Annual European Symposium, Saarbrücken, Germany, September 5-9, 2011. Proceedings, volume 6942 of Lecture Notes in Computer Science, pages 689–700. Springer, 2011. doi:10.1007/978-3-642-23719-5_58.
- [6] Erik D. Demaine, Sarah Eisenstat, and Mikhail 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, February 28 to March 3, 2018, Caen, France, volume 96 of LIPIcs, pages 24:1–24:13. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPIcs.STACS.2018.24.
- [7] Mark Herman and Jonathan Pakianathan. On the distribution of distances in homogeneous compact metric spaces. Topology and its Applications, 193:97–99, 2015. doi:10.1016/j.topol.2015.06.011.
- [8] So Hirata. Graph-theoretical estimates of the diameters of the Rubik’s cube groups, 2024. doi:10.48550/arXiv.2407.12961.
- [9] So Hirata. Probabilistic estimates of the diameters of the Rubik’s cube groups, 2024. doi:10.48550/arXiv.2404.07337.
- [10] Nathan Jacobson. Basic Algebra I. Dover Books on Mathematics. Dover Publications, Mineola, NY, 2 edition, June 2009.
- [11] JPerm. Learn How to Solve a Rubik’s Cube in 10 Minutes (Beginner Tutorial). https://www.youtube.com/watch?v=7Ron6MN45LY, 2019. [Accessed 03-08-2024].
- [12] Gil Kalai. The probabilistic proof that is a prime: a revolutionary new type of mathematical proof, or not a proof at all? https://gilkalai.wordpress.com/2021/04/22/the-probabilistic-proof-that-2400-593-is-a-prime-a-revolutionary-new-type-of-mathematical-proof-or-not-a-proof-at-all/, 2011. [Accessed 23-04-2025].
- [13] Herbert Kociemba. Close to God’s algorithm. In Cubism for Fun, pages 10–13, 1992.
- [14] James T. Mulholland. Math 302: Combinatorial mathematics. http://www.sfu.ca/˜jtmulhol/math302/notes/302notes.pdf. [Accessed 08-08-2024].
- [15] James T. Mulholland. Permutation puzzles - Rubik’s cube. https://www.sfu.ca/˜jtmulhol/math302/puzzles-rc-cubology.html. [Accessed 08-08-2024].
- [16] G. Polya. Mathematics and Plausible Reasoning, Volume 1: Induction and Analogy in Mathematics. Princeton University Press, 1954. doi:10.2307/j.ctv14164db.
- [17] Tomas Rokicki, John Dethridge, Herbert Kociemba, and Morley Davidson. God’s Number is 20. https://www.cube20.org/. [Accessed 08-08-2024].
- [18] Tomas Rokicki, John Dethridge, Herbert Kociemba, and Morley Davidson. God’s Number is 26 in the Quarter Turn Metric. https://cube20.org/qtm/. [Accessed 08-08-2024].
- [19] Tomas Rokicki, Herbert Kociemba, Morley Davidson, and John Dethridge. The Diameter of the Rubik’s Cube Group Is Twenty. SIAM Review, 56(4):645–670, 2014. doi:10.1137/140973499.
- [20] Speedsolving.com Wiki. God’s Algorithm - Optimal solutions of the Rubik’s Cube. https://www.speedsolving.com/wiki/index.php/God%27s_Algorithm#Table_of_God.27s_Numbers, 2024. [Accessed 06-08-2024].
- [21] Douglas B. West. Problems in Graph Theory and Combinatorics. http://dwest.web.illinois.edu/openp/. [Accessed 02-08-2024].
- [22] Baoyindureng Wu, Guojie Liu, Xinhui An, Guiying Yan, and Xiaoping Liu. A conjecture on average distance and diameter of a graph. Discrete Mathematics, Algorithms and Applications, 03(03):337–342, 2011. doi:10.1142/S1793830911001255.
Appendix A The Beginner’s Method and the “Human’s Number”
In order to make this article self-contained, we provide a brief overview of the “beginner’s method” to solve the Rubik’s Cube666We encourage, nonetheless, the interested reader to look into the many YouTube videos (e.g., [11]) that guide the process. , from which we have the following:
Lemma 2 (Human’s Number). [Restated, see original statement.]
Any position of the Rubik’s Cube can be solved in at most 205 moves.
In a nutshell, the beginner’s method consists of solving the Rubik’s Cube by “layers”, as opposed to by faces. Before we begin with its exposition, however, it is worth establishing some notation for the different Rubik’s Cube moves. We will use “Singmaster” notation, credited to British mathematician David Singmaster. To specify a turn on a face, we use the first letter of the face’s name: R for the right face, L for the left face, U for the upper face, D for the down face, F for the front face, and B for the back face. If the face is to be rotated by clockwise, we add no suffix, e.g., R means a clockwise rotation by of the right face. For a counterclockwise rotation by , we add a prime symbol, e.g., D’ means a counterclockwise rotation by of the down face. For a rotation, we add a after the letter, e.g., F2 means a rotation of the front face. A proper formalization of what a “move” actually is can be found in Section 2, where we view the Rubik’s Cube as a group. As an example to check our understanding of the notation, the non-commutativity of the Rubik’s Cube group is evidenced in Figure 6.
Step 1: The white cross
The first step consists of creating a “cross” on one face of the cube, which we will assume to be white without loss of generality. To achieve this, one must move every white “edge” (i.e., a piece with two colors) to the correct position. That is, e.g., the white-orange edge must be placed so that its white sticker is adjacent to the white center and its green sticker is adjacent to the orange center. We illustrate the result of this step in Figure 7, and a conservative bound is that this can always be achieved in 20 moves, as each of the 4 white edges to place can always be placed in at most 5 moves or fewer. This step can be done intuitively, that is, without memorizing any particular algorithm777In the Rubik’s Cube literature, a move sequence with a concrete purpose (e.g., permuting 3 corner pieces) is traditionally called an “algorithm”..
Step 2: White corners
The second step consists of placing the white corners in their correct position, one by one. To place a white corner, one can first bring it to the opposite layer (i.e., the bottom layer, whose center is yellow), and then proceed according to a handful of cases, one of which is illustrated in Figure 9. The result of this step is illustrated in Figure 8. Conservatively, this step can always be achieved in 15 moves per corner, and 60 in total. This accounts for the cases when a white corner is in the correct location but oriented incorrectly, in which case a non-white corner can be placed in that spot, thus allowing the white corner to be placed in the correct orientation afterward.
Step 3: Edges of the second layer
The third step consists of placing the edges of the second layer in their final position, as illustrated in Figure 10. For instance, the orange-green edge must be placed so that its orange sticker is adjacent to the orange center and its green sticker is adjacent to the green center. The main algorithm to solve this step is illustrated in Figure 11. A conservative bound, again due to cases in which a misoriented edge must be first replaced before placing it in the correct orientation, is 20 moves per edge.
Step 4: The yellow cross
We now turn our attention to the yellow face. The goal of this step is to solve the orientation of the yellow cross, that is, to make all yellow edges have their yellow sticker adjacent to the yellow center, as depicted in Figure 12(d). We may face three different scenarios in this step (if it is not already solved), as illustrated in Figure 12. These can all be solved by the same algorithm, potentially repeated according to which of the three non-solved cases we encounter. The algorithm is simply: FRUR’U’F’. Applying it from case 12(a) leads to case 12(b), and applying it again leads to case 12(c), from where a last application solves the yellow cross. That way, we need at most 3 applications, leading to a conservative bound of 18 moves for this step.
Step 5: Permuting yellow edges
Now, we permute the yellow edges so that each of them gets to its desired position. This step can be solved by repeated application of a single algorithm, that induces a -cycle of the yellow edges, as illustrated in Figures 14(b) and 13. As this algorithm is applied at most times, we have a conservative bound of 21 moves for this step.
Step 6: Permuting yellow corners
This step is analogous to the previous one but over the corners; we permute the yellow corners so that each of them gets to its desired position. This step can also be solved by repeated application of a single algorithm, that induces a -cycle of the yellow corners, as illustrated in Figures 14(a) and 15. This algorithm is applied at most times, leading to a conservative bound of 24 moves for this step.
Step 7: Orienting yellow corners
The last step consists of orienting the yellow corners, which again can be achieved by repeated applications of a single algorithm that changes the orientation of two adjacent corners (illustrated in Figure 16):
RU2R’U’RU’R’L’U2LUL’UL.
This algorithm needs to be applied at most times, leading to a conservative bound of 42 moves for this step.
The following table summarizes the “proof” of Lemma 2:
| Step | Moves |
|---|---|
| White cross | 20 |
| White corners | 60 |
| Edges of the second layer | 80 |
| Yellow cross | 18 |
| Permuting yellow edges | 21 |
| Permuting yellow corners | 24 |
| Orienting yellow corners | 42 |
| Total | 205 |
Appendix B Proof of Theorem 15
Before the proof, we will need a couple of auxiliary observations. Given that distance-transitive graphs are vertex-transitive, we already have by Theorem 12. Therefore, it will suffice to prove that , and then use that must be an integer.
For a graph , and vertex , let be the set of vertices at distance exactly from .
Lemma 20.
Let be an antipodal distance-transitive graph, and any vertex. Then, for every , we have
Proof.
Let be the only vertex antipodal to . As distance transitivity implies vertex transitivity, we have by Lemma 7, that for all . Therefore, our goal is to show that for all . Indeed, fix any , and let be an arbitrary vertex such that . Then, let be an arbitrary vertex that is in some shortest path between and , and such that . Note that as is in a shortest path between and , we have . Now, due to distance transitivity, there exists an automorphism of such that , and . By Lemma 7, we have that
and we claim that . Indeed, since , we know that is antipodal to , and as is antipodal to , we have since is antipodal. Therefore, we have , and thus . As was arbitrary, we have . Because the previous argument is symmetric in and , and can be used with instead of , we have , and thus . This concludes the proof.
We are now ready to prove Theorem 15.
Proof of Theorem 15.
Fix any vertex . Using Lemmas 10 and 20, we have
But we also have
and therefore
from where we can easily conclude. Indeed, implies . Since is an integer, this implies , and by Theorem 12, we have
Hence, is an integer such that , and thus we conclude .
