A way to visualize permutations given in disjoint cycle notation

CubeExplorer

Member
Using sage I get the relults of the combining permutations in disjoint cycles notation. It looks like the following example:
Code:
S48 = SymmetricGroup (48)
R=S48(" (25 ,27 ,32 ,30)(26 ,29 ,31 ,28)(3 ,38 ,43 ,19)(5 ,36 ,45 ,21)(8 ,33 ,48 ,24) ")
L=S48(" (9 ,11 ,16 ,14)(10 ,13 ,15 ,12)(1 ,17 ,41 ,40)(4 ,20 ,44 ,37)(6 ,22 ,46 ,35) ")
U=S48(" (1 ,3 ,8 ,6)(2 ,5 ,7 ,4)(9 ,33 ,25 ,17)(10 ,34 ,26 ,18)(11 ,35 ,27 ,19) ")
D=S48(" (41 ,43 ,48 ,46)(42 ,45 ,47 ,44)(14 ,22 ,30 ,38)(15 ,23 ,31 ,39)(16 ,24 ,32 ,40) ")
F=S48(" (17 ,19 ,24 ,22)(18 ,21 ,23 ,20)(6 ,25 ,43 ,16)(7 ,28 ,42 ,13)(8 ,30 ,41 ,11) ")
B=S48(" (33 ,35 ,40 ,38)(34 ,37 ,39 ,36)(3 ,9 ,46 ,32)(2 ,12 ,47 ,29)(1 ,14 ,48 ,27) ")
Ri=R^-1;Li=L^-1;Ui=U^-1;Di=D^-1;Fi=F^-1;Bi=B^-1
R2=R*R;L2=L*L;U2=U*U;D2=D*D;B2=B*B;F2=F*F
#   ppb 237
a=Fi*Di*F*Ri*D2*R*Fi*D*F
print('#   a =',a)
b=U
print('#   b =',b)
c=a*b*a^-1*b^-1
print('#   c =',c)
#   a = (6,8)(11,19)(13,21)(15,23)(17,25)(20,28)(24,38)(30,48)(32,43)(42,44)
#   b = (1,3,8,6)(2,5,7,4)(9,33,25,17)(10,34,26,18)(11,35,27,19)
#   c = (3,8,6)(11,27,19)(17,33,25)

The depiction should preferably be 3D or isometric.

EDIT: This thread has been started as a Question.
But now there is a self coded answer in it, which I share with the readers.

Last edited:

qwr

Member
well the 48 numbers correspond to the stickers so idk anything better than just performing the alg on a cube

Bruce MacKenzie

Member
In representing permutations of the 48 3x3x3 cube facelets I often use a standard configuration string introduced by Michael Reid twenty years ago:

Index..12 34 56 78 90 12 34 56 78 90 12 34 567 890 123 456 789 012 345 678
Slot...UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR

Here position 1 is the U facelet of the Up-Front edge cubie on through to the R facetlet of the Down-Back-Right corner cubie at position 48. Cube positions may then be represented as permutations of the identity arrangement above.

A three corner swap would then look like:

Facelet Configuration (Singmaster/Reid):

..............................•• •• •• •• •1 •• •• •• •• •2 •• •• ••• ••3 ••• ••• ••• 4•• ••• •••
Index.........12 34 56 78 90 12 34 56 78 90 12 34 567 890 123 456 789 012 345 678
Slot..........UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR
Configuration UF UR UB UL DF DR DB DL FR FL BR BL URB ULF UBL UFR DRF DFL DLB DBR

Facelet Permutation (GAP Canonical Cycle Notation):
(25,28,34)(26,29,35)(27,30,36)

This numbering differs from what you are using. With this numbering the face turns are:

gap> R := (3,17,11,21)(4,18,12,22)(25,39,46,30)(26,37,47,28)(27,38,48,29);

gap> U := (1,3,5,7)(2,4,6,8)(25,28,31,34)(26,29,32,35)(27,30,33,36);

gap> F := (1,20,9,18)(2,19,10,17)(25,35,40,38)(26,36,41,39)(27,34,42,37);

