求解网络中的最短路径。假设某个计算机网络有n个站点,依次编号为1,2,…,n;有的站点之间有直接的线路连接(即这两个站点之间没有其它站点),有的站点之间没有直接...
求解网络中的最短路径。假设某个计算机网络有n个站点,依次编号为1,2,…,n;有的站点之间有直接的线路连接(即这两个站点之间没有其它站点),有的站点之间没有直接的线路连接。如果用三元组(i,j,f)来表示该网络中的站点I和站点j之间有直接的线路连接且它们之间的距离为f 当已知该网络各站点之间的直接连接情况由m个三元组(i1,j1,f1),(i2,j2,f2),…,(im,jm,fm)确定时,要求计算出对于网络中任意一个站点g(1≤g≤n)到其余各站点的最短距离。-the shortest path. Assuming a computer network n site, followed by No. 1, 2, ..., n; Some sites have direct connections (that is, between two sites are no other site), and some sites have no direct connections. If three yuan (i, j, f) to the network said the site j site and I have direct connections between them but the distance of f the network known as the site of the direct link between the situation by 3 m (i1, j1, f1), ( i2, j2, f2), ..., (im, jm, fm) to determine, calculate requirements for a network site arbitrary g (1 g n) of the rest of the site is the shortest distance.
- 2023-05-31 21:45:02下载
- 积分:1