Skip to content

Explore 2-2-2 Rubik's cube (pocket cube) using Breadth First Search

Notifications You must be signed in to change notification settings

cmacdonald-arm/rubik-2-2-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rubik 2-2-2 Breadth First search

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.

Warning

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.

Usage

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

Example

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.

About

Explore 2-2-2 Rubik's cube (pocket cube) using Breadth First Search

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages