smack42 / DriftingDroids

DriftingDroids - yet another Ricochet Robots solver program
https://github.com/smack42/DriftingDroids/wiki
GNU General Public License v3.0
41 stars 12 forks source link

Fail to find all distinct solutions with different final board positions #10

Closed chris0804 closed 8 years ago

chris0804 commented 8 years ago

Game ID: 0361+52+2A21631CAF+D6

The program did not find the following solution, which will result in a different final position (yellow and silver swapped)

1: ↑ red North 2: ← red West 3: ← silver West 4: → blue East 5: ↓ blue South 6: ← blue West 7: ↑ silver North 8: ← silver West 9: ← yellow West 10: ↓ yellow South 11: ↓ blue South 12: ← blue West 13: ↑ blue North

smack42 commented 8 years ago

That's a consequence of another "optimization trick" used by the solver. The idea is that the non-active (helper) robots can be exchanged without consequences, which means that the positions are equivalent if you just swap the yellow and silver robots in this example. This allows the search algorithm to omit many equivalent paths in the search graph and to finish much more quickly.

Michael Fogleman uses this trick in his solver program as well and mentions it on slide 10 (Improvement) of his presentation: https://speakerdeck.com/fogleman/ricochet-robots-solver-algorithms

However, the idea for this optimization is much older. If I remember correctly, I first found it in 2011 in the source code of the great (fast!) solver program RRTrainer by David Hansel. https://boardgamegeek.com/thread/308557/hardest-ricochet-robots-problem

In DriftingDroids 1.3.5 you can activate the semi-hidden option "UseSlowSearchMoreSolutions" (by removing the "#" from the last line in file "appstart.properties") to make the solver algorithm find these equally good solutions, as discussed in issue #7.