This was inspired by the MIT OpenCourseWare lecture on breadth first search and the associated pdf.
This is not very suitable for solving the Rubik's cube, it was created for me to get a greater intuition on how breadth first search works on a large graph.
This is a breadth first search on a 2-2-2 Rubik's cube, that is over 3 million possible configurations. This means it can be an absolute memory hog, it can easily use over 6 gigabytes of memory on certain scrambles.
The scramble to be performed is passed as arguments in the order they are to take place. Just the letter reperesenting the face for a quarter clockwise rotation and the letter and a for a quarter turn anti-clockwise. Example below. Once the cube has been solved the program will print the moves to perform to return to the solved state and close.
f and fa for front clockwise and anti-clockwise
r and ra for right clockwise and anti-clockwise
l and la for left clockwise and anti-clockwise
u and ua for upper clockwise and anti-clockwise
d and da for down clockwise and anti-clockwise
back and ba for back clockwise and anti-clockwise
f ra d ba
These arguments will perform a front clockwise, right anti-clockwise, down clockwise and a back anti-clockwise rotations on the cube.