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...
-
Claro Company produces plastic bottles. The unit for costing purposes is a case of 18 bottles. The following standards for producing one case of bottles have been established: During December, 78,000...
-
Fill in the Blank. Different orientations of finite elements require ____________ of element matrices.
-
Tri-County Utilities, Inc., supplies natural gas to customers in a three-county area. The company purchases natural gas from two companies: Southern Gas and Northwest Gas. Demand forecasts for the...
-
The Regal Cycle Company manufactures three types of bicycles-a dirt bike, a mountain bike, and a racing bike. Data on sales and expenses for the past quarter follow: Sales Variable manufacturing and...
-
A randomized controlled trial comparing two drugs for treating insomnia is said to have 85% power to detect a 20% relative reduction (RR=0.80) in sleep problems nine months following treatment at the...
-
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)...
-
The price of gold is used by some financial analysts as a barometer of investors' expectations of inflation, with the price of gold tending to increase as concerns about inflation increase. The table...
-
At December 31, Palisades and Sherwood submitted the following balances for consolidation. There were no intra- entity payables on that date. Also, Palisades had not yet recorded any goodwill...
-
1. If the number of shares outstanding is 1 , 0 0 0 , 0 0 0 , the profit for the year is $ 1 5 0 , 0 0 0 , and the firm paid dividends of $ 5 0 , 0 0 0 , the dividend payout ratio is a . 1 5 % b . 3...
-
a. Post all adjusting journal entries to your T-accounts b. Prepare a trial balance showing that DR = CR after all entries are posted. c. Prepare a balance sheet, income statement, and statement of...
-
Blossom Corporation has collected the following information after its first year of operations. Sales were $1,250,000 on 125,000 units, selling expenses $250,000 (40% variable and 60% fixed), direct...
-
Log ( p - 8 ) = 3 . 4 write solution set with exact solution
-
Joan, your study partner, has just made the following statement: A loan is a loan and therefore cannot be an asset. Is she correct? Why or why not?
-
Evaluate the line integral, where C is the given curve. C x 2 dx + y 2 dy, C consists of the arc of the circle x 2 + y 2 = 4 from (2, 0) to (0, 2) followed by the line segment from (0, 2) to (4, 3)
-
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
-
Consider a hedonic pricing model for educational attainment. Would isoprofit curves for the firm be upward or downward sloping? Explain. Question 2 (Mandatory) (3 points) Listen For workers, would...
-
6. Determine the sum of the measures of the interior angles of this polygon.
-
Consider the perfectly competitive Corn industry. It is initially in long run equilibrium at quantity Q0 and price P0. a) Draw a supply and demand diagram for the Corn market showing this...
Study smarter with the SolutionInn App