Question
A farmer with his wolf, goat, and cabbage come to the edge of a river they wish to cross. There is a boat at the
A farmer with his wolf, goat, and cabbage come to the edge of a river they wish to cross. There is a boat at the rivers edge, but, of course, only the farmer can row. The boat also can carry only two things (including the rower) at a time. If the wolf is ever left alone with the goat, the wolf will eat the goat; similarly, if the goat is left alone with the cabbage, the goat will eat the cabbage.
Devise a sequence of crossings of the river so that all four characters arrive safely on the other side of the river. (1-d)
Devise a concise representation of a state (considering all possible uses of this in search algorithms).
As per the representation devised provide write down the representation of a start state and the goal state. Provide the data structure description of a state. Specify the fields (with details of what goes into), pointers to be kept in the node. Answers both in pseudo code, pictorial rep, in description are all allowed. State diagram, solution to the problem are not expected here (1-e) Which of DFS or BFS is most preferred for this problem? Why.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started