The 3×3×3 Rubik’s Cube is a deterministic permutation puzzle with a very large state space and highly structured transitions. The number of reachable configurations is approximately . [1]
From an algorithmic perspective, cube solving is a shortest-path problem on an implicit state graph:
Rubik’s Cube states can be described by the permutation and orientation of corner and edge cubies, subject to invariants (e.g., parity constraints and orientation sum constraints). These constraints reduce the naive count of permutations and orientations to the reachable set size stated above.[1:1]
The legal moves generate the Rubik’s Cube group, a finite group acting on cubie permutations and orientations.
Korf reports how rapidly the search tree grows with depth under standard pruning rules (e.g., forbidding redundant successive twists). Even at moderate depths the node counts become extremely large, motivating strong heuristics and careful search design (in particular, reducing the effective branching factor).[1:2]
Two move-count conventions are widely used:
Publications must be compared under the same metric: solution lengths can differ substantially between HTM and QTM.[3][4]
Metric note: Korf (1997) reports optimal solutions under a face-turn-style metric (HTM). McAleer et al. (2018) report results in QTM, and explicitly note that cross-metric comparisons can produce apparent outliers.[1:3][4:1]
The literature and practical tooling for cube solving cluster around three families:
The classic optimal approach is iterative deepening A* (IDA*), a linear-space variant of A*. IDA* searches in cost-bounded iterations over , increasing the bound until a goal is found.[5][2:1]
The decisive ingredient is a strong admissible heuristic . Korf’s breakthrough was to use pattern databases (Pattern Databases): precomputed exact distances for carefully chosen abstractions (subproblems). Table lookup then yields admissible lower bounds during search.[6][1:4]
These tables are constructed by running breadth-first search (BFS) backward from the goal within the reduced state space (conceptually aligned with Retrograde Analysis).[1:5]
Korf (1997) builds three large PDBs and combines them using a maximum:
The maximum combination preserves admissibility while strengthening pruning.[1:6]
Korf solved ten random instances optimally; the measured node generations reach into the hundreds of billions to over a trillion nodes for the hardest instances in that sample.[1:7]
A widely used practical baseline is the Kociemba two-phase solver (Kociemba Two-Phase Solver). It decomposes the cube group into two phases by first moving into a restricted subgroup and then solving within it. The method is complete and typically very fast, but it does not guarantee shortest solutions.[7][4:2]
DeepCube couples a learned value/policy model with search. Training is performed without human demonstrations, and planning is performed by a guided tree-search procedure:
In DeepCube, MCTS constructs a search tree rooted at the scrambled cube and uses the network output for guidance:
DeepCube’s implementation uses an asynchronous variant of MCTS and applies a virtual loss mechanism to reduce duplicate exploration across workers operating in parallel.[4:6]
Once a solved node is reached, DeepCube can extract a move sequence in two ways:
McAleer et al. report that DeepCube solves the evaluated fully scrambled cubes within the experiment’s time limit, but with substantial variance in runtimes; the histogram below summarizes the runtime profile for fully scrambled cubes.[4:8]
Compared to group-structure solvers (e.g., Kociemba’s two-phase method), DeepCube’s solve times are less stable; compared to optimal heuristic search baselines, the guided learned planning approach is designed to reduce expansions under a fixed compute budget by focusing search on high-value regions of the state space.[4:9]
DeepCube reports high solve rates under time limits across scramble distances, while greedy or optimal-search baselines degrade sharply under the same budget as scramble difficulty increases.[4:10]
The distributions below illustrate the central trade-off:
| Aspect | IDA* + PDBs (optimal) | Kociemba two-phase (group-based) | DeepCube (ADI + MCTS) |
|---|---|---|---|
| Primary objective | Provable shortest solutions (for a chosen metric) | Fast complete solving | High solve rate under budgets via learned guidance |
| Completeness | Yes | Yes | Yes (as reported in evaluation) |
| Optimality | Yes | No | No (often short, not guaranteed) |
| Guidance signal | Admissible lower bounds from PDBs | Phase constraints + pruning tables | Learned value + policy priors |
| Dominant cost | Online search time at high depths | Engineering + tables, but fast online | Offline training + online MCTS budget |
| Typical behavior | Extremely large node expansions on hard scrambles | Very fast and stable runtime | Variable runtime; small tree expansions relative to optimal search |
Richard E. Korf. “Finding Optimal Solutions to Rubik’s Cube Using Pattern Databases.” AAAI, 1997. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎
Peter E. Hart, Nils J. Nilsson, Bertram Raphael. “A Formal Basis for the Heuristic Determination of Minimum Cost Paths.” IEEE Transactions on Systems Science and Cybernetics 4(2), 1968. ↩︎ ↩︎
Tomas Rokicki, Herbert Kociemba, Morley Davidson, John Dethridge. “The Diameter of the Rubik’s Cube Group is Twenty.” SIAM Review 56(4), 2014. ↩︎
Stephen McAleer, Forest Agostinelli, Alexander Shmakov, Pierre Baldi. “Solving the Rubik’s Cube Without Human Knowledge.” arXiv:1805.07470, 2018. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎
Richard E. Korf. “Depth-first Iterative-deepening: An Optimal Admissible Tree Search.” Artificial Intelligence 27(1), 1985. ↩︎
Joseph C. Culberson, Jonathan Schaeffer. “Searching with Pattern Databases.” Advances in Artificial Intelligence (Canadian AI), Springer, 1996. ↩︎
Herbert Kociemba. “Two-phase algorithm details.” Technical description hosted at kociemba.org. ↩︎
Levente Kocsis, Csaba Szepesvári. “Bandit Based Monte-Carlo Planning.” ECML, 2006. ↩︎
Rémi Coulom. “Efficient Selectivity and Backup Operators in Monte-Carlo Tree Search.” Computers and Games, 2006/2007. ↩︎