• Welcome to SpeedSolving.com — the world’s largest puzzle community!

    You’re currently browsing as a guest, which means you have limited access to discussions, resources, member profiles, and community features.

    Join 50,000+ cubers and puzzle enthusiasts from around the world to ask questions, share solves, improve faster, and be part of the community.

    Registration is free, fast, and easy — create your account today.

    Already a member? Log in here to hide this message and start participating.

Development of a megaminx solver

Personally, I think this is the first major, significant breakthrough in the application of AI to twisty puzzle theory. The 3x3x3 results from the various AI papers are not as impressive since we have conventional optimal and near-optimal solvers that are very efficient. The 4x4x4 and 5x5x5 results are a bit more interesting, but there are fairly good solvers at least for the 4x4x4. But for megaminx, there's really nothing close that I know of, and the superflip result shocks me.

The basic approach, as I understand it, is to use random "scrambles" to generate a training set, train a neural net to guess distances, and then use ordinary beam search to bring a scrambled state to solved. Essentially, when comparing it to the traditional Korf approach, the beam search replaces iterated depth-first search, and the neural net replaces the pruning table. But I'm shocked that this approach *converges* for the megaminx, that the neural net is able to capture enough "distance" information so beam search actually leads to a solution. And I'm even more impressed that it works for the megaminx, where every piece is in the correct place, and each edge is only three moves from its properly oriented placement.

Can I ask how much megaminx-specific code you had to write? Is there any megaminx-specific information you used? How big is the neural net?

I am just completely blown away by this result.
 
Can I ask how much megaminx-specific code you had to write? Is there any megaminx-specific information you used? How big is the neural net?
I wrote a lot of my own code, but in fact, the approach from the paper generalizes to other puzzles quite easily – you just need to change the set of valid moves, the size of the permutation, and a few hyperparameters, and then run the training pipeline to get a model that solves the given puzzle. The inference of the model to obtain the solution is also the same. I think, this is one of the significant results of the paper, which shows that the same approach generalizes to many Cayley graphs, from cubes to pancakes.
 
Last edited:
I bet that was narrated, and "Kelly" should be "Cayley". In any case, the question then becomes, how much of the "secret sauce" is in the "lot of your own code" or the general approach. For instance, if you recognized a particular distance heuristic (some variation of a Manhattan metric, say) and added manually, or if the network somehow implicitly learned something about the megaminx . . . in any case, I hope a lot of people start playing with this (especially on the megaminx)!
 
I bet that was narrated, and "Kelly" should be "Cayley"
Yes, thanks, fixed it
I bet that was narrated, and "Kelly" should be "Cayley". In any case, the question then becomes, how much of the "secret sauce" is in the "lot of your own code" or the general approach. For instance, if you recognized a particular distance heuristic (some variation of a Manhattan metric, say) and added manually, or if the network somehow implicitly learned something about the megaminx . . . in any case, I hope a lot of people start playing with this (especially on the megaminx)!
I meant that I wrote a lot of code while working on this problem, and the training script itself was written by me.

There is a certain amount of “secret sauce” that I use for Kaggle competition submissions, but for the 48-FTM superflip I used an almost pure CayleyPy approach.

The only thing that was not in the authors’ original version is a custom loss that uses symmetries of the generator group to generate isomorphic scrambles, for which the model should predict the same distance. I inject this knowledge directly into the loss.

This is not Megaminx-specific knowledge; in fact, such symmetries can be computed for any generator group. I think a similar result could probably be achieved even without this change. It is one of my current working hypotheses: that it speeds up model convergence and helps the model better understand the structure of the group.
 
I just found 48-FTM superflip solution, which I believe is the shortest known so far.

I also found 50-FTM solution, that corresponds to only 54 moves in QTM.
This is extremely cool, bravo! It surprises me that the superflip can be solved in that few moves. It makes me wonder - like many times before - what the true God's Number is for this puzzle.

Could you guys give me some intermediate tips on megaminx?
I'm not sure this is the thread to put this question in. YouTube might be a better tool for this kind of thing.
 
This is extremely cool, bravo! It surprises me that the superflip can be solved in that few moves. It makes me wonder - like many times before - what the true God's Number is for this puzzle.
So since superflip can be solved in 47 moves, and we know by canonical sequences and state counts that there are positions that take at least 48 moves, this proves that superflip is not an antipode on the megaminx.
 
So since superflip can be solved in 47 moves, and we know by canonical sequences and state counts that there are positions that take at least 48 moves, this proves that superflip is not an antipode on the megaminx.
That’s a very insightful observation!

Do you have any intuition about what could be an antipode for the Megaminx?

Could it be a state where all pieces are significantly displaced from their solved positions?
For example, on the Rubik’s Cube in QTM, this is the superflip combined with four spots.

My intuition comes from the observation that any piece can be moved to an arbitrary target position (ignoring orientation and other pieces) on the Megaminx in 3 moves in FTM and 5 moves in QTM. On the cube, the analogous number is at most 2 (3 in qtm) moves. Of course, these are not strict bounds -- just a rough intuition.
 
