CS 470 Artificial Intelligence
Winter 2006, Instructor: Jeffrey Horn
HOMEWORK 1:
(program 1): Uninformed State Space Search
in LISP!
Handed out/Assigned: |
Monday, January 30, 2006 |
|
|
- Thanks for guidance, discussion, and input from everyone
(especially Hans!), I've decide we're going with the 3-3 Missionary-Cannibals
problem, for which we KNOW there is a solution!
- The problem is defined in problem 7.2 (p. 126) of our
textbook, but you can also google it.
- Keep in mind:
- Both missionaries and cannibals can operate the boat.
- Either one or two people can be transported in the boat,
including the operator.
- Being in the boat (on either side) is not "safe". In
other words, if there are two cannibals on the east side, and one missionary in
the boat on the east side (let's say trying to pick up one cannibal) then the
missionary gets eaten!
- Note that the cannibals can never outnumber the missionaries
in the boat! (because of the second point in this list.)
- First, read chapters 7 and 8 on search.
- Then download and install
DR. SCHEME.
- Here are some SCHEME TIPS
- Next take our search engine code for the FWGC problem,
here.
- (And
here
is the pseudo code for the uninformed state space search algorithm that our code
implements, without loop checking, that is, checking for duplicate (a.ready
visited) states).
- (And
here
is the pseudo code for the uninformed state space search algorithm WITH LOOP
CHECKING).
- Code it up. Requirements:
- Program:
- Modify the FWGC code. You will need to figure
out an explicit state representation, finite set
of operators, definitions of illegal states, and functions that apply each
operator to a state to yield a new state. Keep it simple, keep it short!
There are only two locations in the world, and only three of each of
only two kinds of entities. All that matters for a "safe state" is
that cannibals do not outnumber missionaries on either side. All
that matters for a legal move is that there are enough of the entities
being moved on the side being moved from.
- Implement uninformed, breadth-first, search.
- Turn in the source code (SCHEME code, just the fcn
defininitions) by email to jhorn@nmu.edu.
- Additional questions:
- Draw me a COMPLETE state space graph for your problem (partial).
(In the state space graph, use your state representation in the labels
for the states, and your "move" function for labeling the edges)
- What is the branching factor (approx. avg.) of your graph?