Rubik's Cube Algorithm Finder

Search a Rubik's Cube for short algorithms that solve a scramble or reach a target pattern.

A document to walk you through installing it and getting it running. New to notation? Reference here. Source on GitHub.

Install

# Clone the repo and cd into it
git clone https://github.com/anagram-of-pi/rubik_cube_algorithm_finder.git && cd rubik_cube_algorithm_finder

# Create a venv and install the requirements from pip
python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt

Remember not to run bash commands without checking what they do first!

Try it

# Print what a given scramble looks like
python main.py show --scramble "R U R' U'"

# Solve a scramble (up to 6 moves by default, use "--depth 4" for up to 8)
python main.py solve --scramble "F R U R' U' F'"

# Find an algorithm that swaps the UF and UB edges
python main.py find --edges "0:2 2:0"

# Same, but only using U, R and F moves, searching up to 5 moves
python main.py find --edges "0:2 2:0" --moves "U R F" --depth 5

What it does

show displays an unfolded net of the cube. solve uses a meet-in-the-middle search to undo a scramble of up to about 12 moves in a reasonable amount of time. find locks any edges/corners into a pattern and searches for the shortest move sequence that produces it.