Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - shortest path
Search - shortest path - List
(2) 主要算法的基本思想: 从题目上来分析我认为这是一个图的最短路径问题。因此决定用Dijkstra算法按路径长度递增的顺序逐步产生最短路径的方法:设置两个顶点的集合T和S,集合S中存放已找到的最短路径的顶点,集合T中存放当前还未找到的最短路径的顶点。初始状态时,集合S中只包含源点V0,然后不断从集合T中选取到顶点V0路径长度最短的顶点加入到集合S中,集合S中每加入一个新的顶点U,都要修改顶点V0到集合T中剩余顶点的最短路径长度值,集合T中各顶点新的最短路径长度值为原来的最短路径长度值与顶点U的最短路径长度只值中的较小的。此过程不断重复,直到集合T的顶点全部加入到集合S为止。 -(2) the principal on the basic idea : onto analysis from the topics I think this is a map of the shortest path problem. It decided to use Dijkstra algorithm by increasing the path length of the order gradually emerge from the shortest path approach : set up two vertices of the pool T and S, S storage pools have found the shortest path to the peak, Set T has not kept current to find the shortest path to the peak. Initial state, the pool S contain only source V0. and then from the pool of selected T vertex V0 shortest path length of the apex into pools S, S pool each add a new peak U, vertex V0 be changed to pool the remaining vertices T is the shortest path length value, Set T vertices new shortest path length of the original value of the shortest path length and value of the vertex U short
Date : 2025-12-31 Size : 23kb User : 林渊
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.