gap> L := (7,23,15,19)(8,24,16,20)(31,45,40,36)(32,43,41,34)(33,44,42,35);

gap> D := (9,15,13,11)(10,16,14,12)(37,40,43,46)(38,41,44,47)(39,42,45,48);

gap> B := (5,22,13,24)(6,21,14,23)(28,48,43,33)(29,46,44,31)(30,47,45,32);

With this numbering your "a" turn sequence comes out as:

F' D' F R' D2 R F' D F
Facelet Configuration (Singmaster/Reid):

..............................•• •• •• •• •1 •• •• •• •• •2 •• •• ••• ••3 ••• ••• ••• 4•• ••• •••
Index.........12 34 56 78 90 12 34 56 78 90 12 34 567 890 123 456 789 012 345 678
Slot..........UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR
Configuration.UF UR UB UL DL DR DB DF LF RF BR BL ULF URB UBL UFR RDB DFL DLB RFD

Facelet Permutation (GAP Canonical Cycle Notation):
(9,15)(10,16)(17,20)(18,19)(25,34)(26,35)(27,36)(37,48)(38,46)(39,47)

Last edited:

CubeExplorer

Member
standard configuration string introduced by Michael Reid
Sounds interesting too. I will have a look at it.

However I have not yet found a way to conveniently vizualize the permutations given in disjoint cycle notation in 3d.

2d works in sage, but the color schema is weird:

Code:
m2=RubiksCube().move("(1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18)");
m2.show()

qwr

Member
can you draw a Cayley graph?

CubeExplorer

Member
I have not yet found a way to conveniently vizualize the permutations given in disjoint cycle notation in 3d.
What I mean is visualization of single permutations, one by one, given in disjoint cycle notation. Thats the topic I will stick to here in this thread.

CubeExplorer

Member
That doesn't look like a possible representation.
I do not understand. What exactly does not represent what? Sorry for not being native speaker of english.

This image is sages representation of the said permutation.

So maybe that's why it's weird?
Of which "it" are you talking there?
I related to the color scheme to be weird. Just look to the picture sage produces.

Because, if all you're doing is trying ...
All Im doing ist looking for a way to get 3d image representations of permutations given in disjoint cycles notation.

Last edited:

Bruce MacKenzie

Member
This:
(1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)

is a 15-cycle. You cannot have a 15-cycle of stickers on the 3x3x3. The (vague) image you showed from Sage was irrelevant to this fact.
I am afraid you are mistaken. This is a five corner cubie cycle with a net twist. Once through the cycle returns the five cubies to their home positions but twisted. One must go through the cubie cycle three times before everything goes back right. It's possible to have a 22 facelet cycle on the cube:

Attachments

• Screen Shot 2021-10-26 at 10.54.53 AM.jpg
101 KB · Views: 7
Last edited:

CubeExplorer

Member
This: (1,3,38,43,11,35,27,32,30,17,9,33,48,24,6) is a 15-cycle. You cannot have a 15-cycle of stickers on the 3x3x3.
So you seem to consider the following output of sage as wrong:
RU=R*U
RU = (1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18)

Because thats not really the main topic of my thread, I do not comment or discuss it now.

EDIT: I just see the answer of Bruce which appeared, while I was writing.

Last edited:

CubeExplorer

Member
This is a five corner cubie cycle with a net twist. Once through the cycle returns the five cubies to their home positions but twisted. One must go through the cubie cycle three times before everything goes back right.

^---< This describes exactly what one can see watching a cube when applyin "RU" repeatedly.

6 Corners are moving. Corner URF is just rotated at its position by each "RU". This is mathematicly documented by the cycle "(8,25,19)".
The other 5 Corners make a round trip during 5 "RU" maneuvers. After three round trips they are home again AND in the original orientation. This yields 15 repetitions.
7 edges (edge pieces) are moving on a round trip too. This does not change their orientation. They move through 7 positions. So their travel is described by the two cycles containing 7 elements.
In short:"RU = (1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18)"

For some mysterious reasons christophers contributions disappeared.

