Question: please write me full c code ;In this project, you will implement a Network packet routing system. This project is an application of Dijkstra s

please write me full c code ;In this project, you will implement a Network packet routing system. This project is an application of Dijkstras and Breadth First Search (BFS) algorithms of a single source shortest path. You should read the data from the given file routers.txt and then construct the shortest path between a given router (input from the user) and a destination router (input from the user). You should print the full path and the total cost (i.e. latency) using both algorithms. Specifications: - Graph o Nodes: each node in the graph represents a router in the network (i.e., node). o Edges are links between routers in the network. o The edges are represented as latencies (in milliseconds).- Algorithm o You should use Dijkstras algorithm and BFS algorithms to computer the shortest path between given two nodes in the graph. o You should use Adjacency Matrix to represent the graph. Menu: 1. Load routers: loads the file and construct the graph 2. Enter source: read the source router 3. Enter destination: print the full route of the shortest path including the total shortest cost for both algorithms (Dijkstra and BFS)4. Exit: prints the information of step 3 to a file called shortest_distance.txt and exits the program Example: Assume you have the following routers: A, B, C, D, E, F The input file routers.txt will contain the following: From-To-Latency A-B-10 A-C-15 B-D-12 B-E-15 B-F-30 C-E-10 D-E-2 D-F-1 E-F-5 Assume the user input is Source: A and Destination: F, then the algorithm should print the following: Shortest path from A to F is: Dijkstra: A -> B -> D -> F with a total cost of 23. BFS: A -> B -> F with a total cost of 40.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!