Dijkistra’s
algorithm
SingleSource Sho
SingleSource Shortes
problem of finding short
vertex
v
to all other vert
ortest Path Problem
st Path Problem
 The
test paths from a source
tices in the graph
.
Dijkstra's
Dijkstra's algorithm
 is a
source shortest path probl
Works on both directed an
Input:
Weighted graph G={
v
∈
V, such that all edge we
Output:
Lengths of shortes
paths themselves) from a g
to all other vertices
algorithm
a solution to the single
lem in graph theory.
nd undirected graphs.
{E,V} and source vertex
eights are nonnegative
st paths (or the shortest
given source vertex
v
∈
V
Exam
A
B
C



Pre
mple
D
E


Example
A
B
C



Pre
(contd…)
D
E


Example
A
B
C
A
A
A
Pre
(contd…)
D
E


Example
A
B
C
A
A
A
Pre
(contd…)
D
E


Dijkstra Anima
A
B
C
A
C
A
Pre
ated Example
D
E
C
C
Example
A
B
C
A
C
A
Pre
(contd…)
D
E
C
C
Example
A
B
C
A
C
A
Pre
(contd…)
D
E
C
C
Example
A
B
C
A
C
A
Pre
(contd…)
D
E
C
C
Dijkstra Anima
A
B
C
A
C
A
Pre
ated Example
D
E
B
C
Example
A
B
C
A
C
A
Pre
(contd…)
D
E
B
C
You've reached the end of your free preview.
Want to read all 16 pages?
 Fall '19
 Graph Theory, Shortest path problem, Dijkstra