Write a program to simulate the link-state algorithm (Table 20.2). Dijkstra's Algorithm ( ) // Initialization Tree
Question:
Write a program to simulate the link-state algorithm (Table 20.2).
Transcribed Image Text:
Dijkstra's Algorithm ( ) // Initialization Tree = {root} 3 I/ Tree is made only of the root 4. for (y = 1 to N) II N is the number of nodes { if (y is the root) 8. Dly] =0 // D[y] is shortest distance from root to node y else if (y is a neighbor) D[yl = c[root][y] Il c[x][y] is cost between nodes x and y in LSDB 10 11 else D[y]= 0 12 13 } 14 // Calculation 15 герeat 16 { 17 find a node w, with D[w]minimum among all nodes not in the Tree 18 Tree = Tree u {w} II Add w to tree // Update distances for all neighbors of w 19 20 for (every node x, which is a neighbor of w and not in the Tree) 21 D[x] = min {D[x], (D[w] + c[w][x])} 22 23 24 } until (all nodes included in the Tree) 25 } // End of Dijkstra
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 90% (10 reviews)
The second program simulates the LinkState protocol ...View the full answer
Answered By
PALASH JHANWAR
I am a Chartered Accountant with AIR 45 in CA - IPCC. I am a Merit Holder ( B.Com ). The following is my educational details.
PLEASE ACCESS MY RESUME FROM THE FOLLOWING LINK: https://drive.google.com/file/d/1hYR1uch-ff6MRC_cDB07K6VqY9kQ3SFL/view?usp=sharing
3.80+
3+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Write a program to simulate the sending-site FSMs for the Stop-and-Wait protocol (Figure 23.21). Figure 23.21 FSMS for the Stop-and-Wait protocol Sender Request came from application. Make a packet...
-
Write a program to simulate the sending-site FSMs for the Go-Back-N protocol (Figure 23.27).
-
Write a program to simulate the sending-site FSMs for the Selective Repeat protocol (Figure 23.34). Figure 23.34 FSMS for SR protocol Sender Time-out. Resend all outstanding packets in window. Reset...
-
Assume a portfolio of two assets, with $10m invested in asset 1 and $5m invested in asset 2. The per pound covariance matrix of the two assets is: Asset 1 Asset 2 The best hedge of asset 2 is: Asset...
-
Assume that you are going to start a small business of your own. Describe the business and discuss the following: What costs you would incur? What competition you might experience How you would...
-
In a certain experiment, cylindrical samples of diameter 4 cm and length 7 cm are used (see Fig. 169). The two thermocouples in each sample are placed 3 cm apart. After initial transients, the...
-
Describe the purpose of an Affirmative Action Plan.
-
The lost Israeli soldier mentioned in Problem 2-21 decides to rest for a few minutes before entering the desert oasis he has just found. Closing his eyes, he dozes off for 15 minutes, wakes, and...
-
Research System Incident and Event Manager (SIEM). I need a basic description including what it is, how it helps security, and what devices should it monitor. Explain.
-
Harrison and Gloria have been negotiating over the sale of bulk raw materials (lumber, iron and steel). Each party has had an army of lawyers acting on both sides trying to get the deal done and it...
-
Write a program to simulate the distance-vector algorithm (Table 20.1). for (y = 1 to N) { if (y is a neighbor) D[y] = c[myself][y] else 10 D[y] = 0 11 } send vector {D[1], D[2], ..., D[N]} to all...
-
Write a program to simulate the path-vector algorithm (Table 20.3). Table 20.3 Path-vector algorithm for a node 1 Path_Vector_Routing ( ) 2 { // Initialization for (y = 1 to N) 3 { if (y is myself)...
-
In Exercises 83 through 88, use the quadratic formula to solve the given equation. x 2 2x + 3 = 0
-
Which sentence is more emphatic? a. Three burger restaurants compete for business: (1) McDonalds, (2) Burger King, and (3) Shake Shack. b. Three burger restaurants compete for business: (1) McDonalds...
-
Because business messages should have high skim value, why not write everything in bulleted or numbered lists?
-
A companys website might contain valuable information such as you might find current job openings, the companys mission statement might be there, and the names of key hiring managers could be...
-
Under the current legislation, lenders are provided incentives to issue loans to borrowers who may not meet the strictest standards but are a relatively safe credit risk. Your Task. Revise the above...
-
What are five items to check in proofreading? Be ready to discuss methods you find useful in spotting errors.
-
A process has the transfer function (a) For a step change in the input U(s) = 2/s, sketch the response y(t) (you do not need to solve the differential equation). Show as much detail as possible,...
-
Find the inverse, if it exists, for the matrix. -1
-
Explain why the MAC protocol is more important in wireless LANs than in wired LANs.
-
A program to simulate the calculation of traditional checksum.
-
In an 802.11, give the value of the address 2 field in each of the following situations (left bit defines To DS and right bit defines From DS). a. 00 b. 01 c. 10 d. 11
-
In this module, we discussed reporting and analyzing performance data. Take a look at your local school district, city, or county government website. Discuss the following: 1. Post a link and give a...
-
With reference to a project of your own, draw a project team charter and include the relevant details for the project you had selected.
-
In this Week 7 discussion, you will post at least two paragraphs to discuss global sourcing and procurement. In your discussion post, you will address the challenges in implementing a global sourcing...
Study smarter with the SolutionInn App