0% found this document useful (0 votes)
44 views3 pages

R.O. Disjktra

Dijkstra's algorithm is a link-state routing algorithm that computes the shortest paths from a source node to all other nodes in a network. It works iteratively, starting with the source node and its directly connected neighbors. In each iteration, it finds the next closest node not yet determined and updates the shortest path costs to nodes connected to that new node. This process repeats until shortest paths are determined for all nodes in the network.

Uploaded by

Obada Osman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views3 pages

R.O. Disjktra

Dijkstra's algorithm is a link-state routing algorithm that computes the shortest paths from a source node to all other nodes in a network. It works iteratively, starting with the source node and its directly connected neighbors. In each iteration, it finds the next closest node not yet determined and updates the shortest path costs to nodes connected to that new node. This process repeats until shortest paths are determined for all nodes in the network.

Uploaded by

Obada Osman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 3

A Link-State Routing Algorithm

:Notation algorithm
Dijkstra’s
c(x,y):
net topology, link from
link cost costsnode
known ∞ if not• direct neighbors •
toy;all=nodes
x to
”accomplished via “link state broadcast –
D(v): current value of cost of path from source to dest. v •
all nodes have same info –
p(v): predecessor node along path from source to v •
computes least cost paths from one node (‘source”) to all other nodes •
N':
givesset of nodes whose
forwarding least
table for thatcost
nodepath– definitively known •
iterative: after k iterations, know least cost path to k dest.’s •

1-4 Network Layer


Dijsktra’s Algorithm
:Initialization 1
N' = {u} 2
for all nodes v 3
if v adjacent to u 4
then D(v) = c(u,v) 5
∞ = else D(v) 6
7
Loop 8
find w not in N' such that D(w) is a minimum 9
'add w to N 10
: 'update D(v) for all v adjacent to w and not in N 11
D(v) = min( D(v), D(w) + c(w,v) ) 12
new cost to v is either old cost to v or known */ 13
/* shortest path cost to w plus cost from w to v 14
'until all nodes in N 15

2-4 Network Layer


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 u,2 u,5 u ,1 ∞ ∞
1 ux u,2 x,4 x,2 ∞
2 uxy u,2 y,3 y ,4
3 uxyv y,3 y ,4
4 uxyvw y ,4
5 uxyvwz

5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

3-4 Network Layer

You might also like