I saw an animation that represents a Rubik's Cube as three groups of rings, and I wanted to understand two things: why can those dots stand in for the colored stickers on the cube? And does understanding this representation mean understanding how to solve the cube? These notes start from the basics of group theory and the Rubik's Cube, then work step by step toward permutations, commutators, and shortest paths. [1]

1. Group Theory Basics
Sets, Mappings, and Permutations
A set is a collection of objects. For example,
If different inputs are never sent to the same output, and every output has an input corresponding to it, the mapping is a bijection. For finite sets, a bijection rearranges all the objects, with neither repetition nor omission. A bijection from a set to itself is called a permutation. Rearranging four labeled cards is an example.
Why emphasize bijections? Because every output can be uniquely traced back to its original input. The operation can therefore be undone. Merging, discarding, or duplicating cards all lose this reversibility.
Composition of Operations
"Operation" does not only refer to addition or multiplication of numbers. First performing one action
In what follows, the multiplication sign is omitted, and
The same overall effect is regarded as the same operation. A full rotation and no rotation at all make no difference to the final positions of the square's four vertices; group theory compares final effects here and does not record the path traced by the hand.
Definition and Axioms of a Group
Let
Closure: After performing two operations from the set, the resulting overall operation still belongs to the set.
Associativity: When performing three things in succession, one may treat the first two as a whole, or the last two as a whole.
Here the order of the actions is not swapped; only the grouping is changed.
Identity element: There exists an operation
Inverse element: Every operation
Some textbooks include closure in the definition of a "binary operation" and therefore list only three additional axioms; the content is the same. The definition of a group does not require commutativity
Square Rotations and Cyclic Groups
Label the four vertices of a square A, B, C, D. Allowing only rotations about the center by integer multiples of
The exponent indicates the number of repetitions,
"Modulo 4" means dividing by 4 and keeping the remainder, for example
Try rotating forward four times, or rotating forward once and then backward once. Compare the vertex labels, not just the outer outline of the square.
Cycle Decomposition of Permutations
The cycle
A permutation may contain multiple mutually disjoint cycles. For example,
Any finite permutation can be decomposed in this way. The method is to start from one label, repeatedly trace where it is sent, until returning to the starting point; then start again from a label not yet visited. Labels that do not move are cycles of length 1 and are usually omitted.
Basic Concepts of Groups and Parity of Permutations
The order of a group
A set of elements that can generate all operations through repeated composition and inversion is called a set of generators. The notation
All permutations of
Finally, we introduce a tool for determining whether an arrangement is valid. Swapping only two objects is called a transposition. Any permutation can be decomposed into transpositions; although the decomposition is not unique, the parity of the number of transpositions remains consistent, so one can distinguish even permutations from odd permutations. Using the sign
A cycle of length
For example, a 4-cycle is an odd permutation, and a 3-cycle is an even permutation; two odd permutations composed together form an even permutation. An important restriction on the Rubik's cube discussed later comes from this rule.
2. Structure and Representation of the 3x3 Cube
Cubies, Stickers, and State
The appearance of a 3x3 cube is
| Cubie | Count | Stickers per cubie | Information to track |
|---|---|---|---|
| Center | 6 | 1 | Provides the reference color for each of the six faces |
| Edge | 12 | 2 | Position and flip orientation |
| Corner | 8 | 3 | Position and twist orientation |
Therefore the total number of stickers is
A sticker is an object that can be tracked, and a sticker position is a fixed cell on a given face. The white sticker can move from the top face to the front face, but the definition of "the upper-left cell of the top face" remains unchanged. The entire state, however, must record the positions and orientations of all cubies; it cannot describe only a single sticker.
Positions and Orientations of Cubies
When an edge occupies a position, it has two possible orientations. For example, even if the white-red edge returns to the position between the white and red centers, it may have the white side facing the red face and the red side facing the white face; this is called a flip.
A corner in a corner position has three possible orientations. The white-red-green corner can be twisted
Therefore, solving requires satisfying two things simultaneously: the cubie's position is correct, and the cubie's orientation is also correct. This article discusses the common solid-color 3x3 cube and does not consider whether arrows, text, or patterns on center stickers are aligned.
Reference Frame and Turn Notation
Fix a set of viewing directions: top white, bottom yellow, front green, back blue, right red, left orange. The opposite face pairs are white/yellow, green/blue, and red/orange. The center cubies define this coordinate system and remain fixed in the model used in this article.
| Face | Up | Down | Right | Left | Front | Back |
|---|---|---|---|---|---|---|
| Notation | U | D | R | L | F | B |
A single letter denotes a clockwise turn of that face by
2 denotes a turn of
R' is a counterclockwise turn of the right face, and U2 is a half turn of the top face. Clockwise must be judged from outside the face being turned, looking directly at that face; the back and bottom faces follow the same rule. [5]
Turning an outer layer moves four corner cubies and four edge cubies simultaneously, along with the orientation of that face's center; the position of a solid-color center itself does not change. This article only allows turns of these six outer layers. Picking up the cube and changing its orientation counts as changing the viewing coordinates and is not treated as a new scrambled state for now.
3. The Rubik's Cube Group and Composition of Operations
Taking the six basic face turns, their inverses, and the operations obtained from any finite combination of them, we define
Closure is already included in the definition: concatenating two legal move sequences still yields a legal move sequence. Associativity comes from the composition of operations—the grouping of three move sequences does not affect the actual order of execution. The empty move is the identity element
Move Sequences and Group Elements
Turning the right face four times in a row returns every sticker to its original position, so
R R R R and the empty move differ in notation and length, but they represent the same group element. An element of the Rubik's Cube group can be understood as "a definite final permutation," while a move sequence is one way of describing it. Finding a short solution means searching for a shorter expression among many equivalent move sequences.
Number the 48 non-center stickers, and any legal operation corresponds to a permutation; moreover, different operations can be distinguished by the final positions of these numbered stickers. Therefore
Inverses of Composite Operations
If we first do
For example, the inverse of R U F2 is F2 U' R'. When the two sequences are concatenated, the middle F2 F2 cancels first, followed in turn by U U' and R R'.
If we record the entire scrambling process, we can restore the cube this way. But faced with a state of unknown origin, we usually do not know the original move sequence. Invertibility guarantees that an undoing operation exists, but it does not directly tell us how to find it.
Commutativity of Operations
The right layer and the left layer do not overlap, so
Whether two operations are equal can be checked rigorously: finding a single sticker that ends up in a different position under the two orders is enough to prove that the two permutations are different. What is being compared here is the entire permutation, not some local picture that happens to have matching colors.
4. Permutation Representation of Face Turns and the Ring Model
Sticker Numbering and Cycle Decomposition of Face Turns
Looking squarely at the outer side of each face, number the nine positions row by row from 1 to 9, with the center as 5. U1 denotes the upper-left position of the top face; the sticker occupying that cell at the solved starting state is also named the "original U1 sticker." After a turn, the two may no longer coincide.
Use the continuous orientation of the six-face unfolded diagram: the front face connects upward to U, downward to D, rightward to R, leftward to L, and B attaches to the right of R. This keeps the numbering below consistent with the animation. [6]
A single U turn produces five mutually disjoint 4-cycles:
The first two cycles are internal to the top face: four corner stickers cycle, and four edge stickers cycle. The last three cycles connect the top rows of the four side faces, moving 12 stickers in total. Thus one outer-layer quarter turn changes the positions of
Note that a "corner sticker" here is one visible face on a corner cubie. The three stickers of a corner cubie appear in different sticker cycles; this does not contradict the fact that they still belong to the same cubie.
Construction of the Nine-Ring Model
Take right, up, and front as the positive directions of the
Three axes times three layers each gives nine rings in total. Drawing the three rings of the same axis as concentric circles produces the three-group ring structure seen in the screenshot.
A sticker on the front face has its normal along the
Another way to count is by intersections: among the three ring groups there are three group pairings, each pairing contains
Modular Arithmetic Representation of Side-Band Turns
Along a given ring, temporarily label the 12 positions as
Thus this step splits into three 4-cycles:
A reverse turn changes adding 3 to subtracting 3. After four repetitions every point returns to its original position, consistent with the actual cube. If all points were instead advanced by one step along the ring, the result would be a 12-cycle, which does not correspond to any legal face turn here.
Synchronized Permutation of Stickers Within a Face
The rings above only depict the side bands. When turning U, the eight non-center stickers on the top face itself must also be permuted. They occur within the nine-point cluster corresponding to the U face, and cannot be ignored by focusing only on the sliding of the large rings.
In the animation below, select U and step through slowly: 12 points move on the large rings, while another 8 points move within the face cluster. Tracking the numbers shows that even when same-colored faces appear unchanged, stickers may still have been permuted.
Correspondence and Limitations of the Ring Model
The ring arrangement assigns new planar coordinates to the 54 positions while preserving the start-point/end-point correspondence of every legal move. As long as each position can be uniquely recovered, the rearrangement does not lose the complete sticker state.
But the fact that curves intersect does not mean stickers can freely switch tracks. A legal move updates an entire layer simultaneously; one cannot pick a single dot and move it alone. The line segments in the diagram primarily express a drawing relationship, not a path along which a single bead may travel independently.
The radii of the circles, the on-screen distances, and the animation speed are also not part of the group structure. Within a face cluster, curves are drawn to connect the correct endpoints in a way that is easy to observe; different continuous trajectories can represent the same discrete permutation. To judge whether the model is correct, one must check the full sticker correspondence after every step.
5. Commutators, Conjugation, and Local Operations
Definition and Role of the Commutator
Define the commutator
Execution still proceeds from left to right. It differs from the sequence
Therefore [R,L] ultimately changes no stickers, while [R,U] leaves a change behind. When designing Rubik's cube algorithms, people choose operations whose effects mostly cancel each other out, so that the remaining change is concentrated on a small number of pieces. The commutator provides a method for constructing local effects, but not every commutator "moves only three pieces." [7]
Cycle Decomposition and the Order of a Commutator
Let
Here the least common multiple ensures that the four cycles return to their original positions simultaneously. Looking only at piece positions, one might notice that some corner pieces return to their original corner after two repetitions, yet still have the wrong orientation. The full sticker permutation records both position and orientation, so it gives the correct period.
Verifying with numbered stickers has another advantage: two stickers of the same color look very similar in a rendering, but the numbering will not mistake a real change of position for "no change."
Conjugation and Transforming the Location of Action
Suppose
means first using
Conjugation preserves the cycle lengths and order of a permutation. It can be understood as follows: a cycle that originally ran through one set of indices is uniformly moved to another set of indices, with the internal structure of the cycle unchanged. The setup move must still be a legal operation, and one must pay attention to piece orientation; one cannot arbitrarily designate a few independent stickers to "transport."
Below, first compare RU with UR, then select a commutator. Finally observe F[R,U]F': its location of action has changed, but the cycle type remains consistent with [R,U].
This also explains a common structure in Rubik's cube algorithms: first bring the pieces to be processed to a familiar position, execute the local algorithm, then undo the setup move. Once the structure is understood, algorithms can be inspected and combined, rather than being treated as a string of unrelated turns.
6. State Invariants and Reachability
State Coordinates and Invariants
An invariant is a quantity that remains unchanged no matter how many legal moves are applied. When looking for invariants, you can first examine the basic generating moves: if all of them preserve some quantity, then any finite composition of them preserves it as well.
After fixing the six centers, record the state as corner permutation
The three slots of a corner position are numbered with the same chirality, with the U/D slot as 0. For example, the up-right-front corner is numbered 0, 1, 2 in the order U, R, F; the down-right-front corner is numbered in the order D, F, R. Whichever slot the white/yellow sticker falls into is the orientation value. For edge positions, the first slot takes U/D when available; when there is no U/D, it takes F/B. The reference color of an edge is also chosen by this priority: if it falls in the first slot, the value is 0; in the other slot, it is 1. The constraints below use this convention.
Corner Orientation Constraint
All legal states satisfy
Turns of the top and bottom faces merely permute the orientation values, while a quarter turn of any other face adds two 1s and two 2s to the four affected corners, for a total increment of
Twisting a single corner by
Edge Orientation Constraint
Edges satisfy
Under a consistent, commonly used orientation convention, a single generating move changes the orientation values of either zero or four edges, so the total change is even. Therefore a state with exactly one flipped edge and all other pieces unchanged is unreachable. Note that this refers to the orientation coordinate; it cannot be naively equated with "whether the white sticker faces up."
Permutation Parity of Corners and Edges
An outer-layer quarter turn simultaneously produces a 4-cycle of corners and a 4-cycle of edges at the level of piece positions. Each is an odd permutation, so every turn flips the parity of both. Starting from the solved state, they always remain equal:
Swapping two edges alone or two corners alone violates the condition. Note that this concerns the permutation of pieces: the same turn contains five 4-cycles at the sticker level, and the parities of these two kinds of objects must not be conflated. [2]
Counting Legal States
Corners have
This equation also relies on a fact: for the correct set of pieces, the three conditions above are not only necessary but also sufficient. Sufficiency requires constructions that correct orientations in pairs and handle even permutations with 3-cycles; if the two permutations are both odd, first perform a quarter turn to make them both even. With appropriate conjugation, local constructions can be applied to different positions. Merely writing out the product of counts does not substitute for this reachability argument. [3]
Here the center reference frame has already been fixed, so we no longer divide by the 24 choices of overall orientation. Nor can "nine stickers of each color" be treated as a sufficient condition: an arbitrary sticker layout may still contain color pairs or corner combinations that do not exist at all.
7. Cayley Graphs and Shortest-Path Search
Sticker Graphs and State Graphs
A graph consists of vertices and the edges connecting them. Following edges from vertex to vertex yields a path; if every edge has cost 1, the shortest path is the one with the fewest edges.
Different graphs can be built for the Rubik's Cube. The points in the circular diagram are sticker positions, and one picture jointly describes the whole cube. In the state graph used for solving, a point is a complete legal cube state, and an edge represents performing one allowed move. A single node of the latter contains all the information of an entire picture of the former.
Taking group elements
The solution sequence represents
The Cayley Graph of a Sixteen-State Subgroup
For the moment, allow only U and D turns. They commute, and each returns to its original position after four turns, so every reachable state can be written as
The two exponents record the changes of the upper and lower layers respectively; different exponent pairs produce different states. This subgroup has
Here the symbol
In the figure below, node
Breadth-First Search and Shortest Paths
Breadth-first search (BFS) uses a first-in-first-out queue. It first visits the starting point, then the states reachable in one move, then the new states reachable in two moves, expanding outward layer by layer. Each time a new node is discovered, it records which parent node it came from and through which move it was reached.
Because every edge has cost 1, when the target is first discovered, all possibly shorter layers have already been processed. Tracing back from the target to the start along parent pointers, then reversing the recorded order, yields a shortest solution.
A visited set is used to avoid duplication. U D and D U are different move sequences, yet they lead to the same node; four U turns return to the start. If every move sequence were treated as a new state, the search would repeat work. The animation actually computes neighbors and parent pointers, then displays the results layer by layer.
Move Metrics and the Diameter of the State Graph
QTM is the quarter-turn metric, where one
U2 D2.
For the full 3×3×3 cube, the proven maximum shortest distances are 26 for QTM and 20 for HTM. This is called the diameter of the state graph; since all nodes in a Cayley graph have the same local structure, the distance between the two farthest points also equals the maximum distance from the solved node. [8][9]
"Every state can be solved within 20 moves" does not mean every state requires 20 moves, nor does it guarantee that an arbitrary algorithm will produce such a solution. Recording a scramble and playing it backward only exhibits one solution; it does not rule out shorter paths.
The full graph has roughly
A Unified Perspective on Permutations, Groups, and Graphs
The ring diagram makes it easier to track permutations of the same set of stickers. Group theory explains how these operations compose, invert, and which states are reachable; the state graph further writes a solve as a path. When understanding this, always keep two things in mind: whether the dots represent stickers or complete states, and which objects must move simultaneously in a single legal operation.
References
- Inspiration screenshot: the ring animation posted by The Math Flow. The original creator has not been verified; what is kept here is the screenshot as seen while reading.
- Michael Hutchings — The mathematics of Rubik's Cube. Groups, permutations, cube operations and invariants; slides pages 8–9, 23, 28–34.
- Jaap Scherphuis — Group Theory for puzzles. Permutation parity, 3-cycles, conjugation and commutators; sections 5, 7.
- Herbert Kociemba — The Cubie Level. Position and orientation representation of corners and edges.
- WCA Regulations — Article 12: Notation. Notation for face turns, inverse turns and half turns.
- Herbert Kociemba — The Faceletlevel. Sticker-level numbering and position representation.
- Jaap Scherphuis — Useful Mathematics. The Conjugation and Commutation sections.
- God's Number is 20. The 2010 computational proof of the full 3×3×3 cube diameter in HTM.
- God's Number is 26 in the Quarter Turn Metric. The 2014 computational proof of the diameter in QTM.
- Herbert Kociemba — The Two-Phase Algorithm Coordinates. Two-phase solving and subgroup coordinates.