An Algorithm solving the Rubik’s Cube

  • Client: Universidad Simón Bolívar
  • Date Completed: 2005
  • Project’s goal: implement a program that finds the optimal path to solve any shuffled instance of the Rubik’s cube using an acceptable amount of time and memory resources. With optimal path it means the shortest possible path from the initial shuffled instance to the ordered instance. There can be multiple paths leading to the same ordered instance of the Rubik’s cube.
  • What I did: the Rubik’s Cube has an astronomical number of ways it can be permuted, and the code had to be efficient with time and memory usage. Because of C++’s high level of performance and control with which the programmer can manage the memory, such language was used. The path-finding algorithm known as A* (A Star) was one of the main actors of this solution, and works specially well with this kind of problem.
  • Results: after code optimizations, testings and refactoring, a robustly designed program was devised that could solve any shuffled instance of the Rubik’s cube using an acceptable amount of time and memory.

The Rubik’s Cube

Leave a Reply