Magic Cube Solver
Six search algorithms racing a 5×5×5 diagonal magic cube — replayed move by move.
A 5×5×5 diagonal magic cube has 125 cells that must be a permutation of 1..125, with all 109 rows, columns, pillars and diagonals summing to 315. Six local-search and metaheuristic algorithms attack it server-side in Go, and the browser replays the resulting swap log on a scrubber against a live objective-value plot.
Algorithms
- Steepest Ascent Hill Climbing
- Hill Climbing with Sideways Move
- Random Restart Hill Climbing
- Stochastic Hill Climbing
- Simulated Annealing
- Genetic Algorithm
Built with
-
Go
- Fiber
-
SvelteKit
-
Three.js
-
Chart.js
-
Tailwind
-
Vite
-
Docker
The problem
- 125
- cells, a permutation of 1..125
- 109
- sums that must all match
- 315
- the magic constant
Objective functions are minimised, so zero means solved. A seed makes any run reproducible bit for bit.