Rubik’s Cube Solver


Rubik’s Cube Solver(RCS) is a complete program that can solve any scrambled 3X3X3 cube in less than 22 moves. It uses kociemba algorithm for finding the most optimum solution of a scrambled cube. 


​Tools Used:


  • OpenCV for image acquisition and processing.
  • Kociemba Algorithm which generates moves necessary to solve the scrambled cube.
  • OpenGL for animation of moves.

​Image Acquisition:


RCS use OpenCV for image acquisition and Image Processing. Image can be acquired from a webcam. All the faces of the cube are scanned successively. The image is stored using HSV color space. Color of each face is detected as soon as the face is properly aligned. Further the color data is processed to find the position of different colors on the cube. This data is passed on to the Kociemba Rubik’s Cube Solver Algorithm.


​Solving The Cube:


The Kociemba Algorithm generates a table of moves during the first run on a system. On further sessions the algorithm goes through all the possible moves that can solve a cube. It finds the moves which will solve the cube in shortest possible time. The program ensures that the cube is solved in less than 22 steps. These moves are simulated using the GUI.


Rubik’s Cube Notation:


The faces of the Rubik’s Cube are represented using the following notations
F : Front
R : Right
L : Left
U : Up
B : Back
D : Down

Accordingly a single character is used to represent a middle facelet. A set of 2 characters represents a non corner cubelet at the edge of a face. A set of 3 characters is used to represent the corner cubelets . Thus FR means a cubelet present on the Right edge of Front face and a FRU means a cubelet on the top right corner of the front face. Further each facelet is represented using a number along with face character.

The moves of a Face are represented as follows
U : Rotate upper face clockwise
U’ : Rotate upper face anticlockwise
D : Rotate lower face clockwise
D’ : Rotate lower face anticlockwise
R : Rotate right face clockwise
R’ : Rotate right face anticlockwise
L : Rotate left face clockwise
L’ : Rotate left face anticlockwise
F : Rotate front face clockwise
F’ : Rotate front face anticlockwise
B : Rotate back face clockwise
​B’ : Rotate back face anticlockwise


​GUI


Moves necessary to solve the cube are sent to the GUI application. The codes necessary to form the cube are stored in an array and a unscrambled cube acquired by the image acquisition algorithm is generated. The user has a option to manually start the graphic solver so user can first verify whether the cube is correctly generated or not. Speed control and different viewing angles are also made available to the user,with a option for the user to solve the cube manually if he/she so desires,thus increasing user’s control over the application.


Media



Team Members:

  1. Vedant Ranade
  2. Vikas Jha
  3. Kartik Paigwar
  4. Chaitanya Shinde

Mentored by:

Aniket Gadwe