Hacker News new | past | comments | ask | show | jobs | submit login
Two-part Rubik's algorithms (nedbatchelder.com)
100 points by mr_golyadkin on Feb 28, 2017 | hide | past | favorite | 24 comments



This is also how people can solve Rubik's Cubes blindfolded: use algorithms that only move a couple pieces without changing the rest of the state. It's suddenly way easier to keep track the state when only a few pieces are moving at a time.

When I was a speedcuber I could use three algorithms to solve a cube blindfolded after memorizing where each piece needed to go: one to flip two edges, one to rotate two corners, and one that switched two corners and two edges at the same time (T-perm for you cubers).

Then it was just 1. orient the edges and corners in a way that makes them easy to move around the cube and 2. move the pieces where they need to go.

This is a very rudimentary strategy, and there are MUCH faster ways to solve the cube, but this is all you need.


how long did you have to memorize the cube before being blindfolded, and what was your strategy for doing so?


Under a minute when I was practicing. I'm sure it'd take me 2-3 minutes now.

My last algorithm switched the top right and top left edge pieces (as well as two corners which I'll ignore for this explanation). So I look as the top right edge and figure out where it needed to go to be solved, let's say the front left edge. Now if I move the front left edge to the top left, do my algorithm, and move it back, those pieces will be swapped.

Here's where it gets fun: since I know what was originally the front left edge is now going to be in the top right position, I can chain this together when memorizing. So memorizing would sound like "top right goes to front left which goes to back right which goes to..."

In practice this was just me pointing to pieces and visualizing everything. Another strategy is to assign a letter to each piece and remember a string of letters. At most the length of the string will be numEdges -1 + numCorners - 1 = 18.

And then once it's translated to letters you can use more traditional memorization techniques like Roman Rooms. This is how people can solve dozens of cubes at once blindfolded (I've only done three at a time).


Very cool explanation - thanks so much for taking the time to write this detailed reply :)


It's worth noting that this is just a specific case of a commutator:

http://w.astro.berkeley.edu/~converse/rubiks.php?id1=basics&...

A commutator is any sequence of moves in the form of A B A' B', where A and B are sets of moves, and A' and B' are those sets of moves undone. So this example basically just restricts B to consist only of top-layer moves.


Terry Tao has a really great post where he depicts group actions (every Rubik's cube move sequence is a group action) as arrows in a graph, and with this picture, commutators can be seen as arrows that make a relatively small change: https://terrytao.wordpress.com/2012/05/11/cayley-graphs-and-... (see figure 14).

If you want to take the arrows very literally, you can think of the commutator as measuring the amount of curvature in the space the arrows lie in. The less of a difference the commutator makes, the less curved - with a commutator that doesn't do anything meaning the space is flat. Expressed in these terms, the two-part algorithm technique amounts to finding places in Rubik's cube algorithm space that are almost – but not quite – flat.


This is how one of my professors described it to me back in college, inspiring me to derive my own solution to the Rubik's cube. (And later for the "Square One" cube.) And I think the general concept is easy to describe to anyone: do something to the top and mess up the bottom, rotate the top and then do the exact opposite.

To me, it's much more satisfying than memorizing/learning existing solutions, even though I'll never be as fast as those that do leverage those solutions.

Either way, though, I'd recommend buying an inexpensive "speed cube" from Amazon, they are much less frustrating than the original design. (It doesn't bind up in the middle of a transformation.)


It had a bit of the opposite effect on me as a lazy kid.

It showed me that intuition only goes so far, beyond a point one has to put in some serious hard work (memorize patterns/algos etc) to see how deep one can go in any field.


I recently re-visited the rubiks cube as a holiday project.

It really is quite accessible now with online guides and videos. I think about an hour a day for 5 days took me from never having solved a cube to being able to solve any starting configuration in a little less than 3 minutes.

If like me you ever had a cube you never beat as a kid, it is definitely worth revisiting.


Took me 5 days as well, though I might have spent more than an hour on it daily. I stepped away from the cube for about 4 years and was able to pick it up again just from muscle memory.

I now use the cube as a meditative practice. For 1-3 minutes, nothing in the world matters with the exception of solving the cube. Doesn't work well as a meditation tool when you start doing other cubes however, like the megminx. It just becomes a frustration device.


Same for me, I actually have mine (a relatively cheap speedcube) on my table at the office. When I want to clean up my mind, I scramble and solve it. I use Roux's method, which is surprisingly light to learn and satisfying to execute


I now use the cube as a meditative practice

Holy cow, you've put into words what I've been thinking and practicing. Thank you.


We have one in the office. My boss taught me how to do it - took about a week as everyone else has said.

We do it when we're on long phone calls. It sounds like a distraction, but I find it actually helps me focus. It's just turning cubes from rote memory, paying slight attention to where things need to go. It's far less distracting than picking up the phone and firing up Twitter.

(I was 39 when I learned, FWIW. Recommended to anybody.)


Same here. I have one on my desk to solve whenever I find myself procrastinating out of anxiety. Not only does solving it quell the anxiety, it has helped me get better at detecting the anxious state before I get sucked into another, more distracting activity for relief.


Same here. One problem thought is having someone else to scramble it again. Doing both scramble and solve by myself kinda feel like cheating.


You could leave it scrambled after finishing a solve. I would never be able to remember the scramble by the next session.


As others have pointed out, this is a special case of a commutator. I don't know if this case has a standard name, but elsewhere I've seen it called "U-process": https://www.quora.com/Can-a-Rubiks-cube-be-solved-without-it....

If you're solving using commutators now and are looking to upgrade to a faster method in the same spirit, check out the Heise method. It's also an intuitive method (no memorization required), which starts off with block-building and finishes using commutators. I made the transition from commutator-only to Heise and am enjoying it, and I'm still very far off the speed cap for Heise. (Its creator reports averaging ~30sec: http://twistypuzzles.com/~sandy/forum/viewtopic.php?p=45076&...)


One thing I recently realized about the cube. In a simulation, or in reality, the configuration of the cube can be completely described by the orientation of the 20 movable pieces. The location of a piece is actually determined by it's orientation.

For example, if you wanted to make a 3d model you might make a bunch of little cubes each centered in their own object space and then translate them to their location in the cube. If you do that, you have to track the orientation AND location of each piece. However, if you center the entire cube at the origin and then place each piece in its place relative to that origin, all "moves" simply rotate a piece around some axis which both changes their orientation AND moves them relative to the cube center. As such, position is redundant information.

I'm not sure how relevant this is, but to me it seems to point to alternative ways of finding a solution via computer.

But this is probably very old news to people who study the cube.


The book Winning Ways for Your Mathematical Plays[1] has three main algorithms that are in the vein of this basic idea. They were actually optimized for ease of remembering and executing on. With full documented solutions for moving specific cubes of the final layer. Really fun read.

[1] https://smile.amazon.com/Winning-Ways-Your-Mathematical-Play...


The rest of the book (including the other three volumes) is excellent too, just so we're clear.


Ryan Heise has a nice guide to solving the cube without memorizing algorithms (using conjugates and commutators).

http://www.ryanheise.com/cube/


I set a Scala assignment last year that was implementing a "human" cube-solver (ie, write a cube solver that searches for these sorts of moves, and then uses them to solve the cube the way people are taught to)

Fun problem; terrible assignment. I had to scaffold it so much that I was essentially giving most of the solution.


These are called "commutators". You can easily find a bunch just by looking up the word! :)


This looks very similar to the method I used back in high school, and the fastest I ever got with it was 66 seconds, which is abysmal by speed-cubing standards but it impressed my friends and family.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: