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. Feel free to add any classes you understand you need, but make sure they are in the graph package. Notice that you will not lose any credit if you decide not to add any classes beyond 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.)

The actual methods you need to implement are described at javadoc. You will find in the graphs 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 graph 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).

Requirements

Good Faith Attempt

The good faith attempt is represented by the public test testBFSGoodFaithAttempt.