Sale!

COMP2421 – Project No. 5 Dijkstra’s algorithm

$30.00 $18.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (7 votes)

In this project you will implement a solution of a very common issue: how
to get from one town to another using the shortest route.
You will design a solution that will let you find the shortest paths between
two input points in a graph, representing cities and towns, using Dijkstra’s
algorithm. Your program should allow the user to enter the input file
containing information of roads connecting cities/towns. The program
should then construct a graph based on the information provided from the
file. The user should then be able to enter pairs of cities/towns and the
algorithm should compute the shortest path between the two cities/towns
entered.
Attached a file containing a list of cities/towns with the following data:
Field 1: Vertex ID of the 1st end of the segment
Field 2: Vertex ID of the 2nd of the segment
Field 3: Name of the town
Field 4: Distance in Kilometer
Please note that all roads are two-ways. Meaning, a record may represent
both the roads from feild1 to field2 and from the road from feild2 to feild1.
You are required to implement a program to help finding the shortest path
between 2 points in the provided file as follows:
 Read the file segments.txt and load the data
 Enter 2 points to compute the shortest path between them
 Print the route of the shortest distance to a file called “route.txt”
 Exit
The user should have the ability to find the shortest path of different pair of
cities. Meaning, after finding the shortest route between the A1 and B1, the
user can enter other cities, B1 and C1, to get the shortest path between
them.
Notes and submission instructions:
1. This is individual work. It should represent your own efforts. It is
fine to discuss your work and to ask your colleagues, but you are not
allowed to copy/paste the work of others or give your work to
anyone else. You are not allowed to post/copy from other websites
and/or social media and this will be considered as cheating.
2. Document format. Please submit only the code file (c file)
containing the code of your project. Please rename it as follows:
“P5_YourStudentID_FirstNameLastName_SectionNo.c”.
3. Input/output file name. Make sure that the input/output file
names are the same as in the specifications.
4. Include your full name, student ID, and section number in the
beginning of your file.
5. Please do not compress the file, only the C-file is needed.
6. Files not following the convention in point 2 will not be marked.
Good luck!