1 / 6

DIJKSTRA’s Algorithm

DIJKSTRA’s Algorithm. Definition fwd search. Find the shortest paths from a given SOURCE node to ALL other nodes, by developing the paths in order of increasing path length. The alg. Proceeds in stages. N = set of nodes in the network; S = sourse node;

zahur
Download Presentation

DIJKSTRA’s Algorithm

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DIJKSTRA’s Algorithm

  2. Definition fwd search • Find the shortest paths from a given SOURCE node to ALL other nodes, by developing the paths in order of increasing path length. The alg. Proceeds in stages. • N = set of nodes in the network; • S = sourse node; • M set of nodes so far incorporated by the alg • l(i,j)= link cost from node i to j;l(i,i)=0; l(i,j)= if the two nodes are not directly connected; l(i,j)>0 if they are directly connected; • C1(n) = least-cost paths from S to n

  3. FWD. Search Algorithm 1.Set M={S}; for each node nN-S, set C1(n)=l(S,n); 2. Find W  N-M so that C1(w) in minimum, add W to M. Set C1(n)= MIN C1(n) and C1(w)+l(w,n) 3. Repeat 2. until M=N

  4. Definition bwd search • Find the shortest paths from a given DESTINATION node from ALL other nodes. • N = set of nodes in the network; • D = destination node; • M set of nodes so far incorporated by the alg • l(i,j)= link cost from node i to j;l(i,i)=0; l(i,j)= if the two nodes are not directly connected; l(i,j)>0 if they are directly connected; • C2(n) = least-cost paths from D to n

  5. BWD. Search Algorithm 1.Set C2(D)=0; for each node nN-D set C2(n)= ; 2. For each node n N-D set C2(n)= MIN C2(n) and C2(w)+l(n,w) (w  N) 3. Repeat 2. until no changes in C2

More Related