The format for the input file bell.dat is fairly easy to understand. The first number is the number of nodes in your graph. Following this is an array of data. The meaning of the data is that the distance between two nodes is stored in the array. With the source node being the last number.

For example: Lets say I have a graph with 3 nodes named 1,2, and 3.
The distance between 1 and 1 is 0, between 1 and 2 is 3, and between 1 and 3 is 2
The distance between 2 and 1 is 0, between 2 and 2 is 0, and between 2 and 3 is 5
The distance between 3 and 1 is 7, between 3 and 2 is 2, and between 3 and 3 is 0
and I want the to find the distances from node 1 to all other nodes

The input file will look like this
3
0 3 2
0 0 5
7 2 0
1

The zeroes on the diagonal mean that there is no cost to go from a node to itself. The zero that represents the connection from 2 to 1 actually means that there is no direct connection between the two nodes. So the above graph looks like the included jpg file. The program will then find the shortest path from node 1 to all other nodes, and print out the path to get there.

For this example it will tell you the shortest distance from node 1 to node 2 is 3, and will tell you the path, and the shortest distance from 1 to 3 is 2, and will display its path.

I don't know what the upper bound is on this program but I know it works on a 6 node network, and will work with negative costs.

Tim Felty
felty@siu.edu 