r/pythonhelp • • Jul 14 '24

Need assistance with generating every single combination for a list!

Is here someone who has experience generating every single combination for a set list. In my case this list is ["U", "B", "D", "F", "L", "R"]. Each character can repeat it self not more than 9 times and the every combination list cannot be smaller and less than 54 characters. What would be the fastest way to generate every single combination? If you need more context, I need to generate every single state for a Rubik's cube so there is a way to prune some branches by checking whether this type of cube can exist, but still in my experience backtracking is way to slow. Any suggestions will be appreciated.

1 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/kaskapian Jul 17 '24

I decided to go on a different route. I decided to use heuristics and IDA* for this problem. Herbert Kociemba suggested to use this approach. But thanks for the suggestion.

1

u/CraigAT Jul 20 '24

Cool thanks for replying with what you went with.