一些定义
breadth-first search(广度优先搜索) : It operates by processing vertices in layers: the vertices closest to the start are evaluated first, and the most distant vertices are evaluated last.
Dijkstra’s Algorithm
Dijkstra算法解决的是有向图中的最短路径问题, 给定一个含权重有向图, 和一个起始点, 计算出所有其他点与初始点的最短路径(以及路径长).
每个点都有两种状态, 确定和不确定. 每次, 在所有不确定状态的点中, 选取一个最小的, 将状态更改为确定, 即所记录路径是最短的, 然后更新所有与此点相邻的不确定状态的路径. 如此反复直至所有点均变为确定状态.
参考
Data Structures and Algorithm Analysis in C, Mark Allen Weiss.