CS 371 - Introduction to Artificial Intelligence
Homework #1


Due: Thursday 9/12 at the beginning of class
Note: Work is to be done in pairs

Uninformed Search

In this assignment, you will implement four algorithms for uninformed search.  These implementations will conform to a simple class structure that will allow you to mix and match search algorithms with search problems easily.  Read the assignment thoroughly before beginning.  Some of these classes may be specializations of or use other classes, so you may want to organize your code accordingly. 1. For the SearchNode class, implement the method printSearchPath.

2. Implement breadth-first search in the class BreadthFirstSearcher.  All search algorithms (including this) should implement the interface Searcher and interact with the abstract class SearchNode (not LightsOutNode or any problem specific code).  In this way, your search algorithm implementation can be used with any search problem with a representation conforming to SearchNode.  For this class, you can make use of the provided class Queue.

3. Implement depth-first search in the class DepthFirstSearcher.  You'll likely want to use the Java class Stack for depth-first searches.

4. Implement depth-limited search in the class DepthLimitedSearcher.

5. Implement iterative-deepening search in the class IterativeDeepeningSearcher.

6. For each of these search algorithms, create a class to apply them to the Lights Out search problem.  A LightsOutNode object begins in a goal state and must be "shuffled" using the makeRandomMoves(int moves) method.  The syntax for use should be as follows

where <size> is the size of the Lights Out grid, <moves> is the number of random moves to make when "shuffling" the puzzle from its initial goal state, and <depth-limit> is the maximum depth of search.  The output of a successful search should include the path to the goal and the number of nodes expanded.  The output of an unsuccessful search should be "GOAL NOT  FOUND" and the number of nodes expanded.

7. Part of your project grade will include a 15 minute team interview.  Use the classes of (6) to prepare a short 5 minute demonstration of the tradeoffs between each search method.  Both team members should be prepared to discuss the tradeoffs between any pair of search algorithms.  In other words, know completeness, optimality, time complexity, and space complexity for each algorithm.  Be sure to set <size> and <moves> such that any given search takes no more than a few seconds.

8. In your interview, you will be asked which search algorithm(s) would be best applied to the triangular peg solitaire problem.  You may optionally implement classes to demonstrate the application of these algorithms to the problem.  The search node implementation is given in the class PegSolitaireNode.

Todd Neller