搜索资源列表
Floyd-Warshall-c-chengxi
- Floyd-Warshall算法描述 1)适用范围: a)APSP(All Pairs Shortest Paths) b)稠密图效果最佳 c)边权可正可负 2)算法描述: a)初始化:dis[u,v]=w[u,v] b)For k:=1 to n For i:=1 to n For j:=1 to n If dis[i,j]>dis[i,k]+dis[k,j] Then Dis[I,j]:=dis[I,k]+dis[k,j] c)算法结
Pipeline
- 程序解决了给定油井位置,求出一条东西向输油管道的位置,使之到各个油井的距离之和达到最小 //程序一次性读入11组测试文件,将油井纵坐标存储在动态开辟的pipey数组里,通过运用在数组中查找第K小个元素的算法找到了管道的最优位置 //最后求得最短距离后,将最终结果一次性存储到11个输出文件中。-Program to solve a given oil well location, find a location east-west pipeline, so that the distanc