Real Roads and Cities
for
Shortest Path Computations

There are two data files to download, both in human-readable form:

cities.txt
contains the names and locations of a 110 Eastern U.S. cities. Each line contains three items: the name of the city including which state it is in (spaces replaced by dashes), and the latitude and longitude of the city, in degrees as a floating point number. A sample of three lines from the file:
    Miami-FL 25.775667 080.210845
    Middletown-MD 39.442242 077.544192
    Mobile-AL 30.677450 088.088959
Of course you can ignore the latitude and longitude if you want to, but they are useful for working out directions.

roads.txt
contains the names and locations of a 181 major Eastern U.S. roads. Each line contains four items: the name of the road as a string without spaces, the length of the road in miles as an integer, and the names of the two cities that it connects. A sample of three lines from the file:
    US1 57 Key-Largo-FL Miami-FL
    I95 26 Miami-FL Fort-Lauderdale-FL
    I95 43 Fort-Lauderdale-FL West-Palm-Beach-FL
It is guaranteed that each city name in the roads file exactly matches one city name from the cities file. Notice that road names are not unique.

An applet for seeing the data
You can see this information rendered as an interactive map by running this applet. (It works perfectly on all my computers, but java applets are peculiar things, so I won't claim that it will run everywhere). Java applets can get quite large, so it may take a while to download over a slow connection.
        Click near a city, and it will highlight and describe the road from that city that passes "closest" to your mouse click. It has a strange idea of what closest means, but that shouldn't bother anyone, so long as you look to see which road got high-lit before reading the textual information that appears.

A static screen-shot
In case anyone can't run the applet, here is a static screen-shot of it, so at least you can see which roads are included and get an idea of which cities are there too.

The source code for the applet
If you want to see how it works, this is the java source for the applet. It is not an especially well-written program, it wasn't made for people to see, but then I thought maybe somebody might want to know how to make an applet like that.
        That java program can also be run as a normal application, so if your browser won't or can't run it as an applet for you, just download the java source and the two data files into the same directory on a PC, change the .txt at the end of the program's name to .java, open a dos shell and cd to that directory, compile the program (with the command "javac drawmapapp.java"), then finally run it (with the command "java drawmapapp").