Using GAP to produce solutions to Pentultimate
Submitted by DougCube on Tue, 12/11/2007 - 16:14.
I recently got started using GAP, and wrote a C++ program that generates legal scrambles in cyclic-notation for GAP, and some GAP code that gives solutions to them using the "PreimageRepresentative" function. On short scrmables, it can produce the reverse turns to solve it (likely optimal). But for a random scramble of say 500 turns it produces solutions over 14000 turns (in the analog of QTM or 'word-length' in the freegroup). This is not satisfactory to me because I can solve it by hand using less than 1000 turns doing centers-first.
You can play with this puzzle here (it doesn't physically exist yet): http://users.skynet.be/gelatinbrain/Applets/Magic%20Polyhedra/dodeca_f6.htm
Just to give some backstory... Initally, I used GAP to find solutions to twisting two corners on on a layer, by giving it only one sequence (alg) and a particular single turn - which worked out great for endgame stuff.
Anyways, the final full pentultimate code I have:
====
fullpent := Group( (20,30,40,50,60)(11,12,13,14,15)(21,31,41,51,61)(22,32,42,52,62)(23,33,43,53,63)(25,35,45,55,65)(121,111,101,91,81), (10,60,80,120,30)(21,22,23,24,25)(11,65,85,121,32)(12,61,81,122,33)(13,62,82,123,34)(15,64,84,125,31)(51,95,75,112,42), (10,20,120,110,40)(31,32,33,34,35)(12,25,125,111,42)(13,21,121,112,43)(14,22,122,113,44)(11,24,124,115,41)(61,85,74,102,52), (10,30,110,100,50)(41,42,43,44,45)(13,35,115,101,52)(14,31,111,102,53)(15,32,112,103,54)(12,34,114,105,51)(21,125,73,92,62), (10,40,100,90,60)(51,52,53,54,55)(14,45,105,91,62)(15,41,101,92,63)(11,42,102,93,64)(13,44,104,95,61)(31,115,72,82,22), (10,50,90,80,20)(61,62,63,64,65)(15,55,95,81,22)(11,51,91,82,23)(12,52,92,83,24)(14,54,94,85,21)(41,105,71,122,32) ); t := FreeGroup("a","b","c","d","e","f"); hom := GroupHomomorphismByImages(t,fullpent,GeneratorsOfGroup(t),GeneratorsOfGroup(fullpent)); state := ( );
PreImagesRepresentative(hom,state);
====
I numbered it in a wierd way, using multiples of 10 for the centers, and numbering the corner stickers by the center number and 1-5.
Anyways, some scrambles:
====
state := (10,100,50,80,90,30,120,110,60,20,40)(11,111,64,124,53,42,94,54,15,125,44,81,32,104,52,33,55,73)(12,72,14,25,91,103,61,43,95,74,45,13,71,105,51,112,115,23)(21,93,41,121,63,114,22,35,82,113,101,31,83,92,62,34,102,65)(24,123)(75,122)(84,85);
====
state := (10,110,20,40,120)(11,115,24,41,124)(12,111,25,42,125)(13,112,21,43,121)(14,113,22,44,122)(31,34,32,35,33)(52,74,61,102,85);
====
state := (10,40,30)(11,61,22)(12,41,35)(13,42,31)(14,43,32)(15,34,104,94,92,23,114,75,74,62,112,93,83,105,81,103,84,124,51,125,72,71,54,65,73,123,113)(20,110,90,120,50,60)(21,52,111)(24,115,91,122,44,55,85,102,63)(25,101,82,33,45,95,121,53,64)(80,100)
====
These are 500, 1, and 3 turn scrmables respectively. Okay... now I'm beginning to think I did something wrong, like a typo somewhere, because at 3 turns, it spit out a 31,500 turn solution. I really don't know the capablities of GAP well enough to know if this is typical or not. I need help. The goal is for it to average under 1000 turns.
-Doug
You can play with this puzzle here (it doesn't physically exist yet): http://users.skynet.be/gelatinbrain/Applets/Magic%20Polyhedra/dodeca_f6.htm
Just to give some backstory... Initally, I used GAP to find solutions to twisting two corners on on a layer, by giving it only one sequence (alg) and a particular single turn - which worked out great for endgame stuff.
Anyways, the final full pentultimate code I have:
====
fullpent := Group( (20,30,40,50,60)(11,12,13,14,15)(21,31,41,51,61)(22,32,42,52,62)(23,33,43,53,63)(25,35,45,55,65)(121,111,101,91,81), (10,60,80,120,30)(21,22,23,24,25)(11,65,85,121,32)(12,61,81,122,33)(13,62,82,123,34)(15,64,84,125,31)(51,95,75,112,42), (10,20,120,110,40)(31,32,33,34,35)(12,25,125,111,42)(13,21,121,112,43)(14,22,122,113,44)(11,24,124,115,41)(61,85,74,102,52), (10,30,110,100,50)(41,42,43,44,45)(13,35,115,101,52)(14,31,111,102,53)(15,32,112,103,54)(12,34,114,105,51)(21,125,73,92,62), (10,40,100,90,60)(51,52,53,54,55)(14,45,105,91,62)(15,41,101,92,63)(11,42,102,93,64)(13,44,104,95,61)(31,115,72,82,22), (10,50,90,80,20)(61,62,63,64,65)(15,55,95,81,22)(11,51,91,82,23)(12,52,92,83,24)(14,54,94,85,21)(41,105,71,122,32) ); t := FreeGroup("a","b","c","d","e","f"); hom := GroupHomomorphismByImages(t,fullpent,GeneratorsOfGroup(t),GeneratorsOfGroup(fullpent)); state := (
====
I numbered it in a wierd way, using multiples of 10 for the centers, and numbering the corner stickers by the center number and 1-5.
Anyways, some scrambles:
====
state := (10,100,50,80,90,30,120,110,60,20,40)(11,111,64,124,53,42,94,54,15,125,44,81,32,104,52,33,55,73)(12,72,14,25,91,103,61,43,95,74,45,13,71,105,51,112,115,23)(21,93,41,121,63,114,22,35,82,113,101,31,83,92,62,34,102,65)(24,123)(75,122)(84,85);
====
state := (10,110,20,40,120)(11,115,24,41,124)(12,111,25,42,125)(13,112,21,43,121)(14,113,22,44,122)(31,34,32,35,33)(52,74,61,102,85);
====
state := (10,40,30)(11,61,22)(12,41,35)(13,42,31)(14,43,32)(15,34,104,94,92,23,114,75,74,62,112,93,83,105,81,103,84,124,51,125,72,71,54,65,73,123,113)(20,110,90,120,50,60)(21,52,111)(24,115,91,122,44,55,85,102,63)(25,101,82,33,45,95,121,53,64)(80,100)
====
These are 500, 1, and 3 turn scrmables respectively. Okay... now I'm beginning to think I did something wrong, like a typo somewhere, because at 3 turns, it spit out a 31,500 turn solution. I really don't know the capablities of GAP well enough to know if this is typical or not. I need help. The goal is for it to average under 1000 turns.
-Doug