
Solving the Rubik's Cube Optimally Is NP-Complete - seycombi
https://arxiv.org/abs/1706.06708
======
pge
When my daughter got into rubik's cube with her friends, I thought it would be
fun to use it as a sample to teach her about applying a simple breadth-first
solver to find the shortest path to a solution. Embarrasingly, I neglected to
do the math on how many possible states there were before we started. We coded
up the solver in just a few minutes, but quickly discovered that a typical
solution would take longer than either of our lifetimes...Oops. She learned
some coding that day - not the lesson I intended, but probably a more
important one!

~~~
timjver
It only took you a few minutes, together with your daughter, to write code
that lets you interact with a Rubik's Cube? Or were you only referring to the
solver part?

~~~
tripa
Even the solver part is impressive.

A BFS is a few seconds, but modeling a Rubik's cube properly in a way a
daughter would understand is... harder.

~~~
pge
Yes, that part was over her head. I did all the coding, and the representation
of the cube and the moves. She got the concepts of the search, but capturing
the changes in the cube when a face is rotated was too complicated to do with
her.

------
williamstein
One of the coauthors of the paper is also a serious web developer:
[https://github.com/edemaine/coauthor](https://github.com/edemaine/coauthor)

------
js8
Interesting. I wonder, if you can solve 5x5x5 cube, then you can solve them
all. How good an approximation is using the optimal methods for solving 5x5x5
to solve the NxNxN case?

~~~
Extigy
I'm not sure that's true. I much prefer solving my 5x5x5 rather than my 4x4x4
because I always forget the algorithms for the extra parity that even cubes
provide. I don't think I could solve a 6x6x6 with the 5x5x5 algorithms I know.

~~~
Zanni
It's been a while so maybe I'm misremembering, but can't you solve a 4x4x4 by
reducing it to a 3x3x3 and solving that? Pretty sure that's how I used to do
it. Treat each 4 as a 3 with a fat middle: 1-2-1. Then solve the centers (2x2)
and the edges (2x1) with standard moves and you've got, essentially, a 3x3x3.

~~~
captn3m0
4x4x4 has parity problems, same as 5x5x5, but as the GP posted, the number of
parity cases for 4x4x4 is higher, which makes it slightly more difficult. (I
prefer solving the 5x5x5 for exactly the same reason).

------
crb002
It's constant time unless you grow the cube.

------
amelius
How hard would it be on a quantum computer?

~~~
maxander
To my knowledge, the current opinion (with no known proof) is that quantum
computers can't efficiently solve NP-hard problems. So, the answer is
(probably) "still hard," but I haven't the slightest how that would be
formally described.

