CUBE ROOM / MATHEMATICS

43 quintillion positions,
never more than 20 moves away.

Treat every position as a point and every turn as an edge, and the cube becomes a graph. On the left is the cube; on the right are its 54 stickers spread onto one disc. Turn once, and each dot slides along the path it really travels.

Scramble it, and watch it find its way back

One position, drawn two ways. Each arc is the orbit a sticker travels when that face turns; the six dots at the centres never move. Scramble it, let the solver find a path, then decide for yourself: one move at a time, or all the way home.
43,252,003,274,489,856,000positions
20moves: God’s number, half turns counted as one
18edges: the neighbours of any position
6centre dots that never move

43 quintillion positions, from one careful count

A cube is eight corner pieces, twelve edge pieces and six centre pieces. The six centres never move relative to one another — they are what defines where each colour belongs — so a position is decided entirely by where the corners and edges sit and which way they face.

  • The 8 corners can be arranged in 8! ways. Each has 3 orientations, but the last corner's orientation is fixed by the other seven, which gives 3⁷.
  • The 12 edges can be arranged in 12! ways. Each has 2 orientations, and again the last one is decided by the rest, which gives 2¹¹.
  • Corner and edge permutations cannot change parity independently, so the total is halved.
8! × 3⁷ × 12! × 2¹¹ ÷ 2 = 43,252,003,274,489,856,000

That is 43.25 quintillion, about 4.33 × 10¹⁹. Another way to feel it: if you had started at the Big Bang and tried one position every second, you would have seen about one per cent of them by now.

Memorising the number is not the point. What it tells you is that no amount of trying things out will ever solve a cube. Only structure will.

Every position is a point, every turn is an edge

Treat each position as a point and each turn as an edge joining two points, and the cube becomes a graph. Mathematics has a name for it: a Cayley graph — group elements as vertices, generators as edges.

  • Vertices: 43,252,003,274,489,856,000 positions.
  • Edges: from any position, 18 edges lead to 18 neighbours. Six faces, each turned 90° one way, 90° the other, or 180°.
  • Solving: not “put red next to red”, but walking from where you are to the single point called solved.

This graph is vertex-transitive: seen from any vertex, the whole graph looks the same. So how hard a position is has nothing to do with how messy it looks, and everything to do with one number — its distance from the end.

The picture above is not that Cayley graph, which is far too large to draw. It is the same position seen another way: all 54 stickers spread out on one disc, so you can watch which of them move on a turn, and along which path.

God's number: the graph has diameter 20

The diameter of a graph is the longest of all the shortest paths between its points. In 2010, Tomas Rokicki, Herbert Kociemba, Morley Davidson and John Dethridge proved that this graph has diameter 20.

That is a strong statement. However badly a cube has been scrambled, a path of at most 20 turns leads back to solved. No position needs 21.

  • A “turn” here means turning one face by 90° or 180°, with a half turn counted as one move — the half-turn metric. Count a half turn as two moves instead and the answer is 26, proved in 2014.
  • The proof did not examine 4.3 × 10¹⁹ positions one by one. The positions were grouped into cosets of a subgroup, the cube's own 48 symmetries cut the work down to roughly 56 million groups, and about 35 CPU-years of idle time donated by Google finished the job.
  • Statistically, almost every position needs 17 or 18 moves. Positions that genuinely require all 20 are rare.

One distinction is worth keeping: knowing that a path of 20 moves exists is not the same as finding it. The first is settled; the second still takes a search, for every position you meet.

A computer does not start with the white cross

The layer-by-layer method people learn is a route that is easy to remember, not a route that is short. Computers take a different one, most often Kociemba's two-phase algorithm.

It begins by defining a subgroup G₁ = ⟨U, D, L², R², F², B²⟩, in which the four side faces may only be turned by 180°. There are 19,508,428,800 positions inside G₁.

  1. Phase one ignores how the colours look and only drives the cube into G₁: every piece turned the right way up, and the four middle-layer edges back in the middle layer. The space that actually has to be searched here holds 2,217,093,120 states — about two billion, a twenty-billionth of the whole cube.
  2. Phase two stays inside G₁ and reaches the end using only those ten restricted turns.

