Blanwhit
KPCKevin Powell - Community
•Created by Blanwhit on 12/26/2024 in #back-end
How to get from string to anagram in fewest number of swaps?
I'm done with the solver itself, but I want it to tell the user the least number of swaps to win, and how to do the swaps
14 replies
KPCKevin Powell - Community
•Created by Blanwhit on 12/26/2024 in #back-end
How to get from string to anagram in fewest number of swaps?
I'm making a solver for https://wafflegame.net
14 replies
KPCKevin Powell - Community
•Created by Blanwhit on 12/26/2024 in #back-end
How to get from string to anagram in fewest number of swaps?
Either way, thanks for suggestions everyone
14 replies
KPCKevin Powell - Community
•Created by Blanwhit on 12/26/2024 in #back-end
How to get from string to anagram in fewest number of swaps?
I've looked at lots of edit distance algorithms but none of them were close enough to this that a small modification could solve the problem. However, I did figure out a way of handling it using the fact that each permutation of a group can be uniquely converted into transpositions. It's rather inefficient since I have to try all permutations of repeated letters but hey, it works.
14 replies
KPCKevin Powell - Community
•Created by Blanwhit on 12/26/2024 in #back-end
How to get from string to anagram in fewest number of swaps?
Yes. The strings can have any combination of letters in any order, the only condition is that they’re anagrams of each other
14 replies