Now after this interesting but slightly off topic discussion, I still want to know, wether there is a piece of software available which can show the 3d result of applying eg. (1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18) directly.

Bruce MacKenzie

Member
^---< This describes exactly what one can see watching a cube when applyin "RU" repeatedly.

6 Corners are moving. Corner URF is just rotated at its position by each "RU". This is mathematicly documented by the cycle "(8,25,19)".
The other 5 Corners make a round trip during 5 "RU" maneuvers. After three round trips they are home again AND in the original orientation. This yields 15 repetitions.
7 edges (edge pieces) are moving on a round trip too. This does not change their orientation. They move through 7 positions. So their travel is described by the two cycles containing 7 elements.
In short:"RU = (1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18)"

For some mysterious reasons christophers contributions disappeared.

Now after this interesting but slightly off topic discussion, I still want to know, wether there is a piece of software available which can show the 3d result of applying eg. (1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18) directly.
No, I would say you're limited to Sage. I can do it but I had to write a routine to translate Mulholland's object based permutations on his facelet numbering scheme to position based permutations on my facelet numbering scheme. Then output that as a facelet permutation string that I could input into my cube simulation. No off the shelf cube app is going to be able to do that.

CubeExplorer

Member
No off the shelf cube app is going to be able to do that.
Most likely it is so. So I will do it probably myself. There are simulators which can paint the facelets on demand, one by one. It would not be too extensive to let sage or something else generate a string, which controls the painting. I just have to decide which of my many tinkering sites have which level of priority.

Bruce MacKenzie

Member
Most likely it is so. So I will do it probably myself. There are simulators which can paint the facelets on demand, one by one. It would not be too extensive to let sage or something else generate a string, which controls the painting. I just have to decide which of my many tinkering sites have which level of priority.
Good luck. Is Cube Explorer limited to turn sequences for entering cube states? Back around 08 Herbert Kociemba put a link to the source code of an optimal cube solver on his web site (it's still there). It is a unix command line app in C. I ported it over to Objective C and wrapped it in a MacOS GUI (a link to that app is still on his web site but it won't run on more recent versions of MacOS). Anyway, Herbert's solver accepted input of cube states as Michael Reid's facelet permutation strings. That's where I picked up the system and I've used it in my own apps ever since. Does Cube Explorer accept input in that form?

CubeExplorer

Member
Good luck. Is Cube Explorer limited to turn sequences for entering cube states?
Thank you.

Cube Explorer lets you paint the facelets by Mouseclick. The Maneuvers like FRUR'U'F' can be entered via keyboard or copy and paste. But Im no expert. I chose my nick without knowing the existence of a program with this name.

Currently Im working on the workflow of presenting turn sequences as animation. Its a more humble form of exploration.

Bruce MacKenzie

Member
Thank you.

Cube Explorer lets you paint the facelets by Mouseclick. The Maneuvers like FRUR'U'F' can be entered via keyboard or copy and paste. But Im no expert. I chose my nick without knowing the existence of a program with this name.

Currently Im working on the workflow of presenting turn sequences as animation. Its a more humble form of exploration.

View attachment 17499

I went to Kociemba' web site and downloaded Cube Explorer. I only use an iMac so I couldn't run it. I was hoping to find a Help file but all I found is a ReadMe file. However, in this I saw the following entry:

2006-05-09 Cube Explorer 3.80
-Coset Explorer integrated, but only in the version 3.80s. About 279 million
cubes can be solved optimally(!) within a couple of hours.
-Cubes are loaded and saved in Singmaster notation if there yet is
no maneuver string computed.
-Changed the labeling of the symmetric subgroups according to my homepage.
-Some changes in the Options menu.

Kociemba's Singmaster notation is none other than Michael Reid's facelet permutation string. So I bet you can enter cubes as facelet permutation strings, maybe by reading a text file or maybe by pasting them in where you would otherwise paste a turn sequence. If so all you need to do is translate Mulholland's permutations into facelet permutation strings and then visualize them in Cube Explorer.

Last edited:

CubeExplorer

