学习进度四
第四周在软件工程 用了大概 67个小时 ,地铁查询路线,求最短路径
代码量 350行
博客 2篇
知识点 1.Java语言中的输入输出以及循环语句
2.求最短路径的算法:迪杰斯特拉算法,虽然最后没有用这个算法实现地铁信息查询,但是对这个算法有了一定的了解
算法描述如下:1)令arcs表示弧上的权值。若弧不存在,则置arcs为∞(在本程序中为MAXCOST)。S为已找到的从
出发的的终点的集合,初始状态为空集。那么,从
出发到图上其余各顶点
可能达到的长度的初值为D=arcs[Locate Vex(G,
)],
∈V;2)选择
,使得D
=Min{ D |
∈V-S } ;3)修改从
出发的到集合V-S中任一顶点
的最短路径长度。
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D9/sign=efa941b69c3df8dca23d83a0cd3f23/29381f30e924b899366736796d061d950a7bf61c.jpg)
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D9/sign=efa941b69c3df8dca23d83a0cd3f23/29381f30e924b899366736796d061d950a7bf61c.jpg)
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D12/sign=8da8de7e48fbfbedd859327d78f0572b/242dd42a2834349bd43c21c4caea15ce36d3bebd.jpg)
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D12/sign=8da8de7e48fbfbedd859327d78f0572b/242dd42a2834349bd43c21c4caea15ce36d3bebd.jpg)
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D12/sign=8da8de7e48fbfbedd859327d78f0572b/242dd42a2834349bd43c21c4caea15ce36d3bebd.jpg)
![](https://gss3.bdstatic.com/-Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D16/sign=eef798ace41190ef05fb96d9cf1b2064/43a7d933c895d143c689ac6270f082025baf07f7.jpg)
![](https://gss3.bdstatic.com/-Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D18/sign=227e4f8b818ba61edbeecc27403419f1/4bed2e738bd4b31c144addfa84d6277f9e2ff879.jpg)
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D12/sign=8da8de7e48fbfbedd859327d78f0572b/242dd42a2834349bd43c21c4caea15ce36d3bebd.jpg)
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D9/sign=efa941b69c3df8dca23d83a0cd3f23/29381f30e924b899366736796d061d950a7bf61c.jpg)