1 / 4

Dijkstra animation

Dijkstra animation. Dijksta’s Algorithm (Shortest Path Between 2 Nodes). 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight) initialize to 0 if START weight if an edge from START to index

Download Presentation

Dijkstra animation

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 animation

  2. Dijksta’s Algorithm(Shortest Path Between 2 Nodes) 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight) initialize to 0 if START weight if an edge from START to index ∞ if no edge (not adjacent) 3. Path:(node) Contains immediate predecessor initialize to: START if adjacent undefined if not adjacent

  3. Dijkstra’s Algorithm Iteration: repeat find node j with smallest distance, not already included; for each R not included and adjacent to J if distance[j]+edgeweight(J,R)<distance[R] then distance[R]:=distance[J]+edgeweight(J,R); Path[R]:=J; endif; until destination node is included;

  4. - - 4 A 2 A 5 A - ∞ - ∞ Dijkstra t f t f t f t F B f t 10 9 f t B 8 Give the shortest path tree for node A for this graph using Dijkstra’s shortest path algorithm. Show your work with the 3 arrays given and draw the resultant shortest path tree with edge weights included.

More Related