CS470/570
Aritificial Intelligence
Spring 2008
Project #1 Pathfinding
Due: Wednesday, Feb. 13th

Pathfinding is a search problem commonly encountered in computer strategy games. The goal in pathfinding is to find the least cost path between two points on a map. The map is divided into a discrete cells, usually squares or hexagons. Typically there is cost associated with moving into a cell, which depends on the terrain in a cell. E.g. moving into a muddy square costs more than moving into a paved square. (You might consider why the cost is associated with moving into, rather than out of, a cell.)

In most games and many real world problems pathfinding in an informed search; the agent knows approximately where the goal is and can calculate heuristics like the straight line distance from any point to the goal. In games the pathfinding environment is usually treated as fully observable. If parts of the map are unknown the agent may only plan a route to the boundry of the observed region. If there are hidden obsticles, the agent typically picks a route ignoring them and must replan after finding them. (In some cases computer agents may be allowed to 'cheat' and observe more of the map than a human player would be allowed to.)

Although games are the most obvious application of pathfinding there are many other problems that require pathfinding. From pathfinding for actual robots (think ofthe Mars Rover) to less obvious problems, such as determing the path taken by water or oil flowing between underground resevoirs with different types of soil and rock impeding the flow.

Project: Test a number of different search strategies for pathfinding.

Algorithms: You will need to test the following algorithms:

Experiments: For each algorithm you will need to do the following:

Other Rules: For this problem the map will use a rectangular grid. Agents will be able to move in four directions (up, down, left, right), but not diagonally.

Your program should be able to read a map file in the following format.
Width Height
StartX StartY
GoalX GoalY
map
Where the map is an array of characters. Width and Height define the width and height of the map. StartX, StartY, GoalX, and GoalY define the start and goal locations repectively. Note as a C++ programmer I have defined these positions starting from 0, so 0,0 is in the top lefthand corner of the map.
Here is a sample map file. The characters are interpreted as follows:
Character Meaning Movement Cost
R road 1
f field 2
F forest 4
h hills 5
r river 7
M mountains 10
W water can't be entered

After a successful search the program should be capable of the following:

This does not require a graphical output (although that's probably best). You could have the program draw a text version of the map (as in the sample file) and underline explored squares and highlight squares on the successful path. Or have the program output its own map file that denotes explored squares and path squares and have another program display that file.

Write-up : Write your results as a paper. Plan on ~10 pages, including figures and graphs. The paper should include the following:

When you write this paper assume that you are writting for an uniformed audience - say CS120 or CS121 students. E.g. explain the problem, explain the movement costs, explain how the algorithms work, etc.