When you are confident you understand the workings of the two search programs,
try to extend the
search programs to find solutions to the following problem:
How many times must the farmer cross the river, and what should he take with him on each journey?
A farmer wishes to transport a goose, a sack of grain and a live fox (don't ask why)
across a river.
His only means of transport is a small rowing boat which will take him and at most one other item.
The farmer cannot leave the goose unattended with either the fox (which will eat it) or the grain
(which it will eat).
To get started: try representing the state as a vector (Goose, Grain, Fox, Farmer) which indicates
which side of the river each entity is on: e.g., (left, right, right, left) means that the
farmer and the goose are on the left bank, the fox and the grain are on the right.