N missionaries and N cannibals come to a river and find a boat that holds two. If the cannibals ever outnumber the missionaries on either bank, the missionaries will be eaten.
Write a Java applet that implements a search able to solve this problem.
The applet should implement the following searches:
- depth first,
- breadth first,
- iterative deepening
The applet should allow the user to:
Choose the number of missionaries and cannibals
Choose the search method.
The applet should display the partial solutions considered in the search.
Implement this as generally as possible. Most of the code should be problem independent. Isolate the classes that are problem dependent in such a way that you can use the same code for other future programs.