• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Dijkstra
 

Dijkstra

on

  • 1,300 views

 

Statistics

Views

Total Views
1,300
Views on SlideShare
1,295
Embed Views
5

Actions

Likes
0
Downloads
9
Comments
0

1 Embed 5

http://www.slideshare.net 5

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Dijkstra Dijkstra Presentation Transcript

    • A Link-State Routing Algorithm Dijkstra’s algorithm Notation: ❒ net topology, link costs ❒ c(x,y): link cost from node known to all nodes x to y; = ∞ if not direct ❍ accomplished via “link neighbors state broadcast” ❒ D(v): current value of cost ❍ all nodes have same info of path from source to ❒ computes least cost paths dest. v from one node (‘source”) to ❒ p(v): predecessor node all other nodes along path from source to v ❍ gives forwarding table for that node ❒ N': set of nodes whose least cost path definitively ❒ iterative: after k known iterations, know least cost path to k dest.’s Network Layer 4-75
    • Dijsktra’s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N' Network Layer 4-76
    • Dijkstra’s algorithm: example Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z) 0 u 2,u 5,u 1,u ∞ ∞ 1 ux 2,u 4,x 2,x ∞ 2 uxy 2,u 3,y 4,y 3 uxyv 3,y 4,y 4 uxyvw 4,y 5 uxyvwz 5 v 3 w 2 5 u 2 1 z 3 1 2 x 1 y Network Layer 4-77
    • Dijkstra’s algorithm: example (2) Resulting shortest-path tree from u: v w u z x y Resulting forwarding table in u: destination link v (u,v) x (u,x) y (u,x) w (u,x) z (u,x) Network Layer 4-78
    • Dijkstra’s algorithm, discussion Algorithm complexity: n nodes ❒ each iteration: need to check all nodes, w, not in N ❒ n(n+1)/2 comparisons: O(n2) ❒ more efficient implementations possible: O(nlogn) Oscillations possible: ❒ e.g., link cost = amount of carried traffic 1 A A A A 1+e 2+e 0 0 2+e 2+e 0 D 0 0 B D B D B D 1+e 1 B 1+e 1 0 0 0 e 0 0 1 1+e 0 e 1 C C C C 1 e … recompute … recompute … recompute initially routing Network Layer 4-79