I have made a game that consists of a pyramid of hexagons with numbers from 00 to 99 randomly positioned in groups of 6, 10 or 15 elements. Now, I'm working to create an auto-solver but for the last 2 weeks, I have got nothing really worth produced, and would like your help. My objective is to determine the minimum swaps need to turn the left pyramid into the right pyramid:
Obviously, there's a catch: every cell can be exchanged only with it's neighbors cells, as below:
I've tried a lot of approaches with binary heap, BST and others, but I can't seems to find a proper answer. What would be the best algorithm choice to determine the minimum swaps needed to sort this hive?
Thanks in advance for any help,