Honors Project CSE 3318 - Shortes Paths
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
Requirements
- 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
- GLOBAL VARIABLES are not allowed.
Presentation
Present your work to instructor by the demo deadline (see top of page).
When you finished the project and are ready to present it, contact the instructor to arrange a day and time to present. The quality of the presentation will be graded out of 10 points, but the presentation itself is mandatory and will be used by the instructor to determine your understanding of the problem and the solution. For example, if during the presentation you do not know what the algorithm does at any specific step or why it does that, you would not pass the entire project. You should present the project as soon as you are done with the code, while it is all still fresh in your mind.
During the presentation, you will:
- give applications of this algorithm
- demo all components of the project
- present the method (general algorithm) and show how it works (on paper). Use visualization tools (it can be simply drawing on paper).
- open the source code and explain which piece of code implements specific parts of the method you are implementing
- discuss implementation choices, and
- lessons learnt.
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.
Due Dates
- Canvas project submission due Monday November 17, 11:59pm or earlier (as soon as it is ready)
- Project presentation, 20-30 minutes, due Monday-Thursday, November 17 - November 21 (or earlier), scheduled as a separate meeting. After submitting the project, contact the instructor to schedule a meeting time.
- This algorithm is presented in class at the end of the semester (after the due date for the honors project.) You should study it on your own before before we get to it in class.
How to submit
The assignment should be submitted via Canvas. Submit a ZIPPED directory called honors_project_sp.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:
- Name and UTA ID of the student.
- How the code is structured.
- How to run the code, including very specific compilation
instructions, if compilation is needed. Instructions such as "compile using g++" are NOT
considered specific.
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.