[SOLVED] COMP2421-Project 4

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (2 votes)

In this project, you will implement Dijkstra’s algorithm to find the shortest path between two cities.

You should read the data from the given file cities.txt and then construct the shortest path between a given city (input from the user) and a destination city (input from the user).

Your program should provide the following menu and information:

1.     Load cities: loads the file and construct the graph

2.     Enter source city: read the source city and compute the Dijkstra algorithm (single source shortest path)

3.     Enter destination city: print the full route of the shortest path including the distance between each two cities and the total shortest cost

4.     Exit: prints the information of step 3 to a file called shortest_path.txt and exits the program

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.