Implement a depth-first backtracking solution (such as was used to solve the farmer, wolf, goat, and cabbage

Question:

Implement a depth-first backtracking solution (such as was used to solve the farmer, wolf, goat, and cabbage problem in Section 16.2) to the missionary and cannibal problem:

Three missionaries and three cannibals come to the bank of a river they wish to cross. There is a boat that will hold only two people, and any of the group can row it. If there are ever more missionaries than cannibals on any side of the river the cannibals will get converted.

Devise a series of moves to get everyone across the river with no conversions.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: