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 ie latency using both algorithms. Specifications: Graph o Nodes: each node in the graph represents a router in the network ie 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: Load routers: loads the file and construct the graph Enter source: read the source router Enter destination: print the full route of the shortest path including the total shortest cost for both algorithms Dijkstra and BFS Exit: prints the information of step to a file called shortestdistance.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: FromToLatency AB AC BD BE BF CE DE DF EF 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 BFS: A B F with a total cost of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
