You are browsing as a guest. Sign up (or log in) to start making projects!

Rubik's Cube Algorithm Finder

  • 6 Devlogs
  • 17 Total hours

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

Ship #1 Pending review

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

I made this project after I learned to solve a Rubik’s Cube. See, I have this bad habit of taking something I like and automating it. On the bright side, I now have a program that can automatically solve a Rubik’s Cube, much faster than I can!

To run the Python program, follow the steps linked in the Try Project section.

  • 6 devlogs
  • 17h
Try project → See source code →
Open comments for this post

2h 13m 48s logged

I haven’t worked on this in a very long time, haha

So I stopped working on my Rubik’s Cube solver a while ago because it was more or less complete. I never actually submitted it though!

I just spent a few hours cleaning up the repo, fixing some stuff, etc.. It is now presentable and shippable!

I’m not sure exactly how to do this but my demo is actually a hosted web page giving instructions on how to install and run it. It’s not one line but actually two (one for cloning and one for pip install-ing) but I hope that’s okay.

Thanks all!

0
0
10
Open comments for this post

34m 27s logged

My program found solutions that I’ve never seen before :)
*
I told it to find an algorithm that takes an F2L pair out (e.g., R U R’ U’). If you are not familiar with the Rubik’s cube, I told it to find a sequence of moves that would result in a certain state.
*
I knew about one, very common sequence (R U R’ U’) and it found 17 others that I had never seen before, in about a minute of search time.
*
Now all that’s left is to optimize it so it can find longer algorithms!

0
0
1
Open comments for this post

4h 31m logged

Successfully searched up to depth 6 (meet-in-the-middle, so essentially up to 12) and solved a 10 move scramble in 50 seconds!
*
This program solved a rubik’s cube that had been scrambled with “F R U’ B’ D’ R’ L F’ B U’”, so ten moves. It correctly found the optimal 10 move solution, as well as many others.
*
This is Python, and I’m already running 18 searches in parallel, so I’m not sure if I’ll be able to improve the raw speed, but I hope to prune more and maybe even do a heuristic-based search in the future.
*
I’m planning on doing some more with this that may involve loosening the constraints. That may or may not speed it up.

0
0
1
Open comments for this post

2h 41m 5s logged

Well I thought this would be a quick project. 2.5 hours of programming later: It was not.
*
Since the last devlog, I have a Rubik’s Cube represented correctly in the code now, and it can make moves.
All I have left to do for this part of the project is to fix the str method that returns a visualization of the cube. Right now, it gets the orientation mixed up on up and down quarter turns, but it shouldn’t be too much debugging…
*
Here’s a screenshot of it working next to it not working:

0
0
1

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…