Honors Project CSE 3318



Figure 1: A visual representation of the road system described in file input1.txt. Implement Dijkstra's Algorithm to find the best route between any two cities. Your program will be called find_route.c. It will ask the user for a file name and a source and a destination. Argument input_filename is the name of a text file such as input1.txt, that describes road connections between cities in some part of the world. For example, the road system described by file input1.txt can be visualized in Figure 1 shown above. You can assume that the input file is formatted in the same way as input1.txt: each line contains three items. The last line contains the items "END OF INPUT", and that is how the program can detect that it has reached the end of the file. The other lines of the file contain, in this order, a source city, a destination city, and the length in kilometers of the road connecting directly those two cities. Each city name will be a single word (for example, we will use New_York instead of New York), consisting of upper and lowercase letters and possibly underscores.

IMPORTANT NOTE: MULTIPLE INPUT FILES WILL BE USED TO GRADE THE ASSIGNMENT. FILE input1.txt IS JUST AN EXAMPLE. YOUR CODE SHOULD WORK WITH ANY INPUT FILE FORMATTED AS SPECIFIED ABOVE.

The program will compute a route between the origin city and the destination city, and will print out both the length of the route and the list of all cities that lie on that route.


     Sample run 1:
Enter filename: input.txt 
Enter origin city: Bremen 
Enter destination city: Frankfurt

distance: 455 km
route: 
Bremen to Dortmund, 234 km 
Dortmund to Frankfurt, 221 km 

     Sample run 2:
Enter filename: input.txt 
Enter origin city: London
Enter destination city: Frankfurt

distance: infinity
route: 
none 
For full credit, you should produce outputs identical in format to the above two examples. The program should be able to run in debug mode as well. In that mode it will print the correspondence: vertex number - city name and will print the distance and the predecessor arrays.

The implementation must be in C.


Suggestions

Pay close attention to all specifications on this page, including specifications about output format, submission format. Even in cases where the program works correctly, points will be taken off for non-compliance with the instructions given on this page (such as a different format for the program output, wrong compression format for the submitted code, and so on). The reason is that non-compliance with the instructions makes the grading process significantly (and unnecessarily) more time consuming.

How to submit

Nov 12 - Project submission is DUE.
Nov 19 - Presentation must be completed before this date.
Dijkstra's algorithm will be presented in class, but it will be presented in the last lectures, which may be past the due dates for the project. Students should study the algorithm on their own and submit on time or even well before the due date.

The assignment should be submitted via Canvas. Submit a ZIPPED directory called honors_project.zip (no other forms of compression accepted, contact the instructor or TA if you do not know how to produce .zip files). The directory should contain source code. Including binaries that work on omega is optional. The submission should also contain a file called README, which should specify precisely:

Insufficient or unclear instructions will be penalized by up to 10 points.

Grading

The assignment will be graded out of 100 points.
A score of 80 or higher is needed to pass the project.