Project: Single-source shortest paths

1. Introduction

The goal of this project is to implement the two major algorithms to compute a set of single-source shortest paths for weighted graphs: the Bellman-Ford Algorithm and Dijkstra's Algorithm. You will also compare them using a simple experiment.

This is a companion project to the MST project and is very similar in structure and goals. The project is found in the book as Project 4.2 on pg 341.

2. Setup

Copy the given code from ~tvandrun/Public/cs345/sssp and make an Eclipse project for it. As with the MST project, you will find five packages: in addition to adt, impl, and test, which have their usual purpose, we also have alg for (externally implemented) algorithms over graphs and exper for an experiment.

Re-familiarize yourself with the structure of the various classes and interfaces and packages as necessary. Specifically understand how the two SSSP algorithms are encapsulated in classes that implement the SSSP interface.

As with the previous project, you'll need Sorts from the linear sorting project and Heap and HeapPriorityQueue from the heap project.

3. The main stuff

Do parts a-c, testing as you go.

4. Experiments

Now read expr.SSSPExperiment and consider the experiment it performs. Run it and modify it for more experiments and observe its results.

5. Turn in

Copy the files you modified (Heap, HeapPriorityQueue, BellmanFordSSSP, and DijkstraSSSP, to your turn-in folder /cslab/class/cs345/(your id)/sssp .

To keep up with the course, this should be finished by Feb 26.


Thomas VanDrunen
Last modified: Wed Jan 8 13:31:29 CST 2020