- 60 Views
- Uploaded on
- Presentation posted in: General

Chapter 5

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Chapter 5

Routing Algorithm in Networks

- How are message routed from origin to destination?
- Circuit-Switching → telephone net. Dedicated bandwidth (path)
- Message-switching : using routing table share link bandwidth concept, 同一msg用同一path
- Packet-switching : 不同路徑for every packet out of order.

- Virtual circuit
- – msg delivered in the order transmitted
- – sharing, i.e. no dedicated paths.

- Implementation
- centralized ─
- distributed

1

2

4

1

1

1

2

1

3

6

3

5

6

1

5

4

1

Out of order

Re-assembly problem

Vulnerable to failure

Comm. Of control infomation

- G = (V, A)
- dij is the src weight of (i, j) A.
- dij = if (i, j) A.
- Source node is node 1

# of nodes

|V|=N

Set of

nodes

Set of

Direct arcs

- P.396 §Bellman-Ford Alg. (can handle negative weights but not negative cycles)
- Let Di(h) be the length of a shortest path from 1 to i using h or fewer arcs (or links)
- Initially D1(0) = 0
Di(0) = , i 1

- For each h = 0, 1, 2,…, N-2

- [Thm] : The alg. Finds the correct shortest path lengths proof by induction.
are the lengths of the shortest path using 1 or fewer links.

- Induction step : suppose Di(h) are the correct length of shortest paths using h or fewer links.

k1

dk1i

dk2i

k1

i

dk3i

k1

- Complexity:
- The alg. Requires at most N-1 iterations.
- For each iteration, the recursion is performed by N-1 nodes.
- Each application of the recursion requires no more than N-1 addition & comparisonsO(N3) complexity.
Example : see P.397. Fig 5.31

- Let p be the set of nodes that are permanently labeled.
- Step 0 : set P={1}, D1 = 0, and Dj = d1j, j 1
- Step 1 : Find i P, s.t.

- Step 2 :

- After k iterations of the algorithm. P contains the k+1 nodes that are closest to node 1 and their permanent labels are the correct shortest path lengths from node 1.

1

2

4

1

1

2

1

6

3

5

1

2

1

- Proof by inductions:
- True for k=1:
- Inductive step: suppose statement is true for any k. P={1, i1,i2,…,ik} are (k+1) closest nodes to 1. Dk is length of the shortest path from 1 to k, kP.

ik-1

ik+1

i

ik

i1

- By construction, ik+1 is at least as close to 1 as any other node in
- Complexity:
- The algorithm requires N-1 iterations.
- For each iteration:
- Step 1 : requires at most N comparison
- Step 2 : requires at most N addition & comparisons.
complexity is O(N2)

- Finds shortest path between every pair of nodes
O(N3)

- Negative arc weights(but no negative cycle)

Note: every pair

Bellman-Ford O(N4)

Dijkstra O(N3)

- Dij(n) = shortest path length between nodes I and j using only nodes 1,2,3…n as intermediate nodes on paths.
Initially, Dij(0) = dij

For n=0,1,2,…,N-1

Dij(n+1) = min[Dij(n+1) , Di,n+1(n+1)+dn+1,j ]

for all i j

- Example see fig.?
- Proof by induction :
- Complexity :
- N iterations
- Each iteration require N(N-1) comparisons & additions
O(N3)

- Let Di(h) be the shortest (<=h) path length from node 1 to node I
- Initially, D1(h) = 0 for all h
Di(0) = for i = 1

- => h is an index for iteration # (the # of links allowed in paths) ← synchronous
- => 有困難 h 必須 all the same

- Let Di be the shortest path length from node i to 1.
- Let N(i) = { j|(i,j) A }

- Let Di be the shortest path length from node i to 1.
- Let N(i) = { j|(i,j) A }
Neighbor

- At each time t, each node i 1 has available:
- Dji(t) : i’s latest estimate (sent by node i) of the shortest distance from node j N(i) to node 1.
- Di(t) : i’s latest estimate (computed by node i) of the shortest distance from node i to 1

- At each point in time, each node. i 1 is doing one of the followings :
- Node i update Di(t) by
And leaves the estimate Dji(t), j N(i) unchanged & sends Di, j N(i)

- Node i receives from one or more neighbors Di , j N(i) computed by j at an earlier time.
Node i update Dji(t) and leaves other estimate unchanged.

- Node i is idle.

- Node i update Di(t) by

- Prove convergence of the distributed asyn. B-F Alg.
- Let Ti be the set of times at which node i update Di(t)
- Let Tji be the set of times at which node i update Dj(t)
- Let {t0, t1…} be the ordering of

- Assumptions:
- nodes never stop updateing their estimate Di(t) and receiving msg. from all their neighbors Dji(t), j N(i), Ti, Tji have # of elements.
- All estimates Di(t), Dji(t), i V, j N(i) are non-negative.
- Old distance information is eventually purged from the system.

- Let Dik be the k-th iteration of Bellman-Ford (k=0,1,2…) for node i = 1,2,…N when
- Let Dik be the k-th iteration of Bellman-Ford when Di(0) = 0, i = 1,2,…N