God's Number is 20

Every position of Rubik's Cube™ can be solved in twenty moves or less.

With about 35 CPU-years of idle computer time donated by Google, a team of researchers has essentially solved every position of the Rubik's Cube™, and shown that no position requires more than twenty moves. We consider any twist of any face to be one move (this is known as the half-turn metric.)

Every solver of the Cube uses an algorithm, which is a sequence of steps for solving the Cube. One algorithm might use a sequence of moves to solve the top face, then another sequence of moves to position the middle edges, and so on. There are many different algorithms, varying in complexity and number of moves required, but those that can be memorized by a mortal typically require more than forty moves.

One may suppose God would use a much more efficient algorithm, one that always uses the shortest sequence of moves; this is known as God's Algorithm. The number of moves this algorithm would take in the worst case is called God's Number. At long last, God's Number has been shown to be 20.

It took fifteen years after the introduction of the Cube to find the first position that provably requires twenty moves to solve; it is appropriate that fifteen years after that, we prove that twenty moves suffice for all positions.

A History of God's Number

By 1980, a lower bound of 18 had been established for God's Number by analyzing the number of effectively distinct move sequences of 17 or fewer moves, and finding that there were fewer such sequences than Cube positions. The first upper bound was probably around 80 or so from the algorithm in one of the early solution booklets. This table summarizes the subsequent results.

How We Did It

We partitioned the positions into 2,217,093,120 sets of 19,508,428,800 positions each.

We reduced the count of sets we needed to solve to 55,882,296 using symmetry and set covering.

We did not find optimal solutions to each position, but instead only solutions of length 20 or less.

We wrote a program that solved a single set in about 20 seconds.

We used about 35 CPU years to find solutions to all of the positions in each of the 55,882,296 sets.

Partitioning

Symmetry

Good vs. Optimal Solutions

Random positions Cosets of H Optimally 0.36 2,000,000 20 moves or less 3,900 1,000,000,000 Solution rate, in positions/second Fast Coset Solving Program Using a combination of mathematical tricks and careful programming, we were able to solve a complete coset of H, either optimally, or with sequences of twenty moves or less, on a single desktop PC, at the rates shown in the table at left. An optimal solution to a position is one that requires no more moves than is required. Since a position that required 20 moves was already known, we did not need to optimally solve every position; we just needed to find a solution of 20 moves or less for each sequence. This is substantially easier; the table at left show the rate a good desktop PC has when solving random positions.Using a combination of mathematical tricks and careful programming, we were able to solve a complete coset of H, either optimally, or with sequences of twenty moves or less, on a single desktop PC, at the rates shown in the table at left.

Lots of Computers

What are the Hardest Positions?

Distance Count of Positions 0 1 1 18 2 243 3 3,240 4 43,239 5 574,908 6 7,618,438 7 100,803,036 8 1,332,343,288 9 17,596,479,795 10 232,248,063,316 11 3,063,288,809,012 12 40,374,425,656,248 13 531,653,418,284,628 14 6,989,320,578,825,358 15 91,365,146,187,124,313 16 about 1,100,000,000,000,000,000 17 about 12,000,000,000,000,000,000 18 about 29,000,000,000,000,000,000 19 about 1,500,000,000,000,000,000 20 about 490,000,000

Distance-20 positions are both rare and plentiful; they are rarer than one in a billion positions, yet there are probably more than one hundred million such positions. We do not yet know exactly how many there are. The table on the right gives the count of positions at each distance; for distances 16 and greater, the number given is just an estimate. Our research has confirmed the prior results for entries 0 through 14 below, and the entry for 15 is a new result, which has since been independently confirmed by another researcher.

To date we have found about twelve million distance-20 positions. The following position was the hardest for our programs to solve:

Source Released

Known Distance-20 Positions Released

Site Content

Contact

Rubik's Cube is a registered trademark of Seven Towns, Ltd.

Thanks to Lucas Garron for writing the Cube animator on this page.