Dijkstra Algorithm

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/

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容