next next up down toc toc mail

7.8.  Dijkstra's Algorithm for Finding Minimum Paths

If we wish to find the minimum distance from one given node, to an other node of the graph, one of the most efficient techniques to use is a method called

Dijkstra's algorithm.

The essence of Dijkstra's algorithm is that we discover the minimum distance from the source to other nodes in the order of the those minimum distances, that is closest nodes first. As Dijkstra's algorithm proceeds, we have a situation like that


In the graph there are certain nodes that are settled, that is their minimum distance is known. For the unsettled nodes v, it is easy to find the shortest path. Calculate for every settled node the distance to v: [equation]

Minimum(settled nodes, v) = d( [equation] , v ).

The shortest path to v is the path < [equation] >.

Dijkstra's Algorithm

Let G = (V, E) be a graph with
V = { [equation] } =
V = { 1, 2, 3, ... n }
and a start node s and none isolated nodes. This algorithm calculates the shortest path from the node s to every node.

S := set of visited nodes

s := start node, s [isin] S

T := V \ S

d(i) the shortest path from node s to node [equation] v(i) [equation]

weight(i,j) weight (length) from node [equation] to [equation]


back next up down toc toc mail

Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1998).

Last modified: 27/July/98 (12:14)