CS 409 HW8 : How Should I Get There?

An application of Dijkstra's algorithm

Homework 8: Handed out: 4/5; Due: 4/19.

Note: This assignment involves programming, which will have to be done using J++ in the CSUGLab. Even if you originally use another variant of Java for your program, make sure it runs in the CSUGLab.

As usual, you can discuss this assignment with anyone you like, but you must write it up yourself.

Overview

In this assignment, you are given data about the road network in the USA. What we want from you are programs to do the following:

  1. Given two places in the United States, find (and of course print out) the shortest path between them.
  2. Calculate the number of connected components in this network.
Based on what you've learned in class, you should choose the right data structure to represent the data as a graph, and then implement Dijkstra's algorithm and an algorithm to find connected components using that graph.

Data

In this assignment, you'll be working with a simplified version of National Highway Planning Network Version 3.0 , part of The National Transportation Atlas Data (NTAD) maintained by the Bureau of Transportation Statistics. Note that NHPN is primarily a planning network that contains only the major roads in the country (the top 10% of total road mileage).

The data you will need are in data.zip (1.23M). There are two files in data.zip. You can also choose to download the unzipped files directly:

Both files are in ASCII format.

Each record in road.dat (that is, each line in the file) represents one segment of a road. The format of a record is as follows:

Field Name Begin Pos. End Pos. Description
ANODE 0 4 Node ID of the beginning of the segment
BNODE 5 9 Node ID for the end of the segment
MILES 10 15 Length of the segment measured in miles
SIGN / DES 16 end Sign and/or description of the segment

Note:

Some of the nodes have a string description (the name of the corresponding place in most cases); this information is provided in the file place.dat:

Field Name Begin Pos. End Pos. Description
NODE_ID 0 4 ID of the node
DES 5 end Description/name of the node

Note:

Implementation

Write-up


Grading


Write-up - 30%
Code - 70%

* Bo will the point person for this assignment.


More...

If you have spare time (don't we all have spare time?), you might want to extend this assignment. Here are some ways to do that: You will not be awarded extra credit for this.