Overview

For this project you will implement the Breadth-First Search, Depth-First Search and Dijkstra's algorithms.

Objectives

Grading

Clarifications

Any clarifications or corrections associated with this project will be available at Clarifications

Code Distribution

The project's code distribution is available by checking out the project named Graphs. The code distribution provides you with the following:

Specifications

This project has two main tasks: Implementing a graph representation and implementing the BFS/DFS/Dijkstra's algorithms. The class(es) associated with the graph representation will be provided in the graph package; the class(es) implementing the algorithms will be provided in the utilities package. Use the public tests to guide you in the process of defining what is the functionality you need for a graph. Notice that the methods associated with the Graph class are expected to support the implementation of the graph algorithms (you are not required to implement a generic Graph class that supports functionality beyond what is present in the public tests). Feel free to add any classes you understand you need, but make sure they are in either of the two packages mentioned above. Notice that you will not lose any credit if you decide not to add any classes beyond Utilities and Graph.

Your Graph class should define the following two instance variables:

Notice that the Graph class is a generic class whose type parameter represents the elements of the graph we are defining (e.g., Graph<Student>, Graph<Double>, etc.)

Utilities Class

The Utilities class implements the methods computing BFS, DFS, and Dijkstras.  The actual methods you need to implement are described at javadoc. You will find in the utilities package an interface named CallBack.  A class implementing this interface represents a class that will process a vertex.  An example of such a class is PrintCallBack (which you will find in the utilities package).  This class is used to generate the string that represents the path we follow when performing a breadth-first search or a depth-first search.  Each time we reach a vertex, the implementation of DFS and BFS are expected to call the processVertex method to apply whatever processing needs to be done to the vertex.  We have implemented PrintCallBack for you (don't modify it). 

Travel Manager Application

The travel manager application relies on the classes you will implement for this project.  The travel manager computes driving directions based on traffic information downloaded from the specified URL.  You can find the application and an applet in the code distribution.

Requirements

Honor Section Requirements

No addtional requirements.

Web Accessibility