Chap5sol - C hapter 5 Solutions 5.1 The Prim-Dijkstra...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5 Solutions 5.1 The Prim-Dijkstra Algorithm Arbitrarily select node e as the initiaJ frag- ment. Arcs are added in the following order: (d,e), (b,d), (b,c) {tie with (a,b) is broken arbitrarily}, (a, b), (a, J). Kruskal's Algorithm Start with each node as a fragment. Arcs are added in the following order: (a,f), (b,d), (a,b) {tie with (b,c) is broken arbitrarily}, (b,c), (d,e). The weight of the MST in both cases is 15. 5.2 The Bellman-Ford Algorithm By convention, D~h) = 0, for aJI h. Initially DP) = d li , for all i :# 1. For each successive h ?: 1 we compute D~h+l) = minj[Djh) + d ji ), for all i :f 1. The results are summarized in the following table. D~ D 2 D3 D~ D~ Shortest path arcst t t t 1 0 0 0 0 0 2 4 4 4 4 4 (1,2) 3 5 5 5 5 5 (1,3) 4 00 7 7 7 7 (2,4) 5 00 14 13 12 12 (6,5) 6 00 14 10 10 10 (4,6) 7 00 00 16 12 12 (6,7) tThe arcs on the shortest path tree are computed after running the Bellman- Ford aJgorithm. For each i:f 1 we include in the shortest path tree one arc U,i) that minimizes Bellman's equation. Dijkstra's Algorithm Refer to the algorithm description in the text. Ini- tially: D 1 = 0; D; = d u for i :f 1; P = {l}. The state after each iteration is
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Next assume A=l and Cl=O. On the arrival of an idle slot in the downstream direction, 1) Place the frame in the idle slot, setting the busy bit; 2) If there is a waiting frame in the supplementary queue, put it in the vinu::ti queue, place C2 in counter 1 and set C2 to 0; 3) If there is no waiting frame, set A=O. On the arrival of a request bit in the upstream direction, increment C2. Next assume A=O. On the arrival of an idle slot in the downstream direction, decrement C2. On the arrival of a request bit in the upstream direction, increment C2. On the arrival of a frame to be transmitted, put it in the vinual queue, place C2 in counter 1 and set C2 to O.
Image of page 2
shown in the table below. P is not shown but can be inferred from i. Only the Dj's which are updated at each step are shown. Iteration i Dl D 2 D 3 D 4 Ds D s D 7 Arc added initial 0 4 5 00 00 00 00 1 2 5 7 14 00 00 (1,2) 2 3 7 14 14 00 (1,3) 3 4 13 10 00 (2,4) 4 6 12 12 (4,6) 5 5 12 (6,5) 6 7 (6,7) 5.3 Let Pij be the probability that link (i, j) fails during the lifetime of a virtual circuit. Let PA: be the probability that a path k = (A, i, ... ,j, B) remains intact. Since links fail independently we have: We want to find the path k for which PA: is maximized. Equivalently, we can find the path k for which -In PA: is minimized. Since the arc weights Pij are small, 1 - Pij is close to 1 and we may use the approximation In z ::::: z - 1. This gives: -In PA: ::::: PAi +... + PjB Therefore, the most reliable path from A to B is the shortest path using the weights given in the figure. Applying Dijkstra's algorithm gives the shortest path tree. We proceed as in problem 5.2. Iteration D A DB Dc DD DE DF DG Arc added initial 0 00 0.01 00 0.03 00 00 1 C 00 0.06 0.02 00 00 (A,C) 2 E 00 0.04 0.06 00 (C,E) 3 D 0.1 0.05 0.06 (E,D) 4 F 0.1 0.06 (D,F) 5 G 0.09 (D,G) 6 B (G,B) The most reliable path from A to B is (A,C,E,D,G,B).
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern