CMSC 671

Artificial Intelligence -- Fall 2001

HOMEWORK THREE
out 9/25/01 due 10/11/01

http://www.cs.umbc.edu/671/fall01/hw/hw3.html



PART I.  Implementing search (100 pts.)

In this assignment, you will implement and compare several search techniques.

Reminders:

Assignment

Write and compare three search methods: breadth-first search with checking for repeated states, greedy search, and A* search. You should write three functions, BF-search, greedy search, and A*-search, that take as arguments the names of a city on the map and searches for the shortest path to Bucharest. (More generally, one could write a function that took two cities and searched for a path from one to the other, but then you would need straight-line distances between every pair of cities.)  The search functions should return the following four values:
  1. The number of nodes expanded
  2. A list of the cities visited in the search tree
  3. The path between the two cities
  4. The cost of the path found
Use the Lisp function values to return these four values. h(n), the heuristic function for A* search, should be the straight-line distance to Bucharest.

Results to Report

You should turn in your code using the submit facility. Please create a single file containing all of the code, including the code from homework #2. Name this file hw3-NAME.lisp, where NAME is your first name.

In addition, you should turn in, in hardcopy, both a printout of your code and the results of the three search functions applied to each city in Romania (as the first argument) and Bucharest (as the second argument), using the following table format as a guideline. (You can write a Lisp function to collect these results and print out a table like this, or you can run the functions for each city and then create the table manually.) In the case where a search method fails to find a path, indicate the lack of result with "--" in the corresponding table entry.
City name #nodes / BFS # nodes / greedy # nodes / A* Path / BFS Path / greedy Path / A* Path cost / BFS Path cost / greedy Path cost / A*
Arad                   
Bucharest                  
...                  
Vaslui                  
Zerind                  

Implementation Suggestions

Here are some suggestions for how to go about implementing the search methods in an efficient and reasonably elegant way. (You are not required to follow these suggestions.)