Member
Kociemba's Singmaster notation is none other than Michael Reid's facelet permutation string.
I dont think so. Commonly "Singmaster notation" seems to refer to turn sequences. At least most of the time. When I played with CE, program reacted accordingly. The result showed, that the input of RU was interpreted as a cw turn of the right face (consisting of 9 cubies) followed by a cw turn of the up face (consisting of 9 cubies).

Singmaster FACET notation is a different thing.
Code:
sage.groups.perm_gps.cubegroup.index2singmaster(facet)

Translate index used (eg, 43) to Singmaster facet notation (eg, fdr).

EXAMPLES:

sage: from sage.groups.perm_gps.cubegroup import index2singmaster
sage: index2singmaster(41)
'dlf'

.. translate Mulholland's permutations into facelet permutation strings ...
You are right, this is the easy part. we only have to replace the numbers by letter groups and reorder the whole thing.

Unfortunately CE would not understand this format without adding another interface.

Last edited:

Bruce MacKenzie

Member
David Singmaster back in the 1980s wrote about the Cube and originated the convention of using the letters R, U, F, L, D, B to refer to the faces of the cube. Anything using that convention can roughly be called "Singmaster Notation".

Michael Reid in around 1997 wrote one of the first optimal cube solvers capable of solving random cube states (in a day or two on the PCs of that time). His program accepted input as facelet permutation strings.
From the docs for his program:

"
5. Input to the optimal solver

A solved cube is represented as

UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR

To input a scrambled cube, first give the cubie that's in the UF location,
then the cubie in the UR location, and so forth, according to this list
above. For example, "cube in a cube" would be

UF UR RD RB LU LF DB DL FR UB DF BL UFR RFD RDB RBU LFU LUB DLB LDF

This input should all be on one line.
"

Herbert Kociemba's 2008 optimal solver accepted input in this form. From the docs of his program:

"
You may enter the cubes in Singmaster notation[1] like

UF UR RD RB LU LF DB DL FR UB DF BL UFR RFD RDB RBU LFU LUB DLB LDF

or in maneuver notation like

U2 F2 R2 U' L2 D B R' B R' B R' D' L2 U'
.
.
.
-------------------------------------------------------------------------------
5. Notes
-------------------------------------------------------------------------------

[1] Singmaster Notation:
A solved cube is represented as

UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR

To input a scrambled cube, first give the cubie that is in the UF location,
then the cubie in the UR location, and so forth, according to the list
above. For example, "cube in a cube" would be

UF UR RD RB LU LF DB DL FR UB DF BL UFR RFD RDB RBU LFU LUB DLB LDF
"

Clearly Kociemba adopted Michael Reid's convention and refers to it as "Singmaster Notation". It is unfortunate that CE does not seem to accept input in that form.

CubeExplorer

Member
Thanks a lot.

To my surprise, CE displays the facelet permutations perfetly. I can put them into the Maneuver field and the program recognizes them as different from the rotation sequences.

I think this is a big part of a solution to my software search.

Bruce MacKenzie

Member
That's great! I suspected that Kociemba would use the same text to cube state routine in CE that he used in his old optimal solver.

