Python – Artificial Intelligence https://ars.electronica.art/ai/en Ars Electronica Festival 2017 Tue, 28 Jun 2022 13:43:24 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.6 Rubik’s Cube Solver https://ars.electronica.art/ai/en/rubiks-cube-solver/ Tue, 08 Aug 2017 20:40:29 +0000 https://ars.electronica.art/ai/?p=2384

Thomas Schaschinger (AT)

Through the use of a smartphone camera’s object & color recognition capabilities, this app can automatically register the composition of a Rubik’s Cube.

Then, a so-called Singmaster String is sent to a C / C++ program running on a high-performance computer, which is then able to optimally solve the cube—i.e. in 21 or fewer 90° rotations. The first time the program starts up, approximately 1.5 gigabytes of solutions are generated; they’re arrayed in a tree (brachiating) structure with, of course, the completed cube at the end. These are, needless to say, nowhere near all possible combinations. If none of these combinations matches the cube’s current combination, then it must at least include symmetries since all “non-symmetries” are depicted in the solutions tree. In this case, the cube is rotated until its composition corresponds to one of the anti-symmetrical groups in the solutions tree. Thereafter, it’s simply a matter of following the path to the solved cube. Solution duration: approximately 1 second to 5 minutes.

The result of the program—or, to put it more precisely, the rotation commands—are sent via a Python Script to the robot’s three Arduino Unos, which interpret these in the form of commands for the stepper motors and finally carry them out.

]]>