CayleyPy Beats Classical Algorithms at Solving Large Rubik's Cubes
CayleyPy uses a neural network heuristic instead of precomputed tables to search for paths in Cayley graphs. On the 3×3×3 cube, the model achieved 98.4% optimal solutions, outperforming DeepCubeA (60.3%) and EfficientCube (69.6%). The method works in three stages: generating a sample via random walks, training the neural network, and searching with Beam Search. On the 4×4×4 cube, CayleyPy beat Tomas Rokicki with an average result of 46.51 moves. On the Megaminx, Vladislav Kuznetsov solved the Superflip configuration in 47 moves under the FTM metric, proving it is not the diameter maximum. • 4×4×4 cube: a space of 7.4×10⁴⁵ states, unknown diameter, hypothesized at 48 moves under the BTM metric; • Megaminx: Superflip solved in 47 moves (May 2026, Vladislav Kuznetsov), lower bound on diameter of 48 moves (Herbert Kociemba, 2016); • Current competitions: 5×5×5 (10,000 ruble prize for <90 moves), 6×6×6, 7×7×7 on Kaggle.
AI-processed from Habr AI; edited by Hamidun News
The CayleyPy project is running a series of competitions on Kaggle focused on finding optimal solutions for mechanical puzzles whose God's number is unknown. Instead of classical algorithms like IDA* and bidirectional BFS, which rely on precomputed Pattern Databases, CayleyPy applies a trainable neural network heuristic. On the classic 3×3×3 Rubik's Cube, with a graph diameter of 20 moves (HTM metric, Tomas Rokicki, 2010), the system achieved 98.4% optimal solutions — surpassing DeepCubeA (60.3%) and EfficientCube (69.6%).
Architecture: three steps from random walks to search
The method consists of three stages. The first is sample generation: starting from a solved cube, the algorithm shuffles it randomly, saving a "configuration–distance from start" pair for each state. The second is training: the neural network learns to predict the distance from a given state, turning it into a search heuristic. The third is Beam Search: the algorithm keeps W of the most promising positions (typically W=5 or W=40), evaluates their neighbors, and selects the top W. The process repeats until the cube is solved or a search limit is reached.
A key finding from the experiments: increasing the training sample size quickly stops improving the heuristic's quality, whereas widening the beam consistently shortens the solution length.
From the 4×4 cube to the
Megaminx: breakthroughs on unknown diameters
On the 4×4×4 cube, the state space contains 7.4×10⁴⁵ states (26 orders of magnitude larger than the 3×3). God's number is unknown; known bounds are 32–53 moves under the BTM metric, with a hypothesis of 48 moves. CayleyPy achieved an average of 46.51 moves on the final leaderboard, beating Tomas Rokicki.
On the Megaminx (dodecahedron), the state space is approximately 1.01×10⁶⁸. The Superflip configuration (all edges flipped, with corners and centers in place) was considered a potential candidate for the configuration farthest from the solved state. Tomas Rokicki solved Superflip in 55 moves under the FTM metric in May 2023. Herbert Kociemba established a lower bound on the Megaminx's diameter in 2016: 48 moves under FTM.
Vladislav Kuznetsov, using CayleyPy, solved Superflip in 47 moves under FTM in May 2026. Since 47<48, it directly follows that Superflip is not the antipode of the Megaminx's Cayley graph, meaning it cannot be a configuration that achieves the diameter. Tomas Rokicki called the result "the first major, significant breakthrough in applying artificial intelligence to the theory of mechanical puzzles" (SpeedSolving.com).
Current competitions: task scale and available resources
Kaggle is hosting competitions for three cubes with unknown God's numbers:
• 5×5×5 cube (2.83×10⁷⁴ states), with a 10,000 ruble prize for solutions shorter than 90 moves; • 6×6×6 cube (1.57×10¹¹⁶ states); • 7×7×7 cube (1.95×10¹⁶⁰ states).
The core problem with classical reinforcement learning here is a sparse signal: the agent only gets useful feedback upon reaching the target state, leaving hundreds of intermediate steps without any feedback. CayleyPy solves this with a continuous signal: the neural network scores every intermediate state with a number, letting the algorithm follow a gradient instead of wandering blindly.
Participants have access to NVIDIA Tesla T4/P100 GPUs and TPU v3-8/v5e-8 on the Kaggle platform, the project's open-source code (480 stars on GitHub), and problems that have gone unsolved for four decades. Anyone can join via Alexander Chervov on Telegram.
- Oct 28, 2026AdaPRA lifts Qwen 80B by 24.5 points on data science leaderboards
- Oct 28, 2026AOS-Bench: Agents Separated by 0.6 Points in Isolation Deliver 54% and 68% of the Same Tasks
- Oct 28, 2026CuraLoc finds bugs in repositories with a single plan and uses 90% fewer tokens
- Oct 28, 2026Wired Tested 6 AI Agents in a Day: Dots Leads, Gemini Spark Fails at Lunch
Key Questions Answered
What are the key details on Architecture: three steps from random walks to search?
The method consists of three stages. The first is sample generation: starting from a solved cube, the algorithm shuffles it randomly, saving a "configuration–distance from start" pair for each state. The second is training: the neural network learns to predict the distance from a given state, turning it into a search heuristic. The third is Beam Search: the algorithm keeps W of the most promising positions (typically W=5 or W=40), evaluates their neighbors, and selects the top W. The process repeats until the cube is solved or a search limit is reached. A key finding from t
What are the key details on From the 4×4 cube to the Megaminx: breakthroughs on unknown diameters?
On the 4×4×4 cube, the state space contains 7.4×10⁴⁵ states (26 orders of magnitude larger than the 3×3). God's number is unknown; known bounds are 32–53 moves under the BTM metric, with a hypothesis of 48 moves. CayleyPy achieved an average of 46.51 moves on the final leaderboard, beating Tomas Rokicki. On the Megaminx (dodecahedron), the state space is approximately 1.01×10⁶⁸. The Superflip configuration (all edges flipped, with corners and centers in place) was considered a potential candidate for the configuration farthest from the solved state. Tomas Rokicki solved Sup
What are the key details on Current competitions: task scale and available resources?
Kaggle is hosting competitions for three cubes with unknown God's numbers: 5×5×5 cube (2.83×10⁷⁴ states), with a 10,000 ruble prize for solutions shorter than 90 moves; 6×6×6 cube (1.57×10¹¹⁶ states); 7×7×7 cube (1.95×10¹⁶⁰ states). The core problem with classical reinforcement learning here is a sparse signal: the agent only gets useful feedback upon reaching the target state, leaving hundreds of intermediate steps without any feedback. CayleyPy solves this with a continuous signal: the neural network scores every intermediate state with a number, letting the algorithm fol
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.