贪心算法——狄克斯特拉算法(Greedy Algorithm - Dijkstra’s Algorithm)
最短路径问题(The Single-Source Shortest Path Problem)
In real life, the single-source shortest path problem is everywhere. For example, you bought a blow-up doll on Taobao. You are anxiously waiting for your “girlfriend”. You hope deliver company can deliver your parcel to your home as soon as possible. The deliver company understand your anxious mood. The problem they are facing is finding out a way that is shortest and has minimum transportation cost.
That’s the single-source shortest path problem. Single-Source means the source is fixed. Find shortest paths to all destinations, which

本文介绍了Dijkstra算法,它是解决单源最短路径问题的著名算法,适用于加权有向或无向图。从给定节点出发,逐步找到最近的邻居节点,直到遍历所有节点,最终得到每个节点到起点的最短路径。时间复杂度为O(|E|log|V|),应用广泛,如交通规划、互联网包路由等。
最低0.47元/天 解锁文章
336

被折叠的 条评论
为什么被折叠?



