Puzzle

Guide to Solve the Rubik’s Cube

Layer Method for 3 x 3 x 3 cube

Tapan Avasthi
9 min readJun 8, 2020

--

Basics

A regular 3x3x3 Rubik’s cube has six faces, each painted with a different color. As per my market research, most of the Rubik’s cubes have white, blue, green, yellow, red, and orange colors. So, for the scope of this article, we’ll be using these colors as and when required.

Further, each layer of the 3x3x3 Rubik’s cube comprises of 9 unit cubes. And, in total, there are (3x3x3–1=26) unit cubes that are visible. Let’s get to know them well:

Center-cubes

In total, there are six center-cubes, one on each face of the Rubik’s cube. As a result, each center-cube has only one visible face painted.
The center-cubes have a fixed position, which means that no series of moves can change move them from their original place. So, we will use their fixed position property and use them as a reference while solving the Rubik’s cube.

Middle Edge-cubes

There are in total 12 middle edge-cubes. All these unit cubes have two visible faces painted, each with a different color.

Corner-cubes

There are eight corner-cubes. And, all of them have three visible faces painted, each with a different color.

There is a space of one unit-cube in the center cavity of the Rubik’s cube, which is not visible from the outside, and there won’t be any reference to this unit cube in this article henceforth.

Movements

To solve the Rubik’s cube, we will make use of face rotations. For simplicity, any movement, X will rotate the face, X by 90° in the clockwise direction. While a movement, X’ will rotate the face, X by 90° rotation in the anticlockwise direction.

As such, X can represent any of the six faces of the cube namely Front (F), Up (U), Down (D), Right (R), Left (L), or Back(B):

Illustration 1.0. Face Rotations (Illustration by the author)

Moreover, as face rotations for the backside are the least intuitive ones; therefore, wherever possible, we’ll try to avoid these rotations completely.

Solving the First Layer

In this section, we’ll formulate a strategy to solve the first layer of the cube.

The Perfect Cross

Intuitively speaking, a cross on a face is made when middle edge-cubes are aligned such that their color matches that of the center-cube.

As such, we can start by picking any one of the six faces of the cube. So, let’s start with the white one as depicted in the illustration below:

Illustration 2.0. The Perfect Cross (Illustration by the author)

Now, we must also note that a perfect cross on the top face means that the color of the middle edge-cube shared with the adjacent face matches with the color of the center cube for the corresponding adjacent face.

How to Obtain the Perfect Cross?
Although, most people can get this step right merely through an intuition-based approach. However, there’s a well-defined set of steps that we can follow to get it right the first time.

First and foremost, we must be clear about the concept of references. As the center cubes are immutable, so we’ll always use them as reference points:

Illustration 3.0. (Illustration by the author)

Now, let’s consider two faces, namely the white and the green-colored faces. First, we need to search for a middle edge-cube that has both white and green colors. And, after that, we need to place it just below its target position.

With that, our cube will end up in either of the two orientations depicted in Illustration 4.0.:

Illustration 4.0. (Illustration by the author)

Next, we need to do two clockwise rotations for the front face:

[F F]

As a result, our cube will end up in one of the two orientations:

Illustration 5.0. [Left: In the final position, Right: Not in final position] (Illustration by the author)

Well, the orientation shown on the left is our end-goal for this stage. So, getting this orientation means that we’re good. However, if we get the orientation on the right, then we need to fix the color mismatch by a series of movements:

[F’ L’ U’]

After this series of movements, our cube will end up in orientation, as depicted by the left side of the illustration.

Finally, the same steps need to be repeated for each of the adjacent faces to obtain a valid perfect cross.

The Perfect Corners

After obtaining the perfect white cross, all we’re left for finishing the first layer is to get the corner-cube in their correct positions.

First, we need to search for the matching corner cubes. As such, all corner-cubes have precisely three colors. So, a matching corner cube is the one that has the same three colors as the three faces at which it rests.

Once we’ve narrowed down on a corner-cube that we want to place, we need to bring it down to the exact bottom of its target location:

Illustration 6.0. — Spotting the correct-corner cube (Illustration by the author)

After that, let’s perform the following sequence of movements repeatedly until the corner cube settles at its correct position:

[R’ D’] [R D]

Whatever be the initial orientation, we won’t be needing more than six repetitions to get everything in order.

And, after repeating this for each of the four corner-cubes, our first layer is solved completely:

Illustration 7.0. — First Layer Solved (Illustration by the author)

Solving the Second Layer

In the previous section, we learned the strategy to solve the first layer of the Rubik’s Cube. Continuing with our solution, let’s go ahead and solve the second (or the middle) layer.

How about we pick up from where we left:

Illustration 8.0: Rubik’s cube after the first layer is solved (Illustration by the author)

As evident from Illustration 8.0., to solve the middle layer, we just need to place the remaining eight middle edge-cubes in their right position. As the number of cubes to be configured in this layer is the least. Therefore, this is also the most straightforward stage to solve.

