You are on page 1of 3

DIRE DAWA UNIVERSITY

Department Of Computer Science

Group Assignment
Name ID No.

1. Brook Sintayehu 1204126


2. Yonas |Nigussu 1206010
3. Adoniyas Sisay 1206014
4. Kalkidan Yeshitla 1200684
5. Rediet Getachew 1201151
6. Wengel Alemu 1201499
7. Bereket Israel 1202109

Submitted To- Inst. Emuye B.


Submitted Date-5/04/2022

Missionaries and Cannibals


• Goal: Move all the missionaries and cannibals across the river.
• Constraint: Missionaries can never be outnumbered by cannibals on
either side of river, or else the missionaries are
killed.
• State: configuration of missionaries and cannibals and boat on each side
of river.
• Initial State: 3 missionaries, 3 cannibals and the boat are on the near
bank.
• Operators: Move boat containing some set of occupants across the river
(in either direction) to the other side.
 Action: RAid the boat with maximum two persons(one or two) across
the river(in either direction) to the other side.
 Path cost: Requires minimum number of moves.

Missionaries and Cannibals Solution


Far side!
Near side Initial State Final State

0 Initial setup: MMMCCC B -!


1 Two cannibals cross over: MMMC B CC!
2 One comes back: MMMCC B C!
3 Two cannibals go over again: MMM B CCC!
4 One comes back: MMMC B CC!
5 Two missionaries cross: MC B MMCC!
6 A missionary & cannibal return: MMCC B MC!
7 Two missionaries cross again: CC B MMMC!
8 A cannibal returns: CCC B MMM!
9 Two cannibals cross: C B MMMCC!
10 One returns: CC B MMMC!
11 And brings over the third: - B
MMMCCC!
The Wolf, Goat and Cabbage
• Initial State: Wolf, goat, cabbage and farmer are on the north side of the
river.
• Goal State: Wolf, goat, cabbage and farmer are on the south side of the
river.
• Operators: Farmer can move one thing at a time across the river in the boat,
or he can cross alone. But the goat cannot be left alone with the cabbage or
with the wolf.

We are using the symbols F, W, G, and C to stand for the Farmer, Wolf, Goat,
and Cabbage respectively.

You might also like