The New Algorithm for Finding the Paths based on Coding Graph
2012
The most famous one for finding the shortest path is the Dijkstra, but it has some limitations. For example, when there are more than one shortest path between the source node and one special node, Dijkstra could find only one of them. Besides, the algorithm is quite complex. This article introduce a conception of coding g raph, abstracting the problem of shortest paths and critical paths into the same mathematical model to describe and solve, presents a new algorithm of finding the path s . The algorithm extends first the data structure of the orthogonal list, so that the graph will be stored in the same storage space with the path searching process and result data. Cod es for all node s in the graph starting from the source node, using the rule of getting extremum in the weighing calculation and breadth-first , When accessing recursively the adjacent nodes from the current node, re-estimate the distance of neighboring node and entering edge list. if the distance of current node plus the weight of the edge to the neighboring node is less then ( or greater than ) the original distance of the neighboring node, then set this value as the new distance of this neighbor node, if the distance of current node plus the weight of the edge to the neighboring node is greater than ( or less than ) the original distance of the neighboring node, then the edge node will be deleted from the entering edge list , until all the nodes were coded and the coding graph of shortest path (or critical path) is created. For each node in the coding graph, starts searching from ent ry edge list recursively could get all shortest paths (or critical paths) and distances to the source node. Compared with the exist ing algorithms, this algorithm is simpler and more understandable, needs only 3n+5e storage unit that is much less then that of Dijkstra (which is n 2 +2n). The time complexity O(n+e), which is also lower than the Dijkstra O(n 2 ) .
Keywords:
- Correction
- Source
- Cite
- Save
- Machine Reading By IdeaReader
11
References
4
Citations
NaN
KQI