Open In App

Algorithm to solve Rubik’s Cube

Last Updated : 30 Jul, 2023
Like Article

A Rubik’s Cube is an interesting puzzle invented by ‘Erno Rubik’ which has 43 quintillion possible configurations. But with the use of certain algorithms, it can be solved easily. There are many variations of the Rubix cube nowadays but the most basic one is the 3x3x3 Rubik’s cube.

A 3x3x3 Rubik’s cube is made by joining 21 pieces: 1 principle piece with three axles, 8 corner pieces (corner solid shapes) with three tones, and 12 edge pieces (edge 3D squares) with two tones.

3x3x3 rubik's cube

Centerpieces are always at their original position only.

Basic Rotations Of Rubik’s Cube:

  • R: Rotate the right layer clockwise.
  • R’: Rotate the right layer anti-clockwise.
  • L: Rotate the left layer clockwise.
  • L’: Rotate the left layer anti-clockwise.
  • U: Rotate the top layer clockwise.
  • U’: Rotate the top layer anti-clockwise.
  • F: Rotate the front layer clockwise.
  • F’: Rotate the front layer anti-clockwise.

Beginners Method:
The easy solution to solve a Rubik’s cube is to follow the approach to first solve the bottom layer, then the middle layer, and then finally the top layer.

Layer's RUbik's cube

Below are the steps to solve a Rubik’s cube-
Step 1: First choose a centerpiece of any color (say white) and then make a white cross by bringing all the four edge pieces adjacent to the white center.

Step 1

Step 2:  Match colors of all four centerpieces of the lateral face with the edges of the bottom layer one by one and sending the matched pairs in opposite directions and then bringing them again to make a cross of white.

Step 2

After matching all the layers, the cube will look like this-

Matching colors

Step 3: Set corners of the bottom layer by first matching the correct corner matching its desired color. Then apply the algorithm R U R’ U’ and repeat the same algorithm till the bottom corner piece is set at its correct position as shown below

Apply RUR'U'

After setting all the corners, the cube will look like this-

Setting all the corners

Step 4: Make the second layer by matching all four edges at the lateral faces. First, match the color of the top layer edge with its center layer and observe the other part of the piece i.e top facing color.

  • Case 1: If the other part color matches with the centerpiece at the right side, then apply the algorithm  U R U’ R’ U’ F’ U F.
  • Case2:  If the other part color matches with the centerpiece at the left side, then apply the algorithm   U’ L’ U L U F U’ F’.

After applying this to all other pieces, the cube will look like this-

Result after step4

Step 5: Make the yellow cross on the top layer by applying the simple algorithm  F R U R’ U’ F’  1-3 times as shown below.

Apply FRUR'U'F'

Step 6: Now match any one edge of the top layer with the centerpiece in the middle layer, and then apply the algorithm F R U R’ U’ F’ until all the edges are matched.

Step 6

Step 7:  Now to match all the corner pieces on the top layer, first see the corner which is already being matched and keep it as the front face and towards the right. If none of the corner pieces are in the right place, you can hold the cube in any orientation with the unmatched pieces on top and apply the algorithm U R U’ L’ U R’ U’ L.

After applying this algorithm 1-3 times the cube will look like-

After Step 7

Step 8: In the final step keep yellow as the front face and start from any corner apply the algorithm U R’ U’ R until the corner arranges correctly, then rotate the top layer to bring another disarranged corner on the top right side and repeat U R’ U’ R algorithm again to arrange it, and so on. After arranging all the corner pieces, just move the yellow facing layer 1-2 times if needed to completely solve your cube.      

Rubik's cube solved

With this final step, the Rubik’s cube is finally solved.

Also Read – How to Solve a 4×4 Rubik’s Cube

Previous Article
Next Article

Similar Reads

Introduction to Rubik's Cube and how to solve them?
The Rubik's Cube is a 3-D combination Puzzle that was invented in 1974 by 'Erno Rubik’'. Rubik's Cube is a Puzzle with a six-colored cube whose faces each include nine squares, eight of which can be rotated separately. In this article, we are going to learn Rubik's cube in-depth. [caption width="800"]Rubik's Cube[/caption] If you want to be an expe
1 min read
How To Solve 4x4 Rubik's Cube - Beginner's method
Easily Solve 4x4 Cube - Step by Step GuideSolve the center piecesPair similar edge piecesTurn only the outer layers, and solve it like a 3x3 Rubik's CubeThe 4x4 Rubik’s Cube, also known as the Rubik’s Revenge, is an interesting twisty puzzle that challenges even expert cubers. Unlike its 3x3 counterpart, the 4x4 cube introduces additional complexit
16 min read
Rubik's Cube Facts and Questions
What is a Rubik's Cube?The Rubik’s Cube is a 3-D combination Puzzle that was invented in 1974 by Hungarian sculptor and professor of architecture Ernő Rubik. Rubik’s Cube is a Puzzle with a six-coloured cube, whose faces each include nine squares, eight of which can be rotated separately. In this article, we are going to learn Rubik’s cube in-depth
5 min read
Designing algorithm to solve Ball Sort Puzzle
In Ball Sort Puzzle game, we have p balls of each colour and n different colours, for a total of p×n balls, arranged in n stacks. In addition, we have 2 empty stacks. A maximum of p balls can be in any stack at a given time. The goal of the game is to sort the balls by colour in each of the n stacks. Rules: Only the top ball of each stack can be mo
19 min read
Minimum number of moves required to solve a Jigsaw Assembly Puzzle
Puzzle: You are given a jigsaw puzzle that contains n pieces. A "section" of the puzzle is a set of one or more pieces that have been connected to each other. A "move" consists of connecting two sections. Given that initially, all the pieces are separate, then what is the minimum number of moves in which the puzzle can be completed? Answer Let's co
2 min read
Tricks To Solve Month Based Puzzle
Importance of Month-Based problemIn banking exams such as IBPS, SBI, and RRB PO and Clerk, the Month Based problem plays an important role in the Reasoning Ability Section. Either in prelims or mains exams of IBPS, SBI, or RRB PO & clerk, you will get at least one set of 5 questions from a month-based puzzle. Aspirants should concentrate on mon
7 min read
Introduction to Sudoku Puzzles and How to Solve them?
What is Sudoku Puzzle?Sudoku is a logic-based number-placement puzzle that is asked in interviews these days very frequently. In this article, we are going to learn sudoku in-depth.[caption width="800"]Sudoku Puzzle[/caption] How to Solve Sudoku Puzzle?The objective of the puzzle is to populate a 9x9 grid with numbers in such a way that each column
2 min read
What are Mathematical Puzzles and How to solve them?
A mathematical puzzle is a type of problem or game that involves using mathematical concepts, logic, and reasoning to find a solution. These puzzles often require creative thinking and a deep understanding of mathematical principles to solve. They can range from simple arithmetic puzzles to complex problems that require advanced mathematical knowle
3 min read
Introduction to Crossword Puzzles and How to Solve them?
In the crossword Puzzle, there is a grid given along with Some Hint Questions, We need to find answers of those Questions and Fill in the Grid. [caption width="800"]Crossword Puzzle[/caption] Crossword Puzzles check the intellect, common sense, knowledge, awareness, and logic of a person about different topics related to Technology. To solve this k
2 min read
What are Logical Puzzles And How to Solve them?
A Logical Puzzle is a type of intellectual challenge or problem-solving exercise that requires a person to use his brain, deductive reasoning, and logical analysis to arrive at a solution or conclusion. These puzzles often involve a set of rules or constraints that must be followed to reach the correct answer, and they can come in various forms and
4 min read
Article Tags :
Practice Tags :