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...
-
The syntax data.remove(value) for Python list data removes only the first occurrence of element value from the list. Give an implementation of a function, with signature remove all(data, value), that...
-
Write a report for the manager of either a hotel, conference centre, or a museum explaining how budgets can be utilised as a performance tool and their limitations.
-
Alberton Electronics makes inexpensive GPS navigation devices and uses a normal cost system that applies overhead based on machine hours. The following 2010 budgeted data are available: Variable...
-
You are a manager at a high-tech company in Kanata, Ontario. Due to a slow down in the economy, you have decided to lay-off Chelsea Lui at the end of the current bi-weekly pay period (Friday). You...
-
The bar codes above represent locations in a warehouse. How many units would be left in each location? If you picked 250 units from location 00000113774360000 If you picked 250 units from location 00...
-
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)...
-
Gallium has two naturally occurring isotopes with the following masses and natural abundances: Sketch the mass spectrum of gallium. Isotope Ga-69 Ga-71 Mass (amu) Abundance (%) 60.108 39.892 68.92558...
-
Calculate an expression for sustainable sales growth rate when leverage is constant as measured by D/E and pay-out ratio is p (that is, for each dollar of net profit, p dollars are paid as dividends,...
-
Read a bit about Zaras manufacturing and distribution model (Wikipedia will do). Why was Zaras business model so successful?
-
Create a Python class, Fixed, that duplicates the arithmetic functionality of the C fixed-point library. Be sure to overload the operators for,,\(+- /, *\) so that the fixed-point class can be used...
-
The grand prize for a lottery is \($1,000\) per year for 10 years and then \($500\) per year in perpetuity (i.e., the first \($500\) payment is at the end of year 11). If the relevant interest rate...
-
Add a function, Q_asin, to the library that takes a sine value, positive and negative, and returns the angle for that sign, in radians. Use a Taylor series expansion, \[ \sin ^{-1}...
-
Determine whether the statement is true or false. If it is true, explain why. If it is false, explain why or give an example that disproves the statement. If {a n } and {b n } are divergent, then {a...
-
Find the velocity, acceleration, and speed of a particle with the given position function. r(t) = (t 2 , sin t - t cos t, cos t + t sin t), t > 0
-
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
-
es Pension data for Sterling Properties include the following: Service cost, 2021 Projected benefit obligation, January 1, 2021 Plan assets (fair value), January 1, 2021 Prior service cost-AOCI (2021...
-
Weaver Corporation had the following stock issued and outstanding at January 1, Year 1. 1. 114,000 shares of $7 par common stock. 2. 9,500 shares of $100 par, 7 percent, noncumulative preferred...
-
Prepare year-end adjustments for the following transactions. Omit explanations. 1. Accrued interest on notes receivable is $105. 2. Unearned revenues earned totals $2,200. 3. Eighteen months rent,...
Study smarter with the SolutionInn App