The two-phase algorithm usually returns a solution of around 20 moves within milliseconds. Note what it promises: a short solution, not the shortest one. Proving that a particular position cannot be solved in fewer moves needs a heavier search.

What this means if you are still learning

It does not mean you should be memorising a 20-move solution. Quite the opposite:

  • Layer-by-layer usually takes 50 to 100 moves. It is far longer than the theoretical best because it trades moves for memory, cutting a problem with 4.3 × 10¹⁹ answers into six stages a person can actually hold.
  • An algorithm is not a spell. It is a path that changes one small region and puts everything else back where it was. Understanding why it protects the part you already finished is worth more than one more sequence learned by heart.
  • When you get stuck, the problem is almost never speed. It is that the position in front of you does not meet the conditions the algorithm assumes.

Moving from remembering moves to reading structure is the stretch this site is built to help with.

How the picture is drawn

The drawing is not decoration. It is the same object as the cube beside it.

The 54 dots are the 54 sticker positions, and a dot's colour is the colour of whichever sticker is sitting there now. Stand at the corner you are looking at and face outwards: the three faces meeting that corner (up, right, front) are gathered on an inner ring, the three faces behind are spread on an outer one, and the six clusters sit 60° apart, so all six faces stay visible at once.

Turn a face and 20 stickers change places along five four-cycles. Every circle in the drawing is the orbit of exactly one of those cycles: its four dots lie on that circle, and a turn slides each of them one place forward around it. The 30 circles were fixed first and the 54 dots solved for afterwards — a square 3x3 grid cannot put every cycle on a circle, so each cluster is sheared a little, and in exchange every arc is true. The worst a dot misses its circle by is a thousandth of a pixel, and that comes only from rounding the coordinates when they were written to file.

Press R: the five circles that belong to R light up, and only the 20 dots of the R layer move. The six dots at the centres never move at all, because a centre piece never leaves its place; that is the same fact as “the centres define where each colour belongs”.

The solver on this page

That every position is at most 20 moves from solved is a proven fact, but for any particular position the path still has to be found. This page carries a two-phase solver that runs entirely in your browser and sends nothing anywhere.

It does not demonstrate itself. When the figure comes into view it does three things and no more: warm the solver in the background, fetch the three-dimensional cube, and start the slow spin. Scrambling and solving both wait for you to press a button.

  1. Press Scramble: the cube takes 20 random turns, about 210 milliseconds each, and then stops.
  2. Press Solve: the solver finds a path of around 20 moves within tens of milliseconds — and then stops there, without walking a single step of it. What it promises is a short path, not the shortest one.
  3. That pause is yours. The path strip splits the solution at the join the solver reports: the first stretch drives the position into G₁, the last uses only U, D and the four half turns. On the cube, the layer that moves next is outlined in orange, and on the state map the five circles belonging to that face light up at the same time — a preview only, with not one of the 54 dots moving. The moves stay folded except for the next one, and each step you take reveals one more; press Show the moves to open the whole path at once.
  4. Then you decide how to finish it: One move walks a single turn, about 430 milliseconds; Back one move undoes it so you can think again, keeping the plan as it was; Run to the end plays the rest straight through, and you can pause and resume whenever you like.

You are also free to ignore the plan. Open Turn it yourself, turn any face, and the solver replans from the new position, saying what you turned and how long the new path is. It never treats that as a mistake — turning it yourself is exactly what this drawing is for. The path it finds has nothing to do with the order you scrambled in: turn a few faces, then watch it choose a different way home.

The first time the solver is needed it builds the tables described above in the background — the move tables for orientation and the middle layer, and the pruning tables — in a second or two, and the readout says it is preparing while that happens.

Colours and turns come from the same model as the 3D cube in the practice area and are cross-checked sticker by sticker against an independent cube model; every path the solver produces is replayed on that same model to confirm it.

CUBE ROOM / PRACTICE

Now, make it click.

The 3D cube in the practice area runs the same model as this diagram. See what one turn changes here, then go and do it.

Open the exercise →

Sources and further reading

Cube Room wrote this guide around its own practice examples. The sources below help verify basic concepts or provide further study; this is not a verbatim translation of their material. Cube Room is not affiliated with these providers.