Rubik'IA

2016 — Web

Rubik'IA solves a Rubik's cube in about twenty moves. You give it the colours of your real cube by clicking the facelets of the flat net, and it returns the sequence to perform, which it also plays out on the 3D cube.

Solving a cube in as few moves as possible is an expensive problem: there are 43 quintillion positions, and it has been known since 2010 that none of them needs more than 20 moves. Exploring that space head-on is out of reach.

The project implements Herbert Kociemba's two-phase algorithm. Phase one brings the cube into a particular subgroup, the positions that can be finished without ever making a quarter turn on two of the three axes; phase two finishes inside that subgroup, where the number of reachable positions collapses. Each phase is an iterative-deepening search guided by precomputed pruning tables, which cut away most of the tree. Those tables weigh 18 MB and are loaded in the background so the cube shows up immediately; once in memory, a solution is found in a few dozen milliseconds, entirely in the browser with no server involved.

The 54 facelets are the single source of truth: the 3D cube and the net are only two views of it, and every rotation goes through it, so they cannot drift apart.

Written in 2016, put back online in 2026. The 3D rendering relies on Werner Randelshofer's WebGL Virtual Cube library.

Platform
Web
Technologies
JavaScript
jQuery
WebGL
3D
Rubik'IA 1Rubik'IA 2






More projects