The shortest path algorithm includes:
Determine the Shortest Path of the start point: Find the shortest path when the Start Node is known.Suitable for useDijkstra Algorithm.
The shortest path for determining the end point: the problem of finding the shortest path when the end point is known. In an undirected graph, this problem is equivalent to the problem of determining the starting point. In a directed graph, this problem is equivalent to the problem of determining the starting point when all paths are reversed.
Determine the Shortest Path of the start and end points: Find the shortest path between the two nodes.
Global shortest path problem: Find all shortest paths in the graph. Floyd-warshall algorithm.
Dijkstra algorithm idea: At the beginning, S = {u}, t = V-{u}; for all vertices x in T, if u to X has an edge, set d (u, x) = C (u, x); otherwise d (u, x) = infinity. Loop: Find the smallest vertex t of d (u, x) for all vertices x in T, that is, d (u, t) = min {d (u, X) | X belongs to t}, then d (u, T) is the Shortest Path Distance from vertex t to vertex u. In addition, vertex T is the closest vertex of all vertices in set t to U. Delete vertex t from T and merge it into S. Then, for all vertices x adjacent to T in T, use the following formula to update the value of d (u, X): d (u, x) = min {d (u, x), d (u, t) + C (t, x )}. Continue "loop" until T is null. The concept of the Floyd-warshall algorithm is similar to that of the Dijkstra algorithm: it finds the end-to-end shortest path by bypassing the intermediate node and does not describe it.