I worked out setups for representatives of the 17 movers of the 3Gen state:
F R' U' F2 R2 U2' F' R2 U F2 R2 U2' F R2 U2' F2' U2
F2' R U2 F2' U2 R2' F2' U' R2' F R2' U2' F2 R' U' F U
F2 U2' F2 R2' F' R' U F2' R' U2 F2' U2' R2' F2' R U2' F
Judging the antipodes of the 3Gen states my guess would be that it is a state that involves moving around some pieces to their antipodal positions. Since that requires a lot more moves on the megaminx than on the 3x3, i would not be surprised if its an inherent property of such a state.
 
Last edited:
Have these top solvers been used to test WCA-style scrambling, or could you do that now? What I'd like to see is the average solution length of let's say 100 or 1000 scrambles for each of these:

- random states
- WCA-style 70 random moves scrambles
- Same but with 100 moves (what I had initially suggested)
- Old WCA-style 60 random moves scrambles
 
Last edited:
Have these top solvers been used to test WCA-style scrambling, or could you do that now? What I'd like to see is the average solution length of let's say 100 or 1000 scrambles for each of these:

- random states
- WCA-style 70 random moves scrambles
- Same but with 100 moves (what I had initially suggested)
- Old WCA-style 60 random moves scrambles
Shameless plug: I published my own analysis of mega scrambles last year.
 
Have these top solvers been used to test WCA-style scrambling, or could you do that now? What I'd like to see is the average solution length of let's say 100 or 1000 scrambles for each of these:

- random states
- WCA-style 70 random moves scrambles
- Same but with 100 moves (what I had initially suggested)
- Old WCA-style 60 random moves scrambles

I just did a test with the basic solver and a sample size of 100 scrambles, which gave

93,02 moves for random state.

93,04 moves for random moves (which I assume is old WCA-style).

93.14 moves for WCA-style.

92.91 moves for WCA-style 100 moves.


So far it seems to be pretty insignificant but I think xyzzy's analysis is a lot more telling anyway.
 
I just did a test with the basic solver and a sample size of 100 scrambles, which gave

93,02 moves for random state.

93,04 moves for random moves (which I assume is old WCA-style).

93.14 moves for WCA-style.

92.91 moves for WCA-style 100 moves.


So far it seems to be pretty insignificant but I think xyzzy's analysis is a lot more telling anyway.
This lines up with my understanding of xyzzy's analysis. Current WCA megaminx scrambles aren't necessarily objectively closer to being solved than other, more thorough scrambling methods - but rather, WCA scrambles tend to be marginally (but measurably) easier for humans, especially during the first few steps of the solve, due to a higher likelihood of things like pre-made corner-edge pairs.
 
I just did a test with the basic solver and a sample size of 100 scrambles, which gave

93,02 moves for random state.

93,04 moves for random moves (which I assume is old WCA-style).

93.14 moves for WCA-style.

92.91 moves for WCA-style 100 moves.


So far it seems to be pretty insignificant but I think xyzzy's analysis is a lot more telling anyway.
That means different scrambles give same result ?

Having good scrambler would be useful for our AI approach since it will allow to generate better quality train data. And also important for mathematics where it is one of the research directions -- reducing mixing time for random walks.

I would be happy if some one can share his expérience.
 
Would it be possible for you to make a submit to Kaggle ?
To describe your method ?
To colaborate with us ?
I will look into it, but I am a bit busy right now with finding a job :D

That means different scrambles give same result ?

Having good scrambler would be useful for our AI approach since it will allow to generate better quality train data. And also important for mathematics where it is one of the research directions -- reducing mixing time for random walks.

I would be happy if some one can share his expérience.
Different scrambles gave the same results in terms of of how difficult they were to solve for my solver, but its unclear what that can say about human-solvers or optimal solutions. Wouldnt you just need a random state generator for training data?
 
Hey guys, I have a 53-move superflip solution.

-BR.-DR.DL.-B.-DR.-FR.-FL.-D.-FL.-DL.-BL.FL.FL.-DL.-D.FR.D.-FL.DR.-L.-FL.DR.-U.-L.-FL.-F.-FL.-FR.-FL.-R.-FR.-FL.B.-D.DL.-FL.FR.-DL.-FL.-B.-FR.FL.-DR.FR.FL.L.F.-FR.FL.F.FR.-F.-F

I wrote a CUDA-based beam search and managed to run a beam width of 260 million. I used a 38M ananasclassic model

You need seconds=2252.6 and NVIDIA RTX PRO 6000 Blackwell Server Edition

 Twizzle link 
BR DR DL' B DR FR FL D FL DL BL FL' FL' DL D FR' D' FL DR' L FL DR' U L FL F FL FR FL R FR FL B' D DL' FL FR' DL FL B FR FL' DR FR' FL' L' F' FR FL' F' FR' F F
 
Last edited by a moderator:
Back
Top