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...
-
True or False: Your compensated and uncompensated demand curves for bubble gum are likely to be very similar to each other, but your compensated and uncompensated demand curves for college tuition...
-
What are four types of items from which derivatives can derive their value?
-
Compare briefly the major types of employment interviews described in this chapter. Which type would you prefer to conduct? Why?
-
Frizelle deposits $163 each month into an account earning 3.6% interest compounded monthly. How much money will be in the account after 9 years? (round to pennies)
-
Margo, a calendar year taxpayer, paid $1,580,000 for new machinery (seven-year recovery property) placed in service on August 1, 2023. a. Assuming that the machinery was the only tangible property...
-
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)...
-
Kelly purchased a $1,000 face value bond on January 2, 2016, for $1,000. The bond was issued on the same date, January 2, 2016. Interest is payable at 4% compounded semi-annually on uncashed coupons...
-
Please help. I would really appreciate it. Question 1. Polly owns an electric power plant in the city of Newtown. The market price of electricity in Newtown is $1.00 per kilowatt hour (kwh). Polly's...
-
(Appendix 3A) Jenson Manufacturing is developing cost formula for future planning and cost control. Utilities is one of the mixed costs associated with production. The cost analyst has suggested that...
-
A company has the following trial balance as at 31 December 2015: TRIAL BALANCE AS AT 31 DEC 2015 Dr Cr Sales Revenue 125 000 Purchases 78 000 Carriage 4 000 Electricity and rent 5 100 Administrative...
-
What gets printed to the screen by the following segment of code? String str1 = "hello"; String str2 = "world"; if (!strl.equals(str2)) { System.out.println(str1+" "+str2); } else { }...
-
a) Consider the following financial data (in millions of dollars) for Costello Laboratories over the period of 2014-2018: Year Sales Net income Total assets Common equity 2014 $3,800 $500 $3,900...
-
a. Draw a similar diagram to the one shown below. Measure carefully each of the labelled angles and write them down. b. Draw a similar diagram to the one shown below. Measure carefully each of the...
-
What is the mode?
-
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
-
Required information Skip to question [ The following information applies to the questions displayed below. ] Forten Company's current year income statement, comparative balance sheets, and...
-
Give a breakdown of all the intangible assets with the values shown in the statement of financial position of Unilever in 2022.
-
1-The yield to maturity will be greater than the coupon rate when a bond is selling at a premium. Select one: a. False b. True 2-Which one of the following would have the greatest present value,...
Study smarter with the SolutionInn App