Dijkstra's Algorithm
-
one of the first label-setting algorithms developed by Dijkstra
-
a general method to solve the single-source shortest-path problem
-
useful for directed and positive weighted graphs
-
algorithm proceeds as following in each stage:
- mark each vertex as either known or unknown
- tentative distance dv, from a source to a vertex, is kept
- known vertices is determined by the distance that turns out to be the
shortest path length
- select a vertex v, which has the smallest path dv among
all the unknown vertices
- declare the shortest path from source to vertex to known
- the remainder of a stage consists of updating the values of adjacent
distance dw
- set dw = dv + c(v,w) where c= cost of adjacent distance dw from
vertex v, only if dw is improved
click
here to link for JAVA applet examples
packet format >>