[racket] Missionaries and cannibals

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Nov 29 22:19:00 EST 2010

1. Your sketch sounds about right. The problem is probably sticking to the discipline of turning it into code. 

2. The infinite loop is troubling -- but looking at your code is the wrong thing. The goal is to empower yourself so that you can do such things on your own w/o help from others. 

Have you thought thru why the algorithm should terminate (step 7 of the gen-rec design recipe)? 
If so, have you checked your program to make sure it adheres to your reasoning? 

3. You wrote "m thinking that the goal is to define mc-solvable? and use it in mc-solution sort of like the backtracking algorithm for finding-route." That's about right. In a sense, the MC problem generates a graph and the algorithm searches the graph for feasible routes from the initial state

  xxx | <>        |
  ooo |              |

to the final state: 

         |         <>| xxx 
         |              | ooo

-- Matthias



Posted on the users mailing list.