Inscrit le: 23 Juin 2018
|Posté le: Lun 25 Juin - 12:42 (2018) Sujet du message: Cannibals and missionaries help!!!
For one of my classes we are doing the cannibals and missionaries problem where there are 3 of both and 1 boat that can hold 2 people. The objective is to get all members across a river but if the missionaries ever outnumber the cannibals then the cannibals will be converted. We need to write a program to solve this problem, then have it solve it with a breadth or depth first search and a best-first search. The code below is what I have but I cannot get it to work please any help would be appreciated.
I didn't find the right solution from the Internet.
Infographic Production Agency