Question: Objective: Find the least cost forwarding path for all routers using Dijkstras algorithm. Requirements: 1. Create a C code to find the least cost forwarding

Objective:

Find the least cost forwarding path for all routers using Dijkstras algorithm.

Requirements:

1. Create a C code to find the least cost forwarding path for a given set of six routers

2. Use Dijkstras algorithm to find the least cost path. The algorithm will generate its least cost routing paths

3. The program should read a file (router.txt) for the cost information and find the least cost forwarding path for them, then write them to an output file.

Procedure:

1. Open the router.txt file and read the cost between the routers. Your code should be able to support at least six routers

2. Use the Dijkstras algorithm to find the least cost forwarding path between the routers

4. The format of the input file is s d c Where s is the source, d is the destination, and c is the cost between source and destination.

5. Write to a file (output.txt) and print to the console the forwarding table for all the routers that were computed using Dijkstras algorithm. The output file will have the destination router and least cost link connecting it

6. The output file format shows only the output for two routers u and v but you should generate least cost path for all routers. An example is below:

Objective: Find the least cost forwarding path for all routers using Dijkstras

Input File Format Output File Format: u v 2 u w 5 u x 1 v x 2 v (u, v) w (u, x) x (u, x) y (u, x) z (u, x) x y 1 u (v, u) w (v, w) x (v, x) y (v, x) z (v, x) w y 1 w z 5

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 Databases Questions!