美文网首页
Dijkstra Algorithm

Dijkstra Algorithm

作者: 宇翔_0e77 | 来源:发表于2019-02-15 12:15 被阅读0次

1. 两个list的nodes,searched and unsearched

2. start from a source node. 

3. go to its neighbors, calculate their distances to the source node. 

4. Use a priority queue or something, always find the node with shortest distance to the source node. 

5. Repeat the steps from 3-4, until no nodes exist in the priority queue. 

https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/

https://leetcode.com/problems/network-delay-time/submissions/

相关文章

网友评论

      本文标题:Dijkstra Algorithm

      本文链接:https://www.haomeiwen.com/subject/nokpeqtx.html