{"id":104246,"date":"2026-09-12T08:01:09","date_gmt":"2026-09-12T00:01:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104246.html"},"modified":"2026-09-12T08:01:09","modified_gmt":"2026-09-12T00:01:09","slug":"17-dijkstra-%e7%ae%97%e6%b3%95%ef%bc%9aospf-%e8%b7%af%e7%94%b1%e7%9a%84%e6%a0%b8%e5%bf%83%e6%9c%80%e7%9f%ad%e8%b7%af%e5%be%84%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104246.html","title":{"rendered":"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5"},"content":{"rendered":"<h3>\u4e00\u3001\u4ec0\u4e48\u662f Dijkstra \u7b97\u6cd5&#xff1f;<\/h3>\n<p>Dijkstra \u7b97\u6cd5\u662f\u4e00\u79cd\u5355\u6e90\u6700\u77ed\u8def\u5f84\u7b97\u6cd5&#xff0c;\u7531\u8377\u5170\u8ba1\u7b97\u673a\u79d1\u5b66\u5bb6 Edsger W. Dijkstra \u5728 1956 \u5e74\u63d0\u51fa\u3002\u5b83\u7684\u6838\u5fc3\u601d\u60f3\u662f\u4ece\u8d77\u70b9\u51fa\u53d1&#xff0c;\u6bcf\u6b21\u9009\u62e9\u8ddd\u79bb\u8d77\u70b9\u6700\u8fd1\u7684\u672a\u8bbf\u95ee\u8282\u70b9&#xff0c;\u66f4\u65b0\u5176\u90bb\u5c45\u8282\u70b9\u7684\u8ddd\u79bb&#xff0c;\u76f4\u5230\u6240\u6709\u8282\u70b9\u90fd\u88ab\u8bbf\u95ee&#xff0c;\u6700\u7ec8\u5f97\u5230\u8d77\u70b9\u5230\u6240\u6709\u5176\u4ed6\u8282\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002<\/p>\n<p>\u7b80\u5355\u6765\u8bf4&#xff0c;Dijkstra \u7b97\u6cd5\u5c31\u50cf \u201c\u627e\u6700\u77ed\u8def\u7ebf\u7684\u5bfc\u822a\u201d&#xff1a;<\/p>\n<ul>\n<li>\u4f60\u5728\u8d77\u70b9&#xff0c;\u8981\u53bb\u591a\u4e2a\u76ee\u7684\u5730&#xff1b;<\/li>\n<li>\u6bcf\u6b21\u5148\u53bb\u79bb\u4f60\u6700\u8fd1\u7684\u5730\u65b9&#xff0c;\u7136\u540e\u4ece\u90a3\u91cc\u51fa\u53d1\u66f4\u65b0\u5176\u4ed6\u5730\u65b9\u7684\u8ddd\u79bb&#xff1b;<\/li>\n<li>\u91cd\u590d\u8fd9\u4e2a\u8fc7\u7a0b&#xff0c;\u76f4\u5230\u6240\u6709\u5730\u65b9\u7684\u6700\u77ed\u8ddd\u79bb\u90fd\u7b97\u51fa\u6765\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001Dijkstra \u7b97\u6cd5\u7684\u6838\u5fc3\u6b65\u9aa4<\/h3>\n<p>Dijkstra \u7b97\u6cd5\u7684\u6838\u5fc3\u6b65\u9aa4\u53ef\u4ee5\u5206\u4e3a\u4ee5\u4e0b\u51e0\u6b65&#xff1a;<\/p>\n<li>\u521d\u59cb\u5316&#xff1a;\u5c06\u8d77\u70b9\u7684\u8ddd\u79bb\u8bbe\u4e3a 0&#xff0c;\u5176\u4ed6\u8282\u70b9\u7684\u8ddd\u79bb\u8bbe\u4e3a\u65e0\u7a77\u5927&#xff1b;<\/li>\n<li>\u9009\u62e9\u8282\u70b9&#xff1a;\u4ece\u672a\u8bbf\u95ee\u7684\u8282\u70b9\u4e2d\u9009\u62e9\u8ddd\u79bb\u8d77\u70b9\u6700\u8fd1\u7684\u8282\u70b9&#xff1b;<\/li>\n<li>\u66f4\u65b0\u8ddd\u79bb&#xff1a;\u904d\u5386\u8be5\u8282\u70b9\u7684\u6240\u6709\u90bb\u5c45&#xff0c;\u8ba1\u7b97\u901a\u8fc7\u8be5\u8282\u70b9\u5230\u8fbe\u90bb\u5c45\u7684\u8ddd\u79bb&#xff0c;\u5982\u679c\u66f4\u77ed\u5219\u66f4\u65b0&#xff1b;<\/li>\n<li>\u6807\u8bb0\u8bbf\u95ee&#xff1a;\u5c06\u8be5\u8282\u70b9\u6807\u8bb0\u4e3a\u5df2\u8bbf\u95ee&#xff1b;<\/li>\n<li>\u91cd\u590d&#xff1a;\u7ee7\u7eed\u9009\u62e9\u4e0b\u4e00\u4e2a\u6700\u8fd1\u7684\u8282\u70b9&#xff0c;\u76f4\u5230\u6240\u6709\u8282\u70b9\u90fd\u88ab\u8bbf\u95ee\u3002<\/li>\n<h3>\u4e09\u3001Dijkstra \u7b97\u6cd5\u7684\u4ee3\u7801\u5b9e\u73b0<\/h3>\n<h4>1. Python \u7248\u672c&#xff08;\u76f4\u89c2\u6613\u61c2&#xff09;<\/h4>\n<p>import heapq<\/p>\n<p>def dijkstra(graph, start):<br \/>\n    # \u521d\u59cb\u5316\u8ddd\u79bb&#xff1a;\u6240\u6709\u8282\u70b9\u8ddd\u79bb\u8bbe\u4e3a\u65e0\u7a77\u5927<br \/>\n    distances &#061; {node: float(&#039;inf&#039;) for node in graph}<br \/>\n    distances[start] &#061; 0<\/p>\n<p>    # \u4f18\u5148\u961f\u5217&#xff1a;\u5b58\u50a8&#xff08;\u8ddd\u79bb&#xff0c;\u8282\u70b9&#xff09;&#xff0c;\u8ddd\u79bb\u5c0f\u7684\u4f18\u5148<br \/>\n    priority_queue &#061; []<br \/>\n    heapq.heappush(priority_queue, (0, start))<\/p>\n<p>    # \u8bb0\u5f55\u8def\u5f84<br \/>\n    path &#061; {node: None for node in graph}<\/p>\n<p>    while priority_queue:<br \/>\n        current_distance, current_node &#061; heapq.heappop(priority_queue)<\/p>\n<p>        # \u5982\u679c\u5f53\u524d\u8ddd\u79bb\u5927\u4e8e\u5df2\u77e5\u6700\u77ed\u8ddd\u79bb&#xff0c;\u8df3\u8fc7<br \/>\n        if current_distance &gt; distances[current_node]:<br \/>\n            continue<\/p>\n<p>        # \u904d\u5386\u90bb\u5c45<br \/>\n        for neighbor, weight in graph[current_node].items():<br \/>\n            distance &#061; current_distance &#043; weight<\/p>\n<p>            # \u5982\u679c\u65b0\u8ddd\u79bb\u66f4\u77ed&#xff0c;\u66f4\u65b0<br \/>\n            if distance &lt; distances[neighbor]:<br \/>\n                distances[neighbor] &#061; distance<br \/>\n                path[neighbor] &#061; current_node<br \/>\n                heapq.heappush(priority_queue, (distance, neighbor))<\/p>\n<p>    return distances, path<\/p>\n<p># \u6d4b\u8bd5&#xff1a;\u8def\u7531\u5668\u7f51\u7edc<br \/>\ngraph &#061; {<br \/>\n    &#039;R1&#039;: {&#039;R2&#039;: 1, &#039;R3&#039;: 10, &#039;R5&#039;: 10},<br \/>\n    &#039;R2&#039;: {&#039;R1&#039;: 1, &#039;R3&#039;: 3, &#039;R5&#039;: 2},<br \/>\n    &#039;R3&#039;: {&#039;R1&#039;: 10, &#039;R2&#039;: 3, &#039;R4&#039;: 1},<br \/>\n    &#039;R4&#039;: {&#039;R3&#039;: 1, &#039;R5&#039;: 1},<br \/>\n    &#039;R5&#039;: {&#039;R1&#039;: 10, &#039;R2&#039;: 2, &#039;R4&#039;: 1}<br \/>\n}<\/p>\n<p>distances, path &#061; dijkstra(graph, &#039;R1&#039;)<br \/>\nprint(&#034;\u6700\u77ed\u8ddd\u79bb&#xff1a;&#034;, distances)<br \/>\nprint(&#034;\u8def\u5f84&#xff1a;&#034;, path)<\/p>\n<h4>2. C \u8bed\u8a00\u7248\u672c&#xff08;\u66f4\u8d34\u8fd1\u5e95\u5c42&#xff09;<\/h4>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;limits.h&gt;<\/p>\n<p>#define INF INT_MAX<br \/>\n#define N 5  \/\/ \u8def\u7531\u5668\u6570\u91cf<\/p>\n<p>\/\/ \u8def\u7531\u5668\u540d\u79f0<br \/>\nchar nodes[] &#061; {&#039;R1&#039;, &#039;R2&#039;, &#039;R3&#039;, &#039;R4&#039;, &#039;R5&#039;};<\/p>\n<p>\/\/ \u56fe\u7684\u90bb\u63a5\u77e9\u9635<br \/>\nint graph[N][N] &#061; {<br \/>\n    {0, 1, 10, INF, 10},<br \/>\n    {1, 0, 3, INF, 2},<br \/>\n    {10, 3, 0, 1, INF},<br \/>\n    {INF, INF, 1, 0, 1},<br \/>\n    {10, 2, INF, 1, 0}<br \/>\n};<\/p>\n<p>\/\/ \u627e\u5230\u8ddd\u79bb\u6700\u5c0f\u7684\u672a\u8bbf\u95ee\u8282\u70b9<br \/>\nint minDistance(int dist[], int visited[]) {<br \/>\n    int min &#061; INF, min_index;<br \/>\n    for (int v &#061; 0; v &lt; N; v&#043;&#043;) {<br \/>\n        if (visited[v] &#061;&#061; 0 &amp;&amp; dist[v] &lt; min) {<br \/>\n            min &#061; dist[v];<br \/>\n            min_index &#061; v;<br \/>\n        }<br \/>\n    }<br \/>\n    return min_index;<br \/>\n}<\/p>\n<p>\/\/ Dijkstra\u7b97\u6cd5<br \/>\nvoid dijkstra(int start) {<br \/>\n    int dist[N];    \/\/ \u5b58\u50a8\u6700\u77ed\u8ddd\u79bb<br \/>\n    int visited[N]; \/\/ \u6807\u8bb0\u662f\u5426\u5df2\u8bbf\u95ee<br \/>\n    int path[N];    \/\/ \u8bb0\u5f55\u8def\u5f84<\/p>\n<p>    \/\/ \u521d\u59cb\u5316<br \/>\n    for (int i &#061; 0; i &lt; N; i&#043;&#043;) {<br \/>\n        dist[i] &#061; INF;<br \/>\n        visited[i] &#061; 0;<br \/>\n        path[i] &#061; -1;<br \/>\n    }<br \/>\n    dist[start] &#061; 0;<\/p>\n<p>    for (int count &#061; 0; count &lt; N &#8211; 1; count&#043;&#043;) {<br \/>\n        \/\/ \u9009\u62e9\u8ddd\u79bb\u6700\u5c0f\u7684\u672a\u8bbf\u95ee\u8282\u70b9<br \/>\n        int u &#061; minDistance(dist, visited);<br \/>\n        visited[u] &#061; 1;<\/p>\n<p>        \/\/ \u66f4\u65b0\u90bb\u5c45\u7684\u8ddd\u79bb<br \/>\n        for (int v &#061; 0; v &lt; N; v&#043;&#043;) {<br \/>\n            if (!visited[v] &amp;&amp; graph[u][v] !&#061; INF &amp;&amp; dist[u] !&#061; INF &amp;&amp; dist[u] &#043; graph[u][v] &lt; dist[v]) {<br \/>\n                dist[v] &#061; dist[u] &#043; graph[u][v];<br \/>\n                path[v] &#061; u;<br \/>\n            }<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/\/ \u6253\u5370\u7ed3\u679c<br \/>\n    printf(&#034;\u8d77\u70b9&#xff1a;%c\\\\n&#034;, nodes[start]);<br \/>\n    for (int i &#061; 0; i &lt; N; i&#043;&#043;) {<br \/>\n        printf(&#034;\u5230%c\u7684\u6700\u77ed\u8ddd\u79bb&#xff1a;%d&#xff0c;\u8def\u5f84&#xff1a;&#034;, nodes[i], dist[i]);<br \/>\n        int p &#061; i;<br \/>\n        while (p !&#061; -1) {<br \/>\n            printf(&#034;%c &#034;, nodes[p]);<br \/>\n            p &#061; path[p];<br \/>\n        }<br \/>\n        printf(&#034;\\\\n&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<p>int main() {<br \/>\n    dijkstra(0);  \/\/ \u4eceR1\u51fa\u53d1<br \/>\n    return 0;<br \/>\n}<\/p>\n<h3>\u56db\u3001Dijkstra \u7b97\u6cd5\u7684\u7279\u70b9<\/h3>\n<ul>\n<li>\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;O (n\u00b2)&#xff08;\u6734\u7d20\u5b9e\u73b0&#xff09;&#xff0c;O (m log n)&#xff08;\u4f18\u5148\u961f\u5217\u5b9e\u73b0&#xff09;&#xff1b;<\/li>\n<li>\u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O (n)&#xff0c;\u9700\u8981\u5b58\u50a8\u8ddd\u79bb\u548c\u8bbf\u95ee\u6807\u8bb0&#xff1b;<\/li>\n<li>\u9002\u7528\u573a\u666f&#xff1a;\u8fb9\u6743\u975e\u8d1f\u7684\u56fe&#xff0c;\u4e0d\u80fd\u5904\u7406\u8d1f\u6743\u8fb9&#xff1b;<\/li>\n<li>\u5355\u6e90\u6700\u77ed\u8def\u5f84&#xff1a;\u53ea\u80fd\u8ba1\u7b97\u8d77\u70b9\u5230\u6240\u6709\u5176\u4ed6\u8282\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002<\/li>\n<\/ul>\n<h3>\u4e94\u3001Dijkstra \u7b97\u6cd5\u7684\u4f18\u5316<\/h3>\n<p>\u4e3a\u4e86\u63d0\u9ad8 Dijkstra \u7b97\u6cd5\u7684\u6548\u7387&#xff0c;\u53ef\u4ee5\u8fdb\u884c\u4ee5\u4e0b\u4f18\u5316&#xff1a;<\/p>\n<li>\u4f18\u5148\u961f\u5217&#xff1a;\u4f7f\u7528\u4f18\u5148\u961f\u5217\u5b58\u50a8\u8282\u70b9&#xff0c;\u6bcf\u6b21\u53d6\u51fa\u8ddd\u79bb\u6700\u5c0f\u7684\u8282\u70b9&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6\u964d\u4e3a O (m log n)&#xff1b;<\/li>\n<li>\u6590\u6ce2\u90a3\u5951\u5806&#xff1a;\u4f7f\u7528\u6590\u6ce2\u90a3\u5951\u5806\u4ee3\u66ff\u4f18\u5148\u961f\u5217&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6\u964d\u4e3a O (m &#043; n log n)&#xff1b;<\/li>\n<li>\u53cc\u5411 Dijkstra&#xff1a;\u4ece\u8d77\u70b9\u548c\u7ec8\u70b9\u540c\u65f6\u5f00\u59cb Dijkstra \u7b97\u6cd5&#xff0c;\u76f4\u5230\u76f8\u9047&#xff0c;\u51cf\u5c11\u641c\u7d22\u8303\u56f4\u3002<\/li>\n<h3>\u516d\u3001Dijkstra \u7b97\u6cd5\u7684\u5b9e\u9645\u5e94\u7528\u573a\u666f<\/h3>\n<p>Dijkstra \u7b97\u6cd5\u662f\u4e00\u79cd\u975e\u5e38\u57fa\u7840\u4e14\u91cd\u8981\u7684\u7b97\u6cd5&#xff0c;\u5e38\u89c1\u573a\u666f\u5305\u62ec&#xff1a;<\/p>\n<li>\u8def\u7531\u534f\u8bae&#xff1a;OSPF&#xff08;\u5f00\u653e\u5f0f\u6700\u77ed\u8def\u5f84\u4f18\u5148&#xff09;\u534f\u8bae\u7684\u6838\u5fc3\u7b97\u6cd5&#xff0c;\u7528\u4e8e\u8ba1\u7b97\u8def\u7531\u5668\u4e4b\u95f4\u7684\u6700\u77ed\u8def\u5f84&#xff1b;<\/li>\n<li>\u5bfc\u822a\u7cfb\u7edf&#xff1a;\u8f66\u8f7d\u5bfc\u822a\u3001\u65e0\u4eba\u673a\u5bfc\u822a&#xff0c;\u8ba1\u7b97\u6700\u77ed\u8def\u7ebf&#xff1b;<\/li>\n<li>\u7f51\u7edc\u8bbe\u8ba1&#xff1a;\u8bbe\u8ba1\u7f51\u7edc\u62d3\u6251&#xff0c;\u6700\u5c0f\u5316\u7f51\u7edc\u5ef6\u8fdf&#xff1b;<\/li>\n<li>\u6e38\u620f AI&#xff1a;\u6e38\u620f\u4e2d\u7684 NPC \u8def\u5f84\u89c4\u5212&#xff0c;\u627e\u5230\u6700\u77ed\u8def\u5f84&#xff1b;<\/li>\n<li>\u7269\u6d41\u914d\u9001&#xff1a;\u8ba1\u7b97\u914d\u9001\u4e2d\u5fc3\u5230\u5404\u4e2a\u914d\u9001\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002<\/li>\n<h3>\u4e03\u3001Dijkstra \u7b97\u6cd5 vs BFS<\/h3>\n<p>Dijkstra \u7b97\u6cd5\u548c BFS \u90fd\u662f\u8def\u5f84\u641c\u7d22\u7b97\u6cd5&#xff0c;\u5b83\u4eec\u7684\u533a\u522b\u5982\u4e0b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260912000107-6aa49643c86af.png\" \/><\/p>\n<h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<p>Dijkstra \u7b97\u6cd5\u662f\u4e00\u79cd\u5355\u6e90\u6700\u77ed\u8def\u5f84\u7b97\u6cd5&#xff0c;\u5b83\u901a\u8fc7\u6bcf\u6b21\u9009\u62e9\u8ddd\u79bb\u8d77\u70b9\u6700\u8fd1\u7684\u672a\u8bbf\u95ee\u8282\u70b9&#xff0c;\u66f4\u65b0\u5176\u90bb\u5c45\u8282\u70b9\u7684\u8ddd\u79bb&#xff0c;\u6700\u7ec8\u5f97\u5230\u8d77\u70b9\u5230\u6240\u6709\u5176\u4ed6\u8282\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002<\/p>\n<p>Dijkstra \u7b97\u6cd5\u662f OSPF \u8def\u7531\u534f\u8bae\u7684\u6838\u5fc3\u7b97\u6cd5&#xff0c;\u5e7f\u6cdb\u5e94\u7528\u4e8e\u5bfc\u822a\u7cfb\u7edf\u3001\u7f51\u7edc\u8bbe\u8ba1\u3001\u6e38\u620f AI \u7b49\u9886\u57df&#xff0c;\u662f\u4e00\u79cd\u975e\u5e38\u57fa\u7840\u4e14\u91cd\u8981\u7684\u7b97\u6cd5\u3002<\/p>\n<p>\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u4f60\u7406\u89e3 Dijkstra \u7b97\u6cd5\u7684\u539f\u7406\u548c\u5b9e\u73b0&#xff01;<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4ec0\u4e48\u662f Dijkstra \u7b97\u6cd5&#xff1f;Dijkstra \u7b97\u6cd5\u662f\u4e00\u79cd\u5355\u6e90\u6700\u77ed\u8def\u5f84\u7b97\u6cd5&#xff0c;\u7531\u8377\u5170\u8ba1\u7b97\u673a\u79d1\u5b66\u5bb6 Edsger W. Dijkstra \u5728 1956 \u5e74\u63d0\u51fa\u3002\u5b83\u7684\u6838\u5fc3\u601d\u60f3\u662f\u4ece\u8d77\u70b9\u51fa\u53d1&#xff0c;\u6bcf\u6b21\u9009\u62e9\u8ddd\u79bb\u8d77\u70b9\u6700\u8fd1\u7684\u672a\u8bbf\u95ee\u8282\u70b9&#xff0c;\u66f4\u65b0\u5176\u90bb\u5c45\u8282\u70b9\u7684\u8ddd\u79bb&#xff0c;\u76f4\u5230\u6240\u6709\u8282\u70b9\u90fd\u88ab\u8bbf\u95ee&#xff0c;\u6700\u7ec8\u5f97\u5230\u8d77\u70b9\u5230\u6240\u6709\u5176\u4ed6\u8282\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002\u7b80\u5355\u6765\u8bf4&#xff0c;Dijkstra \u7b97\u6cd5\u5c31\u50cf \u201c\u627e\u6700\u77ed\u8def\u7ebf\u7684\u5bfc\u822a\u201d&#xff1a;\u4f60\u5728<\/p>\n","protected":false},"author":2,"featured_media":104245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[427],"topic":[],"class_list":["post-104246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/104246.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4ec0\u4e48\u662f Dijkstra \u7b97\u6cd5&#xff1f;Dijkstra \u7b97\u6cd5\u662f\u4e00\u79cd\u5355\u6e90\u6700\u77ed\u8def\u5f84\u7b97\u6cd5&#xff0c;\u7531\u8377\u5170\u8ba1\u7b97\u673a\u79d1\u5b66\u5bb6 Edsger W. Dijkstra \u5728 1956 \u5e74\u63d0\u51fa\u3002\u5b83\u7684\u6838\u5fc3\u601d\u60f3\u662f\u4ece\u8d77\u70b9\u51fa\u53d1&#xff0c;\u6bcf\u6b21\u9009\u62e9\u8ddd\u79bb\u8d77\u70b9\u6700\u8fd1\u7684\u672a\u8bbf\u95ee\u8282\u70b9&#xff0c;\u66f4\u65b0\u5176\u90bb\u5c45\u8282\u70b9\u7684\u8ddd\u79bb&#xff0c;\u76f4\u5230\u6240\u6709\u8282\u70b9\u90fd\u88ab\u8bbf\u95ee&#xff0c;\u6700\u7ec8\u5f97\u5230\u8d77\u70b9\u5230\u6240\u6709\u5176\u4ed6\u8282\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002\u7b80\u5355\u6765\u8bf4&#xff0c;Dijkstra \u7b97\u6cd5\u5c31\u50cf \u201c\u627e\u6700\u77ed\u8def\u7ebf\u7684\u5bfc\u822a\u201d&#xff1a;\u4f60\u5728\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104246.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-12T00:01:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260912000107-6aa49643c86af.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104246.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104246.html\",\"name\":\"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-12T00:01:09+00:00\",\"dateModified\":\"2026-09-12T00:01:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104246.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104246.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104246.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/104246.html","og_locale":"zh_CN","og_type":"article","og_title":"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4ec0\u4e48\u662f Dijkstra \u7b97\u6cd5&#xff1f;Dijkstra \u7b97\u6cd5\u662f\u4e00\u79cd\u5355\u6e90\u6700\u77ed\u8def\u5f84\u7b97\u6cd5&#xff0c;\u7531\u8377\u5170\u8ba1\u7b97\u673a\u79d1\u5b66\u5bb6 Edsger W. Dijkstra \u5728 1956 \u5e74\u63d0\u51fa\u3002\u5b83\u7684\u6838\u5fc3\u601d\u60f3\u662f\u4ece\u8d77\u70b9\u51fa\u53d1&#xff0c;\u6bcf\u6b21\u9009\u62e9\u8ddd\u79bb\u8d77\u70b9\u6700\u8fd1\u7684\u672a\u8bbf\u95ee\u8282\u70b9&#xff0c;\u66f4\u65b0\u5176\u90bb\u5c45\u8282\u70b9\u7684\u8ddd\u79bb&#xff0c;\u76f4\u5230\u6240\u6709\u8282\u70b9\u90fd\u88ab\u8bbf\u95ee&#xff0c;\u6700\u7ec8\u5f97\u5230\u8d77\u70b9\u5230\u6240\u6709\u5176\u4ed6\u8282\u70b9\u7684\u6700\u77ed\u8def\u5f84\u3002\u7b80\u5355\u6765\u8bf4&#xff0c;Dijkstra \u7b97\u6cd5\u5c31\u50cf \u201c\u627e\u6700\u77ed\u8def\u7ebf\u7684\u5bfc\u822a\u201d&#xff1a;\u4f60\u5728","og_url":"https:\/\/www.wsisp.com\/helps\/104246.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-12T00:01:09+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260912000107-6aa49643c86af.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/104246.html","url":"https:\/\/www.wsisp.com\/helps\/104246.html","name":"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-12T00:01:09+00:00","dateModified":"2026-09-12T00:01:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104246.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104246.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104246.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"17.Dijkstra \u7b97\u6cd5\uff1aOSPF \u8def\u7531\u7684\u6838\u5fc3\u6700\u77ed\u8def\u5f84\u7b97\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=104246"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104246\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/104245"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104246"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}