Every time I think I understand dijkstra this algorithm, but not long and forget, this should be the 4th, 5 times to revisit this algorithm.
This is the Hu Peng of the "Geographic Information System", after reading the sudden realization of the mathematical formula to express the algorithm flow is so good understanding, perfect.
Excerpt from the following:
The shortest path in the network is a simple path, which is a path that does not intersect itself, and the shortest path search is based on: If there is a shortest path from S point to T Point, then the distance from any point on the path to S is the shortest.
Dijkstra algorithm Search steps:
1. Mark the starting point S, and make D (X) =∞,y=s for all vertices;
2. For all unmarked points, calculate the distance by the formula
D (x) =min{d (x), D (y,x) +d (y)}, where Y is the last point to make an identity.
Take the D (X) with the minimum value and mark the XWT to make the y=x.
If the minimum value of D (X) =∞, then s to all the non-identified points have no path, the algorithm terminates; otherwise, continue.
3. If y=t, the shortest path from S to T has been found, the algorithm terminates. Otherwise go to step 2.
Shortest path algorithm: Dijkstra algorithm and Floyd algorithm
Graph theory
Take a step: from the beginning startnode A to traverse an edge, select the shortest side link to Node B, the distance dabs.
Walk two steps: by B traverse the connected side, select the shortest one side, remember the temporary distance dtemp, at this time distance dab+dtemp;
And a take a step second short distance comparison, short distance as the distance to walk two steps.
Basically is "one step, one step, two steps back", to ensure that the effect, each step is the shortest path.
Reference: Design and implementation of the plug-in GIS application framework: Based on C # and AE 9.2
Single source Shortest path--dijkstra algorithm learning