Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

what is the most common cause of preterm birth in twin pregnancies?

Answered: 1 week ago

Question

Which diagnostic test is most commonly used to confirm PROM?

Answered: 1 week ago

Question

What is the hallmark clinical feature of a molar pregnancy?

Answered: 1 week ago