Mathematics: combinatorial group theory
God's Number — across every WCA puzzle
God's number is the maximum, over all states, of the minimum moves to solve. Formally it is the diameter of the Cayley graph of the puzzle group G with generator set S. Below, every WCA puzzle is listed with its exact diameter or current bounds.
20
3×3 HTM diameter (exact)
Rokicki et al. 2010
26
3×3 QTM diameter (exact)
Rokicki & Davidson 2014
35 CPU·yr
Google compute spent on the proof
55.88M cosets · 4.3×1019 states
Θ(N2/logN)
N×N God's number asymptotic (Demaine 2011)
arXiv:1106.5736
Reading roadmap
The page has 13 sections, each readable in isolation. Below: a 'first-time' linear path and a 'by interest' jump-table.
First read (~15 min)
- Primer — understand the four words: group / generators / Cayley graph / diameter
- Metrics — see why HTM ≠ QTM ≠ STM
- 17-puzzle grid — scan: which are proven, which are bounded
- Superflip — see what the "hardest" state actually looks like
- Rokicki proof animator — 7 frames: what those 35 CPU-years actually computed
Jump by interest
- Math Compression chain → Subgroup chain → IDA*
- Algorithm IDA* tree → Two-phase demo → 8 algorithm cards
- Hands-on Two-phase demo → 2×2 BFS → IDA* slider
- History Proof animator → Timeline → References
- Data Distance distribution → 17-puzzle grid → Growth chart
- Open Open problems → 4×4 / Megaminx gap
💡 Tip: hover any formula for KaTeX source; blue "interactive" cards reward clicking.
Two-minute group-theory primer
1. A cube is a group
Every legal state is a permutation: 8 corners (pos + orientation) and 12 edges (pos + orientation) reshuffled. Multiplication = compose two operations. Identity = solved state. Inverse = invert the sequence. All 3×3 states form a group G with ∣G∣=4.3×1019.
2. Generators = "what you can turn"
The six 90° face turns {U,D,L,R,F,B} plus their inverses / doubles form generator set S. Every state is a finite product of elements of S — that's "G is generated by S".
3. The Cayley graph
Make a vertex for each state; draw an edge between two states differing by one generator. This is the Cayley graph Γ(G,S). "Solving" = finding a path from your state to the identity.
4. Diameter = God's number
The maximum, over all pairs of vertices, of the shortest-path length: that's the diameter D(G,S). In other words, worst-case minimum-move count. That's God's number.
5. Lagrange ⇒ coset decomposition
Any subgroup H⊂G partitions G into ∣G∣/∣H∣ disjoint cosets. Kociemba's H=⟨U,D,L2,R2,F2,B2⟩ (∣H∣≈1.95×1010) splits 4.3×1019 states into 2,217,093,120 cosets — solve each once, 10 orders of magnitude saved.
6. Symmetry group S48 ⇒ further squeeze
The cube itself has 48 symmetries (24 rotations × 2 mirror). Two states equivalent under symmetry share a diameter. Quotienting the 2.2B cosets by S48 leaves ~55.88M — the feasibility threshold that made the 2010 proof possible.
Phase algorithms — interactive: Kociemba vs Thistlethwaite
Two main flavours of coset decomposition. Thistlethwaite (1981) splits solving into 4 phases, each freezing one symmetry. Kociemba (1992) simplifies to 2. Below: the subgroup chains side by side, each layer showing ∣Gi∣ + coset count to next + phase worst-case moves.
…
The 2010 proof's compression chain — interactive: 4.3×10¹⁹ down to ~80 super-cosets
The 2010 proof isn't "scan every state". It folds 4.3×1019 states through 4 mathematical layers: Lagrange cosets → cube-symmetry quotient → set-cover compression → per-super-coset IDA* verification. Each layer pulls in a different tool; together they make 35 CPU-years feasible.
…
Two-phase solver — interactive: split a solve into Phase 1 + Phase 2
Pick a scramble and watch how Kociemba's algorithm first pushes the state into the subgroup H=⟨U,D,L2,R2,F2,B2⟩, then solves inside H. The "4 invariant bars" drain to zero exactly when Phase 1 ends — that's the geometric meaning of "entering H".
…
The metric decides the number — interactive: HTM / QTM / STM
God's number is always "graph diameter", but what edges exist depends on what counts as "one move". The three metrics below are the ones you'll see in the literature — click to switch, the example re-counts itself.
…
God's number for every WCA event
Click any card to expand details (algorithm, prover, references). "Proven" cards have exact values; "Bounds" cards show the best known gap, waiting to be closed.
Partition all 4.3×10¹⁹ states into 2,217,093,120 cosets, then shrink to 55.88M via symmetry + set cover. ~35 CPU-years on Google in July 2010 nailed the HTM diameter at exactly 20. The QTM=26 (2014) and STM=18 results followed using the same coset framework.
The cube that gave us "God's number = 20"
The 3×3 group has 4.3252 × 10¹⁹ states (exactly 43,252,003,274,489,856,000). Naïve BFS is impossible — even storing one distance per state would take exabytes. Tomas Rokicki's 2010 victory came from three weapons: coset decomposition, symmetry compression, set cover.
The key subgroup is H = ⟨U,D,L2,R2,F2,B2⟩ — Kociemba's 1992 "P1" or "G1" group. |H| = 19,508,428,800, so |G|/|H| = 2,217,093,120 cosets. Each coset is a set of states reachable from each other inside H; you only need one optimal solution per coset. That reduces a 4.3×10¹⁹-vertex graph to a 2.2-billion-vertex one.
Then apply the 48-element cube symmetry group S48 to crush cosets to 55.88M. Then a greedy set-cover absorbs neighbouring cosets into ~80 super-cosets that are actually solved. Google's cluster spent ~35 CPU-years; on 2010-07-13 they announced: every 3×3 state is solvable in ≤20 HTM, and some (e.g. superflip) actually need 20. Upper = lower = 20. QED.
The QTM result of 26 (2014, Rokicki & Davidson) and STM result of 18 (2014, Rokicki) used the same coset framework. The 3×3 is the cleanest victory in God's-number history: not just the exact value, but also a geometric description of all 12 antipodes at distance 20.
Proved / estimated by:Rokicki · Kociemba · Davidson · Dethridge · 2010
Tiny state graph — your laptop can BFS the whole thing in seconds. Fixing one corner as anchor, the diameter is exactly 11 HTM and 14 QTM. The live BFS demo on this page reproduces it in your browser.
Small enough to BFS overnight
The 2×2 group has only 3.67M states because it has 8 corners and no edges or centres. Fixing one corner (DBL) to kill global rotation leaves 7 movable corners × 6 orientation DoF = 7! × 36 = 3,674,160. A 1981-era PC could BFS the whole Cayley graph in reasonable time.
In HTM the distance distribution peaks around 8-10 moves; only 2,644 states require the full 11. Those 2,644 antipodes can be enumerated — they are literally every "hardest" 2×2 state. In QTM the diameter rises to 14.
Fun fact: the average optimal solution length over all 2×2 states is ≈ 8.76 HTM. One BFS pass gives you this number for free.
Proved / estimated by:community BFS · 1981
Proven exact Bounds only Trivial / parametric
3×3 minimum-solution distribution — interactive: the FMC ceiling
Plot "how many 3×3 states are at distance d (HTM)" and you get the distribution every FMC solver implicitly faces. Rokicki has published exact counts for d=0,…,15; d=16,…,20 are estimates constrained by the total sum 4.3×1019.
…
Superflip — the "hardest" 3×3 state
In 1995 Michael Reid proved superflip needs exactly 20 HTM, pushing the 3×3 lower bound to 20; in 2010 Rokicki's team proved the upper bound is also 20, closing the gap. Below: the 3-D superflip state, two optimal solutions, and a few other distance-20 antipode representatives.
…
N×N growth — interactive: state space vs diameter
Left axis grows double-exponentially (∼10N2); right axis grows polynomially with a log shave. Their ratio is the "difficulty density". Hover an N for exact values.
…
2×2 live BFS — re-prove "diameter = 11" yourself
The 2×2 group has only 3.67M states — a laptop BFSes the whole graph in seconds without symmetry / cosets / GPU. The button below spawns a worker that runs full BFS over the 9 HTM generators (U U2 U' R R2 R' F F2 F') and streams the distance distribution to the chart.
…
How are these numbers actually computed?
Eight real-world techniques, ordered by group size — from "BFS the lot" to "symmetry-quotient your way to feasibility".
BFS
Tiny groups (≤108): plain BFS over the whole graph, 1 byte/state for distance, full distribution + diameter in seconds-to-minutes. The "2×2 live BFS" above is exactly this. Pyraminx, Skewb, Sq-1 (twist) too.
Bidirectional BFS
BFS from both ends, meet in the middle ⇒ search space drops from bd to 2⋅bd/2. Used for Sq-1 twist; the same trick powers many general IDA* solvers.
IDA* + Pattern Database
Mid-sized groups (109–1012): precompute the shortest-solution table for a subset of cubies (e.g. all corners) — a few hundred MB — and use it as an admissible heuristic h(s)≤d∗(s) for the full problem. Iterative Deepening A* + this h crushes plain BFS. Kociemba's P1/P2 tables are the canonical example.
Coset partition + set cover
Huge groups (1019+): split G into ∣G∣/∣H∣ cosets of a subgroup H, solve each independently. 3×3 uses H=⟨U,D,L2,R2,F2,B2⟩, ∣G∣/∣H∣=2.2×109. Then a greedy set-cover packs neighbouring cosets into ~80 super-cosets and you actually solve only those.
Symmetry / antisymmetry reduction
The cube has 48 symmetries (24 rotations × 2 mirrors) plus antisymmetry (inverses are equivalent), 96 total. Equivalent states share their optimal solution length ⇒ solve once, propagate. The 3×3's 2.2B cosets shrink to 55.88M under symmetry — that 40× squeeze is the 2010 proof's enabler.
Disk-based BFS
When ∣G∣ outgrows RAM, batch-write each frontier layer to SSD; cross-layer dedup via external sort + uniq. Sq-1 face-turn (Shuang Chen 2017) used 722 GB — 2 bits/state to fit 1.2×1013 twistable states.
Canonical-sequence counting (lower bound)
Don't solve, just count: legal canonical sequences at depth d are ≤N⋅Md−1 (after rejecting same-axis-as-previous). Megaminx uses a commuting-faces recurrence t(n+1)=36t(n)−240t(n−1)−320t(n−2); set t(d)≥∣G∣ ⇒ lower bound on d. Megaminx 48, 4×4 35 came from here.
Asymptotic construction (Demaine)
Demaine et al. 2011: partition N×N cubies into O(N2/logN) commuting classes; solve each in O(logN) parallel moves. Match with the canonical-sequence Ω(N2/logN) lower bound ⇒ Θ(N2/logN), rigorous. Constants are big; only asymptotic.
IDA* + Pattern Database — interactive: how heuristics prune
A teaching-scale search tree. Switch the "heuristic h(s)" or drag the f-limit and watch subtrees collapse. Green leaf = a distance-8 solution (tree depth cap). Higher prune-rate ⇒ tighter heuristic ⇒ faster search.
…
IDA* + Pattern Database pseudocode
function solve(start):
for depth = 0, 1, 2, ..., 20:
if dfs(start, depth, 0) is not None: return solution
return None // unreachable for 3×3 (we know depth ≤ 20)
function dfs(state, max_depth, g):
h = pattern_db.lookup(state) // admissible: h ≤ true distance
if g + h > max_depth: return None
if state == identity: return [] // solved
for move in legal_moves(state):
if same_axis_as_previous(move): continue
sub = dfs(apply(state, move), max_depth, g + 1)
if sub is not None: return [move] + sub
return NoneOne IDA* call solves one state (milliseconds). Run it on all ~55.88M super-cosets with the assertion ≤20 holds — and the diameter is nailed at 20.
Open problems
Four/five puzzles have no exact diameter to date. For each unfinished gap: why it's hard, what would close it, rough effort estimate.
…
Two milestone proofs — interactive frame-by-frame
The two key "God's number = 20" proofs split into frames: Reid 1995 (lower bound 20, SGI Indigo 90 hours) + Rokicki 2008→2010 (upper bound 20, Google 35 CPU-years). One sentence + one SVG + one formula per frame.
…
Timeline
1974
Ernő Rubik invents the Magic Cube in Budapest as a teaching aid for 3-D structure, spatial reasoning, and combinatorics.
1979
Cube hits commercial shelves; Western mathematicians immediately recognise it as a finite group of order 4.3×1019.
1981
David Singmaster publishes Notes on Rubik's Magic Cube — the first systematic notation (URFDLB) and group-theoretic terminology underpinning everything since.
1981
2×2 / Pyraminx / Skewb BFS feasible on early PCs ⇒ each diameter is 11 (a coincidence across three different groups).
1982
Morwen Thistlethwaite publishes the 4-phase algorithm: G0→G1→G2→G3→{e}, each phase from a precomputed table, capping 3×3 at ≤52 HTM.
1990
Hans Kloosterman tightens the upper bound to 42; several authors that year reach 40-37.
1992
Herbert Kociemba publishes the 2-phase algorithm with H=⟨U,D,L2,R2,F2,B2⟩ (his "P1" / "G1"): 2.2 billion cosets, each ≤30 HTM, total ≤30.
1995
Michael Reid uses computer-assisted enumeration to prove superflip needs ≥20 ⇒ 3×3 lower bound = 20; also proves Kociemba's bound ≤22. The 20/22 gap stands for 15 years.
2005
Mike Masonjones BFS-proves Square-1 twist-metric diameter = 13.
2006
Silviu Radu pushes 3×3 upper bound to 27; Rokicki joins in 2007 and gets it to 26.
2008
Tomas Rokicki uses Sun's 8-GB cluster to drop the upper bound to 22 — finally reaching Reid's 1995 target, but the gap is not closed.
2010
Rokicki · Kociemba · Davidson · Dethridge spend 35 CPU-years on Google: symmetry compresses 2.2B cosets to 55.88M, set-cover absorbs neighbours into ~80 super-cosets, each actually solved. No counterexample. 2010-07-13: 3×3 HTM diameter = 20.
2011
Erik Demaine et al. (arXiv:1106.5736 "Algorithms for Solving Rubik's Cubes") prove N×N God's number is Θ(N2/logN) via parallel sub-algorithms + cubie commuting-class partitioning. The rigorous N×N asymptotic.
2012
Herbert Kociemba proves Megaminx lower bound = 48 HTM via commuting-faces counting.
2014
Rokicki & Davidson prove 3×3 QTM diameter = 26 with the same coset framework; Jakob Kogler proves Rubik's Clock diameter = 12 via front-cross cosets; Rokicki separately proves 3×3 STM diameter = 18. Three new exact diameters in one year.
2017
Shuang Chen (WCA 2008CHEN27) uses 722 GB disk BFS + 3816 symmetry cosets to prove Square-1 face-turn diameter = 31. The first cubing-domain disk-BFS at this scale.
2018
Sebastiano Tronto and Vincent Sheu publish the 4×4 OBTM lower bound ≥35 on SpeedSolving.
2020
Graham Siggins sets the MBLD world record 62/65. MBLD is group-theoretically trivial (diameter 20⋅k); the record is a memory + endurance limit.
2022
Yusheng Du sets 3×3 WR at 4.86s (later tied / surpassed by Yiheng Wang), avg solution ~40 HTM, far above the 20 theoretical optimum.
2024
Merino & Subercaseaux (arXiv:2501.00144) propose a "Demigod's number" — 500k random samples + Hoeffding prove
D≤36 in 5 hours, error probability
<10−10.
Dedicated page.
2025
cube20.org publishes Rubik's Clock full distance distribution as an independent re-verification of Kogler's 2014 proof, 11 years on.
FAQ + glossary
Ten common questions ("why this nickname?", "are WCA scrambles near it?", "can CFOP reach 20?", "how much compute is 35 CPU-years today?"…) plus a group-theory / algorithm glossary.
…