Like we did while solving the first layer; first, we need to search for the right candidate for each of these eight positions.
For instance, the middle edge-cube position at the intersection of two faces having center cube color as white and green respectively needs to be filled by a cube of a similar type having the white and green colors:

Illustration 9.0. — The left face has white as the center cube, while the front face has green as the center cube. (Illustration by the author)

As shown in Illustration 9.0., the first layer which was solved earlier is moved at the bottom while the unsolved layers are towards the top.

Further, we need to move the middle edge-cubes marked in the green, and white color to the middle layer from their original position in the top layer.

If we end up in the first orientation, then we need to perform a shorter series of movements:

[U' L'] [U L] [U F] [U' F']

However, if we end up in the second orientation, then we need a bit longer series of moves:

[U' L'] [U L] [U F] [U' F'] [U U] [U' L'] [U L] [U F] [U' F']

If we take a closer look, the second series contains the first series:

  M₁ = [U' L'] [U L] [U F] [U' F'] [U U] [U' L'] [U L] [U F] [U' F']  M₂ = [U' L'] [U L] [U F] [U' F'] [U U] [U' L'] [U L] [U F] [U' F']
↦ M₂ = M₁ [U U] M₁

Like earlier, we need to repeat these movements to place all the eight middle edge-cubes in their correct position.

And, with that, we’ve solved the middle layer completely:

Illustration 10.0 — Rubik’s cube with the first two layers solved (Illustration by the author)

Solving the Third Layer

So far, we’ve successfully solved the first two layers of the cube. Now, it’s time to gear up and solve the third and the final layer of our Rubik’s cube.

Recap
It’s good to touch base where we left our Rubik’s cube after solving the second layer:

Illustration 11.0 — Recap: State of the cube after solving the first two layers. (Illustration by the author)

Get the Cross on the Third Layer

The sixth color on our Rubik’s cube is royal blue. So, our reference point in this stage will be the blue colored center-cube.

Initially, the top face of the cube will have one of the four orientations:

Illustration 12.0 — Stages of Getting a Cross (Illustration by the author)

And, our goal is to get a blue cross on this face.

To start with, we won’t worry about how the cross aligns with respect to the rest of the four faces. What it means is that we might get an invalid cross that has a mismatch of color with respect to the adjacent side faces.

To get the fourth pattern of the stage, we need to repeat a sequential series of movements:

[F R U] [R' U' F']

And, once done, we should have a royal-blue cross on this face.

Align the Cross With the Adjacent Face Colors

The mathematical beauty of the earlier series of movements is that it ensures that at least two of the middle edge-cubes can be aligned correctly with the adjacent underlying face. We might need to twist (rotate) the upper face to match those two middle edge cubes, but nothing more than that.

Now, we’re required to hold the cube in a specific way:

  • If the matching cubes are on the opposite faces, then hold the cube such that they are in the line of our sight
  • If they are on the adjoining faces, then hold the cube such that one of the matching cubes is at the back face and one of them is on the right face

Of course, it’s best to understand this visually through an illustration:

Illustration 13.0. — (L) Line of Sight Hold, (R) Right Hand Hold (Illustration by the author)

Next, we need to apply the following sequential movement that involves only right and upper face rotations :

[R U] [R’ U] [R U] [U R’]

We must note that the upper face is to be rotated in the clockwise direction only.

And, with that, we’ve got a perfect cross in our third layer:

Illustration 14.0. — Cube with proper cross alignment on the top blue layer. (Illustration by the author)

Corner Matching

Now, the only task left is to put the corner-cubes in the third layer at their correct place and also ensure that they’re in the proper orientation.

First, we will just put them in the right location, and then, we will orient them correctly.

Again, we’re required to hold the cube in a particular way. If one of the corner cubes is already in the right place (maybe not in the proper orientation), then that cube must be towards the right bottom corner in the top layer (viewed from the top):

Illustration 15.0. — Hold for matching corners (Illustration by the author)

However, if none of the corner cubes in the third layer are in the correct place, then the above constraint doesn’t apply.

Next, let’s apply the following sequential movement:

[U R] [U’ L’] [U R’] [U’ L]

An important thing to note is that this series of movements is a rotation sequence. And, it essentially rotates the positions A, B, C.

After a few repetitions, all the corner-cubes will eventually come to their correct place. And, what’s left is correcting their orientation.

Corner-cubes Alignment

Finally, we’re towards the completion of the last stage in solving the third layer.

Here as well, we need to be cautious of the way we are holding the cube. As such, we need to keep the disoriented corner cube that we need to orient correctly towards the bottom right corner when viewed from the top.

With the correct hold, let’s apply a series of movements that comprises of the rotation for the right and the down faces:

[R' D'] [R D]

With multiple repetitions, the corner-cube will orient correctly.

After that, we need to twist the upper face to get the next disoriented cube on the bottom right location (when viewed from the top). And, align it using the same approach.

And, that’s it. We’ve successfully solved the Rubik’s cube puzzle:

Illustration 16.0. — The solved state. The white layer is the first layer that was solved. Royal blue is the last layer. (Illustration by the author)

--

--