Project 6: Graphs

The goal of this project is to implement one or more graph algorithms to solve problems or answer questions on real-world data.

This project will have a very different feel from the others in this course. I'm not giving you any starter code and it is completely open-ended from the start. The idea is that you will determine a problem that can be represented using a graph and solved using a known graph algorithm or some variant thereof and that you will collect some real-world data for instances of that problem and get some real results.

1. Choosing a question or problem

The first step is choosing a question or problem or set of related problems that (a) interests you, (b) can be represented using a graph, (c) can be solved realistically using a graph algorithm (or more than one algorithm), and (d) has available real-world data from which instances of the problem can be generated.

A few ideas for domains of problems or questions:

Graph algorithms that are covered (to various levels of detail) in Sedgewick include:

You should check in with me about your chosen problem before going further. I will help you think through the feasibility and make suggestions about the details.

2. Finding real-world data and constructing a graph

Once you have a problem or question, you'll need to figure out how to get data for it and how to represent that data. Ways to get data include

The companion website to the Sedgewick book has a whole bunch of raw data in nicely formatted text file. Not all are relevant to graph problems, but some are: http://introcs.cs.princeton.edu/java/data/

Then you will need to decide how to represent the graph and implement that representation. Should be graph be weighted? Directed or undirected? Parallel edges? Self-loops? Implemented as adjacency list or adjacency matrix? All this will depend on the nature of the problem/information and what algorithm you will use. There is code in the book and from in-class examples that shows how to implement a graph, but you'll probably want to do this from scratch to optimize it for the specific problem.

Write a class or set of classes to represent the graph and code to read in the information and build the graph

3. Solving the problem

Then implement the algorithm to solve the problem and display the result. This part takes the least to describe, but hopefully it will be the heart of the project.

4. Write it up

Then write a report describing your project (don't assume I remember our earlier conversation):

Also, in either the report, the in-code documentation, or a README, give me some guidance on how to use and inspect your code. I don't like it when I get a project turned in and the first thing I need to do is grep for the main method and then try to draw a UML diagram

5. Turn-in

Copy all your code, the report (pdf is preferred), and anything else that may be relevant (README file, data files...) to /cslab.all/ubuntu/cs345/turnin/(your id)/proj6.

Due Friday, May 1, 5:00 pm. Note that (a) this is the last day of classes, (b) project 7 will also be due this day, and (c) no late days may be applied to either project 6 or project 7.


Thomas VanDrunen
Last modified: Fri Apr 10 12:01:37 CDT 2015