
Every position of Rubik's Cube can be solved in twenty moves or less - selmnoo
http://cube20.org/
======
haberman
Wow, the code is written in CWEB, a literate programming system. You don't see
that every day. The PDFs of the code are, from my brief scan over them, a
really well-presented explanation of some seriously deep/mathematical code.

When I heard that the solution came from using 52 CPU-years of processing, I
guessed that the code was a relatively boring brute-force search. But it
appears I couldn't have been more wrong about that.

------
selmnoo
If more people, like me, don't have java plugins, here's a cool video about
the 'superflip' to make up for the site-animation not loading:
[http://www.youtube.com/watch?v=BTyzE-
NDga8](http://www.youtube.com/watch?v=BTyzE-NDga8)

~~~
dopamean
That is very cool. I've never solved a Rubik's Cube (though I've never tried
particularly hard) and this is making me feel stupid.

~~~
selmnoo
Don't let it make you feel stupid -- once you get the hang of an "algo" it's
actually quite easy.

Approach it very methodically. Learn the algos. Practise. And that's really
all. Here're two videos to get started:
[http://www.youtube.com/watch?v=mvhKNXHQqyM](http://www.youtube.com/watch?v=mvhKNXHQqyM)
\- [http://www.youtube.com/watch?v=MaltgJGz-
dU](http://www.youtube.com/watch?v=MaltgJGz-dU)

Give yourself about 20 hours to learn and play around, by then you'll have
gotten the hang of it and will probably be able to solve most arrangements
with ease.

~~~
Someone
NO! Solving the cube is boring, discovering how to solve it is not. The
journey is the reward. What you should do is learn a tiny bit of algebra. In
particular, learn about commutators
([http://en.wikipedia.org/wiki/Commutator](http://en.wikipedia.org/wiki/Commutator))

Then, experiment with commutators on the cube to look for ones that have very
localized effects. Those are those 'algos' others want you to learn from a
book. For example, check the simplest commutator LTL'T' and figure out how to
use that as part of a larger commutator that permutes the three corners of a
cube.

Yes, it will probably take more than those 20 hours (that can be done faster,
I think. You need at most 4 tricks (permute three corners, permute three
edges, flip two corners, flip two edges should do), each maybe ten turns to
solve any cube), but it will be more fun.

It took me way more than 20 hours to solve my first cube, but the first two
times I did it, I didn't even know how to solve it yet.

~~~
aidos
Couldn't agree with this more. It took me a year of chipping away at it to
come up with a solution. Finally finished it the first time while my flight
was touching down in thailand.

I've heard mine is not the normal algorithm people are taught. The one I use
is totally suboptimal - but that's a wonderful thing. There's forever more to
discover. It's actually a brilliant problem for the types of people that haunt
HN. I implore those of you who have never tried to give it a shot. And
remember, if you look online, you're only cheating yourself.

------
trothamel
An interesting thing about this is how Google donated years of CPU time to
this project. It makes you wonder what else Google is using otherwise-unused
CPU time for.

~~~
frostnovazzz
Years of CPU time is not a lot in google. You only need hundreds of CPUs to
run for a couple of days.

Though not everyone has easy access to this resource, this project is
meaningful enough to get approved for the resource allocation.

~~~
PilateDeGuerre
This seems to be first rate academic wankery to me. If I am missing
someething, please share with me what qualifies this project as "meaningful
enough" in your view.

~~~
frostnovazzz
At least there are a countless number of people who want to know the answer.

------
thearn4
I know Morley Davidson, one of the mathematicians who worked this out. Well, I
took seminars with him while working on my PhD at least.

His office is full of puzzle cubes. Now that I've got my own office, so is
mine. They're kind of addicting.

~~~
jevinskie
Do you solve them or just collect them?

~~~
thearn4
Both. The higher order cubes aren't as hard as they might seem. Most
strategies degenerate towards knowing how to solve the 3x3x3 case.

~~~
VladRussian2
How about 3x3x3x3 cube?

~~~
rmidthun
Ok, how about it?
[http://www.superliminal.com/cube/cube.htm](http://www.superliminal.com/cube/cube.htm)

There's also a 5 dimensional one and links to all kinds of crazy.

Interestingly, solving higher dimensional cubes isn't more difficult from an
algorithm view. Understanding what you're looking at might be a different
story!

There used to be a solution online called the "Ultimate solution", the web
page I got it from is now sadly defunct. It showed you how to solve the cube
with only two moves. The first was a simple commutator, of form FRF'R' and
showed how you can use just this one move to get all the edges in place.

If you then place two of these moves together with a similar structure, you
get a move that cycles corners. This is of the form (X)U(X')U', where X is an
edge commutator like FRF' (example (FRF')D(F'R'F)D'). This one move properly
applied will move 3 corners without disrupting edges.

So, the trick to the fourth dimension is to learn a move on the order
(C)W(C')W', where C is the inner part (no final move) of the corner commuter
above. And so it goes, each dimension only requiring one more move in the same
fashion.

Of course, figuring out exactly how to make that move with the interface is
the hard part. And the fun.

------
b0z0
I was looking forward to a mathematical proof of how symmetrical cases can be
solved, but I was surprised to find that they basically brute-forced it with a
computer. I'd learned about how much controversy that approach generated with
the Four Color Theorem, but I'm impressed with how much proofs have moved
forward since then.

~~~
gamegoblin
There are mathematical proofs which can get the bound to 22 moves, so it's
just a matter of time. But now that the proof is bruteforced, there isn't too
much motivation.

[http://en.wikipedia.org/wiki/Optimal_solutions_for_Rubik%27s...](http://en.wikipedia.org/wiki/Optimal_solutions_for_Rubik%27s_Cube#Further_improvements)

------
jorgem
"Source Released".

Good scientist.

------
cecilpl
Did you just learn this from the reddit ELI5 on Rubik's Cubes this morning? :)

~~~
Zombieball
Don't worry, OP will surely reply.

~~~
selmnoo
I saw something about Rubik's cube on Reddit, but I didn't click the link or
the comments on Reddit. Later in the day a question popped into my head: do
there exist known states that are very random, very 'distant' from a solved
state, such that I could keep my Rubik's cube master friend busy for a good
while? I googled around, found my way here:
[http://math.stackexchange.com/questions/150895/is-there-a-
mo...](http://math.stackexchange.com/questions/150895/is-there-a-most-random-
state-in-rubiks-cube) \-- and there I found the 'God's Number is 20' link
(which I've submitted here, because I found it very interesting and thought
you guys would too).

There. Happy?

------
codezero
Why is the count of solutions for distance 19 and 20 lower than for 17 and 18?

~~~
shalmanese
An intuitive way of thinking about it is that if you have an arrangement with
distance 20, any move you make is going to make it distance 19. Since there
are 12 possible moves, every distance 20 arrangement has 12 distance 19
neighbors.

~~~
Someone
That logic has a flaw: for every 'distance 19' arrangement you find that way,
there may be more than one 'distance 20' arrangement one can reach from it in
one move.

For example, you have two parents, but that does not imply that, combined, you
and all your siblings have more parents than there are in that group of
siblings.

------
mumbi
Very cool. I'm still amazed by people who try to solve Rubik's Cubes with the
least moves possible. Unfortunately it seems the speed solvers get all the
glory, though.

Stats:
[http://www.worldcubeassociation.org/results/e.php?i=333fm](http://www.worldcubeassociation.org/results/e.php?i=333fm)

~~~
laureny
Right, there is some tension between the number of moves and speed. Having
only 20 moves to solve the cube sounds like a great idea except that the
calculations to find out these 20 moves take too long.

Speed cubists win despite having to make more moves because calculating these
moves can be done very efficiently (and almost instantaneously) by our brains.

------
frostnovazzz
This is old news.

~~~
cranefly
Well it's news to me!

