From 5895f611737b70ef8fa91c6cc432321fc10a7b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Sat, 8 Jul 2023 22:02:07 +0800 Subject: [PATCH] jjjjjjj --- images/suanfa.svg | 511 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 511 insertions(+) create mode 100644 images/suanfa.svg diff --git a/images/suanfa.svg b/images/suanfa.svg new file mode 100644 index 0000000..b59811a --- /dev/null +++ b/images/suanfa.svg @@ -0,0 +1,511 @@ + + + + + + + + + + + + + + 开始 + + + + + + 结束 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 整数值 num2 + + + + + + num2 = 0 + + + + + + + + void Dijkstra() + + + + + + + + 整数值 v1, v2, min, i, j, u, + pre + + + + + + + + 整数值 Array dist[MAX], s + [MAX], path[MAX] + + + + + + + + + + + + + + s[i] = 0 + + + + + + + + + + + + + + + cont[v1][i]<MAX + + + + + + path[i] = v1 + + + + + + path[i] = -1 + + + + + + + + + + + + + + + i = 0 到 num + + + + 下一个 + + + 完成 + + + + + + s[v1] = 1 + + + + + + path[v1] = 0 + + + + + + + + + + + + + + + + min = MAX + + + + + + u = -1 + + + + + + + + + + + + + + + + + + s[j]==0&&dist[j]<min + + + + + + + + + + + u = j + + + + + + min = dist[j] + + + + + + + + + + + + + u!=-1 + + + + + + + + + s[u] = 1 + + + + + + + + + + + + + + + + + + s[j]==0 + + + + + + + + + + + + + cont[u][j]<MAX&&dist[u]+cont + [u][j]<dist[j] + + + + + + + + + dist[j] = dist[u]+cont[u][j] + + + + + + path[j] = u + + + + + + + + + + + + + + + + + + + + + + + + + + + j = 0 到 num + + + + 下一个 + + + 完成 + + + + + + + + + + + + + + + + + + + + + + + + + + + + j = 0 到 num + + + + 下一个 + + + 完成 + + + + + + + i = 0 到 num + + + + 下一个 + + + 完成 + + + + + + 输出 "智能推荐路线如下 + (逆序):\n" + + + + + + + + + + + + + + + + + + + + i!=v1&&i==v2 + + + + + + + + + + + + + + + + s[i]==1 + + + + + + + + + + + num2 = dist[i] + + + + + + pre = i + + + + + + + + + + + + + + 输出 "%s-->",nm.adjust + [pre].name + + + + + + pre = path[pre] + + + + + + + pre!=v + + + + + + + + + + + + + + + + + + + + + + + + 输出 "%s",nm.adjust[pre]. + name + + + + + + + 输出 路径不存在 + + + + + + + + + + + + + + i = 0 到 num + + + + 下一个 + + + 完成 + + + + +