# Can a computer be programed to solve a Rubik's Cube?

**URL:** https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913
**Category:** Factual Questions
**Created:** [January 6, 2007, 5:18am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913 "2007-01-06T05:18:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Grrr](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/grrr/32/146_2.png) [@Grrr](https://boards.straightdope.com/u/Grrr)
#### Post date: [January 6, 2007, 5:18am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/1 "2007-01-06T05:18:28Z")

</div>

I’m talking about handing it any randomly mixed cube and having it solve it for you.

---

<div class="post-metadata">

### Author: ![Garfield226](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Garfield226](https://boards.straightdope.com/u/Garfield226)
#### Post date: [January 6, 2007, 5:20am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/2 "2007-01-06T05:20:49Z")

</div>

[QUOTE=SHAKES]  
I’m talking about handing it any randomly mixed cube and having it solve it for you.  
[/QUOTE]

[sure](http://www.wrongway.org/cube/solve.html).

---

<div class="post-metadata">

### Author: ![buckgully](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@buckgully](https://boards.straightdope.com/u/buckgully)
#### Post date: [January 6, 2007, 5:51am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/3 "2007-01-06T05:51:05Z")

</div>

Not only is it not really that hard to write a program to do a Rubik’s cube, you can build a robot to do the rest of the work for you:

[http://mindstorms.lego.com/eng/inventions/invention.asp?ID={72BAE2EC-A6EC-5037-5BA0-01A93E6787FC}&slotN=2](http://mindstorms.lego.com/eng/inventions/invention.asp?ID=%7B72BAE2EC-A6EC-5037-5BA0-01A93E6787FC%7D&slotN=2)

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [January 6, 2007, 5:59am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/4 "2007-01-06T05:59:44Z")

</div>

A [much cooler](http://www.youtube.com/watch?v=6960jAGCkiA) Rubik’s solving robot.

---

<div class="post-metadata">

### Author: ![Sunspace](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sunspace/32/1250_2.png) [@Sunspace](https://boards.straightdope.com/u/Sunspace)
#### Post date: [January 6, 2007, 6:53am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/5 "2007-01-06T06:53:08Z")

</div>

I have a [program](http://www.gravitation3d.com/magiccube5d/) that solves a 5-dimensional rubiks-cube. With animations! This is good, because I have trouble with the three-dimensional version.

---

<div class="post-metadata">

### Author: ![Meeko](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Meeko](https://boards.straightdope.com/u/Meeko)
#### Post date: [January 6, 2007, 7:00am UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/6 "2007-01-06T07:00:46Z")

</div>

Here is the one I use:

[http://www.brownmoon.net/downloads.html](http://www.brownmoon.net/downloads.html)

It is “qube”

It is easier to set up than the others listed, as it actually models the cube in 3 dimensions.

---

<div class="post-metadata">

### Author: ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)
#### Post date: [January 6, 2007, 2:44pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/7 "2007-01-06T14:44:56Z")

</div>

I was on my Computer Science department’s graduate qualifying exam comm. back when the cube came out. Guess what the programming exam part of the test was on?

They had something like 3 days to do it in. One guy even did a graphical version with mouse control. Easy as pi.

---

<div class="post-metadata">

### Author: ![SmackFu](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SmackFu](https://boards.straightdope.com/u/SmackFu)
#### Post date: [January 6, 2007, 3:08pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/8 "2007-01-06T15:08:58Z")

</div>

I actually had a book back in the day that gave the optimum algorithm, so you could do it quickly by hand.

---

<div class="post-metadata">

### Author: ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)
#### Post date: [January 6, 2007, 5:57pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/9 "2007-01-06T17:57:31Z")

</div>

[QUOTE=SmackFu]  
I actually had a book back in the day that gave the _optimum_ algorithm, so you could do it quickly by hand.  
[/QUOTE]

(emphasis mine)

If that’s the case, you better contact someone because it’s currently an [unsolved problem](http://en.wikipedia.org/wiki/God's_algorithm).

---

<div class="post-metadata">

### Author: ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)
#### Post date: [January 6, 2007, 5:58pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/10 "2007-01-06T17:58:34Z")

</div>

Uh… There was meant to be an emphasis on the optimum.

I know all the reasons given for not allowing editing but I still think it’s a stupid decision.

---

<div class="post-metadata">

### Author: ![Spectre\_of\_Pithecanthropus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/spectre_of_pithecanthropus/32/12343_2.png) [@Spectre\_of\_Pithecanthropus](https://boards.straightdope.com/u/Spectre_of_Pithecanthropus)
#### Post date: [January 6, 2007, 6:24pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/11 "2007-01-06T18:24:37Z")

</div>

[QUOTE=SmackFu]  
I actually had a book back in the day that gave the optimum algorithm, so you could do it quickly by hand.  
[/QUOTE]

I remember those books. IIRC, no matter how the cube was randomized, it could be reset in 9 or fewer moves, or a similarly small number.

---

<div class="post-metadata">

### Author: ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)
#### Post date: [January 6, 2007, 6:58pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/12 "2007-01-06T18:58:16Z")

</div>

[QUOTE=Spectre of Pithecanthropus]  
I remember those books. IIRC, no matter how the cube was randomized, it could be reset in 9 or fewer moves, or a similarly small number.  
[/QUOTE]

17, but that argument is just that 17 moves can get to at least n states where n is bigger than the number of cube states. AFAIK nobody has really calculated by hand the diameter of Rubik’s group.

---

<div class="post-metadata">

### Author: ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)
#### Post date: [January 6, 2007, 11:28pm UTC](https://boards.straightdope.com/t/can-a-computer-be-programed-to-solve-a-rubiks-cube/386913/13 "2007-01-06T23:28:45Z")

</div>

[QUOTE=buckgully]  
Not only is it not really that hard to write a program to do a Rubik’s cube, you can build a robot to do the rest of the work for you:

[http://mindstorms.lego.com/eng/inventions/invention.asp?ID={72BAE2EC-A6EC-5037-5BA0-01A93E6787FC}&slotN=2](http://mindstorms.lego.com/eng/inventions/invention.asp?ID=%7B72BAE2EC-A6EC-5037-5BA0-01A93E6787FC%7D&slotN=2)  
[/QUOTE]

Weird. I was just talking about this to someone today.

Here’s a good video of the machine in action:  
 ![](https://img.youtube.com/vi/6rLruH5pCRk/maxresdefault.jpg)https://www.youtube.com/embed/6rLruH5pCRk?feature=oembed&wmode=opaque
