0

I was thinking about implementing the classical river crossing puzzle game and I was wondering what would be the most appropriate search algorithm to solve it. Here is an example of the game

Apparently there is enough information to predict the distance from the current state to the goal, so a heuristic search could be used. Going through the different states I found a case where the search can enter an endless loop. Here is the case: On the left side of the river there are two creatures (one of both kinds) On the right side of the river there are four creatures (two of both kinds) The boat is on the right side

There are 2 legal moves:

  • return two munchkins (those who should not be outnumbered by the others) this will cause a loop
  • return two creatures (1 of both kinds) this is the move that should be taken

enter image description here Is the usage of informed search better in this case? What would be the appropriate type of heuristic i.e Hill Climbing, A* What would be the best way to go through that looping.

lejlot
  • 64,777
  • 8
  • 131
  • 164
Jason Per
  • 139
  • 2
  • 12

0 Answers0