From: Alex <willmann817@gmail.com>
Subject: Breadth First Search Missionaries and Cannibals
Date: Mon, 29 Apr 2013 19:48:57 -0700 (PDT)
Date: 2013-04-29T19:48:57-07:00 [thread overview]
Message-ID: <6c3bb45c-6cb1-4609-9c3f-c3f01c545eac@googlegroups.com> (raw)
Given the following Function signature how would I go about using breadth first search to find out the minimum number of trips it would take to get all the missionaries and cannibals across the river. *MUST USE BREADTH FIRST SEARCH* If you are not familiar with the problem see the wiki page here :
http://en.wikipedia.org/wiki/Missionaries_and_cannibals_problem
The only difference between the problem in the wiki article is in this one the number of missionaries and cannibals and the number of people the boat can hold can change.
M is missionaries, C is cannibals and R is the number of people you can fit in the boat.
function Min_Crossings(M, C, R : Integer) return Integer is
-- you can assume M, C, and R are all >= 2 and C <= M
begin
return -999;
end Min_Crossings;
Thanks a bunch.
next reply other threads:[~2013-04-30 2:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 2:48 Alex [this message]
2013-04-30 7:56 ` Breadth First Search Missionaries and Cannibals Georg Bauhaus
2013-04-30 10:29 ` Alex
2013-04-30 13:37 ` Will Koch
2013-04-30 17:20 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox