This document describes two logic puzzles: the Missionaries and Cannibals puzzle and the Wolf, Goat and Cabbage puzzle. It provides the initial conditions, constraints, and goal state for each puzzle, as well as describing the possible moves or operators to solve each puzzle with the minimum number of moves. It then shows the step-by-step solution for the Missionaries and Cannibals puzzle.
This document describes two logic puzzles: the Missionaries and Cannibals puzzle and the Wolf, Goat and Cabbage puzzle. It provides the initial conditions, constraints, and goal state for each puzzle, as well as describing the possible moves or operators to solve each puzzle with the minimum number of moves. It then shows the step-by-step solution for the Missionaries and Cannibals puzzle.
This document describes two logic puzzles: the Missionaries and Cannibals puzzle and the Wolf, Goat and Cabbage puzzle. It provides the initial conditions, constraints, and goal state for each puzzle, as well as describing the possible moves or operators to solve each puzzle with the minimum number of moves. It then shows the step-by-step solution for the Missionaries and Cannibals puzzle.
• 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.