Maybe you'll find the code for my conversion routine helpful. It's for MacOS in Objective C so you'll have to port it to whatever platform you use.

 // Input a Mulholland cycle string such as (25 ,27 ,32 ,30)(26 ,29 ,31 ,28)(3 ,38 ,43 ,19)(5 ,36 ,45 ,21)(8 ,33 ,48 ,24) -(void)developerXX: (NSString *)input { NSUInteger n; //Map Mulholland indexes to Reid indexes (both zero based) // e.g. Mulholland facelet 0 is Reid facelet 30 uint8 map[48] = { //Up 30,4,27, 6,2, 33,0,24, //Left 32,7,34, 23,19, 43,15,41, //Front 35,1,25, 18,16, 40,9,38, //Right 26,3,28, 17,21, 37,11,47, //Back 29,5,31, 20,22, 46,13,44, //Down 39,8,36, 14,10, 42,12,45 }, mulholland[48], reid[48], *p; NSData *perm; unichar identity[48], permuted[48]; NSString *singmaster = @"UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR", *token; NSMutableString *result; //Strip the spaces from the identity configuration singmaster = [singmaster stringByReplacingOccurrencesOfString: @" " withString: @""]; [singmaster getCharacters: identity]; //expand the cycle string to a 0 based permutation //zero based for use with zero based C arrays perm = [self permutationForCycleString: input length: 48 ]; // convert from object based to position based (i.e. take the inverse) p = (uint8 *)[perm bytes]; for( n = 0 ; n < 48 ; n++ ) mulholland[ p[n] ] = n; // Convert from Mulholland indexing to Reid indexing for( n = 0 ; n < 48 ; n++ ) reid[ map[n] ] = map[ mulholland[n] ]; //apply the permutation to the facelet string for(n = 0 ; n < 48; n++ ) permuted[n] = identity[ reid[n] ]; result = [NSMutableString stringWithCharacters: permuted length: 2 ]; // Restore the spaces for( n = 1 ; n < 12 ; n++ ) { token = [NSString stringWithCharacters: permuted + 2 * n length: 2]; [result appendFormat: @" %@", token ]; } for( n = 0 ; n < 8 ; n++ ) { token = [NSString stringWithCharacters: permuted + 24 + 3 * n length: 3]; [result appendFormat: @" %@", token ]; } [self report: [NSString stringWithFormat: @"\n\n%@", result]]; [self reportDone]; } 

Last edited:

CubeExplorer

Member
A few lines in sage math result in a string, which can be copied and pasted to Kocembas Cube Explorer. The facets will be printed according to the permutation given in disjoint cycles notation.

Code:
# Singmaster Letters
SML=" UUUUUUUULLLLLLLLFFFFFFFFRRRRRRRRBBBBBBBBDDDDDDDD"
# Reid String Order
RSO=([7,18,0,5,26,0,2,34,0,4,10,0,42,23,0,45,31,0,47,39,0,44,15,0,21,28,0,20,13,0,36,29,0,37,12,0]+
[8,19,25,0,3,27,33,0,1,35,9,0,6,11,17,0,43,30,24,0,41,22,16,0,46,14,40,0,48,38,32,0])
out=""
for i in range(0,len(RSO)):
#print(i,RSO[i])
out+=SML[RSO[i]]
print("Reid facet string for the solved cube:\n"+out)
cg=CubeGroup()
movseq=cg.parse('R*U')
inverted=cg.parse("U'*R'") #ok
print("Move sequence example\n",movseq)
print("Inverse of (movseq)  \n",inverted)
finverted=cg.facets(inverted)
print("Facet list of (movseq)inverted:\n",finverted)
out=""
for i in range(0,len(RSO)):
#print(i,RSO[i])
out+=SML[([0]+finverted)[RSO[i]]]
print("Reid facet string, copy and paste eg. to Cube Explorer of H. Kociemba:\n"+out)
===>> corresponding Output:
Reid facet string for the solved cube:
UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR
Move sequence example
(1,3,38,43,11,35,27,32,30,17,9,33,48,24,6)(2,5,36,45,21,7,4)(8,25,19)(10,34,26,29,31,28,18)
Inverse of (movseq)
(1,6,24,48,33,9,17,30,32,27,35,11,43,38,3)(2,4,7,21,45,36,5)(8,19,25)(10,18,28,31,29,26,34)
Facet list of (movseq)inverted:
[6, 4, 1, 7, 2, 24, 21, 19, 17, 18, 43, 12, 13, 14, 15, 16, 30, 28, 25, 20, 45, 22, 23, 48, 8, 34, 35, 31, 26, 32, 29, 27, 9, 10, 11, 5, 37, 3, 39, 40, 41, 42, 38, 44, 36, 46, 47, 33]
Reid facet string, copy and paste eg. to Cube Explorer of H. Kociemba:
FR UB UL UF DF BR DB DL DR FL UR BL FRU UBL ULF FDR BRD DFL DLB BUR

Some printed lines have been added for explanation.

The lines above are not the final result, they are just a checkpoint on the road. Next I will apply the solution to more realistic 3d Output.

Last edited: