Skip to content

The Cogito Cube Solver project aims to develop an AI-driven solution for solving the Rubik's cube by combining traditional algorithms like 3BLD and Domino Reduction with advanced machine learning techniques

Notifications You must be signed in to change notification settings

CogitoNTNU/Rubiks

Repository files navigation

Rubiks Cube Solver

GitHub Workflow Status (with event) GitHub top language GitHub language count Project Version

Description

Rubiks Cube

This project aims to solve a Rubik's cube through different methods. A fully functioning web frontend for visualization of the cube state and the solution process (stripped down and modified version of taylorjg/rubiks-cube <3). A corresponding Fast API backend that provides required data to the frontend.

Blind method

Using the 3 algorithms solves the cube piece by pice. Used as a baseline.

A-star

Using A* search though the extremely large state space of all possible rubik's cubes. This is split up in stages to limit possible states to look through (all set up in main.py):

  1. Scrambled to Edge Orientation (EO)
  2. EO to Domino Reduction (DR)
  3. DR to Solved

We later found out we had some wrong domain assumptions because of which stage 2 never finishes, but by splitting them up in stages we drastically reduce the search space and which makes this promising. More tweaks and work needed.

How to run and install

To simply test out the project a docker compose file has been provided. Run it with:

docker compose up -d --build

And open at localhost:3000 which will generate a random scramble and proceed to solve it with the Blind method.

If you wish to work on the project clone the repo. For the backend and logic you will need to set up Poetry, follow the environment.md for further guidance. The different helping objects and functions used to solve the cube are found in backend/Solvers. Fast API is set up in backend/api.py. Magicube package is widelly used so might be a good idea to get familiar with it.

For the frontend its a bit of a mess. Most things happen in frontend/src/three-app.js with additional logic we separated located in frontend/src/customCube.js

Dependencies are installed with:

npm i

And run the frontend from the /frontend folder with:

npm start

Team

The team behind this project is a group of seven students at NTNU Trondheim from various study backgrounds. All a members of Cogito NTNU fall 2024.

Eduard-Prokhorikhin
Eduard Prokhorikhin
1rideee
Einride Osland
Baykugan
Even Ytterli Tokle
GustavNat
Gustav Natvig
kienple
Kien Le
Vetlebrur
Vetle
Viljen789
Viljen789

About

The Cogito Cube Solver project aims to develop an AI-driven solution for solving the Rubik's cube by combining traditional algorithms like 3BLD and Domino Reduction with advanced machine learning techniques

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published