No. 1 · optimal3 × 3 × 3

drag to look around · s scramble · urfdlb turn (shift back) · enter solve · ? the moves explained · space next step · p play · 1-4 a way to solve it

El cubo deEdgar

Scramble it, or turn its faces yourself. The solver tries every sequence of moves, the short ones first, until one solves it: so the way back it shows you is the shortest there is. Then take it one turn at a time.

The group theory under it

The moves of a cube form a group: any two make a third, and each can be undone. The solver's shortcuts rest on these laws about it, written in Bend and proved in Bend: its checker accepts every proof, and so does BendTT's kernel (bend PROOF.bend --verdict).

  1. Four quarter turns are none. U⁴ = 1, for every face.proved
  2. Every move can be undone. R R′ = 1, for every face and every turn.proved
  3. Two turns of one face are one. Rᵃ Rᵇ = Rᵃ⁺ᵇ, so a shortest solution never turns a face twice in a row, and the search never tries it.proved
  4. Opposite faces commute. U D = D U, so the search tries the two in one order only.proved
  5. Other faces do not. R U ≠ U R: the group is not commutative.proved
  6. What a move keeps. Every move twists the corners by 0 in all (mod 3), flips the edges by 0 in all (mod 2), and moves corners and edges with the same parity.proved
  7. Famous orders. (R U R′ U′)⁶ = 1 and (R U)¹⁰⁵ = 1.proved
  8. One scramble commutes with every move. The superflip, every edge flipped in place: X R = R X for every move, so X commutes with every cube.proved
  9. Any first move. The search may begin with every one of the 18 moves, and after a face it skips only that face and, for U, R and F, the face across.proved

The solving happens on your device, in Bend compiled to JavaScript, on one Web Worker for each of its cores. First a quick search (Kociemba's two-phase algorithm) finds a short way back, about 20 moves, in a second or two. Then the shortest is looked for, and only lengths below the short way's need searching: once they all have no solution, the short way is a shortest one. Why the first solution found is a shortest one: the search is Korf's (1997) IDA*. Each bound on the length is searched in full, its subtrees shared out among the workers, and a branch is cut only when a table proves it cannot finish in time: one table for the corners (88 million positions) and one each for two sets of six edges (43 million each), fetched once and kept by your browser. Every cube is at most 20 moves from solved. A phone or a laptop proves the shortest for cubes up to about 14 or 15 moves from solved in seconds; a fully random cube (17 or 18) takes it longer than the 240 s it gets, and then the page gives the short way, says it may not be the shortest, and how far the search got.

How the moves work

Each button turns one face of the cube. Hold the cube so that you look straight at that face: the letter alone turns it a quarter turn clockwise.

R a quarter turn clockwise
R' a quarter turn counter-clockwise
R2 a half turn (either way: the same)

The six letters are the six faces, named after where they are as you hold the cube:

A face's color is the color of its center square, which never moves. In the picture the cube shows its up face (white) on top, its front (green) at the left and its right face (red) at the right; drag it to look at the others. Clockwise is always as seen from that face's own side, so from the front, B looks counter-clockwise, and D turns the other way to U.

In a solution, the moves are done in order, left to right: R U R' is R, then U, then R'.

On a keyboard: u r f d l b turn a face clockwise; with shift, counter-clockwise.

Enter your own cube

Your cube's colors:

Hold your cube with its white center on top and its green center facing you. Pick a color, then tap each sticker that has it (the centers are fixed): the net is your cube unfolded, white on top, then orange, green, red and blue, then yellow. Or let the camera read it: six photos, a face each, then fix what it got wrong here.

Your cube's colors

Not every cube has the same colors. Pick the one like yours: the cube here, the panel to enter yours, and the camera's instructions all use it. To tell them apart, hold yours with white on top and green facing you, then look at the right face, and the bottom.

None of these? Pick each face's color

Hold your cube any way, and pick the color of each center. A color another face has swaps with it.

Now: Standard. Kept on this device.