Input: A directed graph with positive, integer edge weights and n vertices.One of the vertices, called start, is specified as the start vertex.
Output: A list of the shortest distances from the start vertex to every other vertex in the graph.
The algorithm uses an array of n integers (called distance) and a set of vertices (called allowedVertices). the variables v, allowedSize, and sum are local integer variables. there is some special value ( inf) that we can place in the distance array to indicate that there is no path.
Step 1. Initialize the distance array to contain all inf except distance[start], which is set to 0.
Step 2. Initialize the set of allowed vertices to be the empty set.
Step 3. Compute the distance array:
for (allowedSize =1; allowedSize < n; allowedSize++)
{
// at this point, allowedVertices contains allowedSize-1 vertices, which are the
// allowedSize-1 closest vertices to the start vertex. Also, for each vertex v,
// distance[v] is the shortest distance from the start vertex to vertex v,
// provided that we are considering only permitted paths (i.e., paths where
// each vertex except the final vertex must be in allowedVertices
Step3a. Let next be the closest vertex to the start vertex, which is not yet in the
set allowedVertices.
Step 3b. Add the vertex next to the set allowedVertices.
Step 3c. Revise the distance array so that the new vertex (next) may appear
on permitted paths:
for (v = 0; v < n; v++)
if ((v is not an allowed vertex) and (there is an edge from next to v))
{
sum = distance[next] + (weight of the edge from next to v);
if (sum < distance[v])
distance[v] = sum;
}
}
Step 4. Output the values in the distance array.
Finding the shortest path is described in the text.
"Discussion: The problem of finding shortest paths in a graph has a surprising variety of applications:
Here's what the Dictionary of Algorithms and Data Structures has to say about Dijkstra's algorithm
Dijkstra's Algorithm and Best-First-Search
One more link: Data Structures and algorithms: Dijkstra's Algorithm
Find directions in a map.
Definition - A minimum-weight tree in a weighted graph which contains all of the graph's vertices. (Entry in Dictionary of Algorithms and Data Structures)
Motivation - "The standard application is to a problem like phone network design. You have a business with several offices; you want to lease phone lines to connect them up with each other; and the phone company charges different amounts of money to connect different pairs of cities. You want a set of lines that connects all your offices with a minimum total cost. It should be a spanning tree, since if a network isn't a tree you can always remove some edges and save money." - ICS 161: Design and Analysis of Algorithms

.