https://junwang666.github.io/p/251203_graph/ #5
Replies: 1 comment
-
更正错误:三重循环:
看看i能不能通过k更短的连接到j,一旦探测到一条捷径,那后面的计算也会机遇有捷径的情况来,而第1层循环的一次遍历已经把k能建立的所有捷径都搞定了 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://junwang666.github.io/p/251203_graph/
Dijkstra Dijkstra(狄克斯特拉)算法是解决单源最短路径问题的经典算法。\n简单直观的理解:\n它是 “加权版的 BFS(广度优先搜索)”。\n核心逻辑\n以此为中心:指定一个起点(比如 A)。 贪心策略:每次从未访问的节点中,选出一个离起点当前距离最近的节点。 松弛操作 (Relaxation):以此节点为跳板,检查能不能通过它,让它的邻居离起点更近。如果能,就更新邻居的距离。 锁定:处理完该节点后,将其标记为“已确定”,不再回头。 适用条件\n
https://junwang666.github.io/p/251203_graph/
Beta Was this translation helpful? Give feedback.
All reactions