Solving the Rubik's Cube with Group Theory
summary
Scala code uses the Group typeclass in Cats plus a small custom permutation DSL to model the cube as a subdirect product of an 8-corner permutation and a 12-edge permutation with orientations and parity constraints. The implementation generates commutators and conjugates to produce three-cycles (only ~56 distinct target cycles needed) and searches for algorithms that intersect at one piece. A Bluetooth cube and live coding demonstrate a working solver (edges ignored in the demo, cube sync briefly out of step). The approach leverages cycle decomposition, inverses and group products to convert moves into searchable data.
AI-written summary · about
chapters (11)
- 0:00Intro
- 0:29Agenda
- 1:31Group definition
- 3:03Permutations
- 6:59Group Theory
- 7:34Group Permutations
- 9:15Rubiks Cube
- 15:25Commutators
- 17:25Parity
- 18:34Conjugates
- 21:19Demonstration
related talks
29mPuzzles and Problem Solving with Scala Tooling.
51mGoing bananas with recursion schemes for fixed point data types
24mQuantum Computing Modeling in Scala
48mDescribe & Conquer (& Freek)
39mBeing Creative with Genetic Algorithms and Typeclasses
32mClassical Category Theory in Plain Scala
43mSaving Christmas Using Scala
46mBeing Creative with Genetic Algorithms and Typeclasses
