This dataset contains a million of Rubik's cube status along with the best next move for each status.
This dataset is generated by this notebook, check it out for more information:
https://www.kaggle.com/code/marcellosemboli/one-million-of-rubik-cube-moves
The cube
Notations below are taken from World Cube Association.
Faces of the cube
A solved cube has 6 faces and 6 colors:
- U - upper, White
- L - left, Orange
- F - front, Green
- R - right, Red
- B - back, Blue
- D - down, Yellow
Faces are coded as follows:
- U - 0
- L - 1
- F - 2
- R - 3
- B - 4
- D - 5
Colors
Colors are coded as follow:
- 0 White
- 1 Orange
- 2 Green
- 3 Red
- 4 Blue
- 5 Yellow
Each face has 9 tiles (from 0 to 8) for a total of 6 x 9 = 54 tiles.
Names of tiles are U0,..,U8,L0,..,L8,..,D8
Status of cube
A status of cube is a tuple of 54 colors, 9 tiles for each of 6 faces.
According to the python rubik-cube module a solved cube status is:
WWWWWWWWWOOOGGGRRRBBBOOOGGGRRRBBBOOOGGGRRRBBBYYYYYYYYY
In numbers:
000000000111222333444111222333444111222333444555555555
The status of the same cube after L move is:
400400400111022333445111022333445111022333445255255255
See below for other examples.
Moves
Rubik's cube has 12 possible moves, 6 clockwise and 6 counterclockwise, coded as follows:
Clockwise
- U - 0
- L - 1
- F - 2
- R - 3
- B - 4
- D - 5
Counterclockwise
- U' - 6
- L' - 7
- F' - 8
- R' - 9
- B' - 10
- D' - 11
Double moves as U2, L2 etc. are not used.
Scramble
A scramble is a sequence of moves, where subsequent moves are'nt opposite. Sequences of three same moves are excluded as well.
Since the God's number is 20, I will use scrambles of maximum 20 moves and the opposite of last move is the best move for a solve of that scramble.
The dataset
The dataset is a csv file were each line is a status of the cube, and the best move for that status.
Columns from 0 (the first) to 53 are named after tiles position in status of the cube, and contains the color number.
Last 12 columns are named after moves and are all 0 except the best move is 1.
U0,U1,U2,U3,U4,U5,U6,U7,U8,L0,L1,L2,F0,F1,F2,R0,R1,R2,B0,B1,B2,L3,L4,L5,F3,F4,F5,R3,R4,R5,B3,B4,B5,L6,L7,L8,F6,F7,F8,R6,R7,R8,B6,B7,B8,D0,D1,D2,D3,D4,D5,D6,D7,D8,U,L,R,F,B,D,Ui,Li,Ri,Fi,Bi,Di
For a total of 54 + 12 = 66 columns.
Each row is 132 bytes, one million rows are 132M bytes = 126 Mb.