Dijkstra最短路径算法
Dijkstra最短路径算法Dijkstra's Shortest Path Algorithm
calculates the shortest path and distance between two nodes on a map
This function can
1. Find the shortest path and distance from a starting node to an ending node on a map**
2. Find the shortest paths and distances from a starting node to ALL other nodes on a map**
**The map should consist of nodes and segments, such that:
1. nodes have the format or (with ID being an integer, and X,Y,Z representing position coordinates and of type double)
2. segments have the format (with ID being an integer, and N1 N2 representing IDs from the nodes list such that there is an edgefile:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\V7(XMWRN]{G8~CI}BCCR3QC.gifgment between node N1 and node N2, and obviously of integer type also)
Note:
The function generates a random map of nodes and segments that it uses if no inputs are given. This way, it acts like a script if it is run with no inputs, and it acts like a function otherwise.
**** Hidden Message *****
不错的资料 资料收集狂来了 深V礼 发表于 2014-10-9 16:00 static/image/common/back.gif
资料收集狂来了
欢迎,有用你就果断的搬走吧。 !!!!!!!!!!!!!!!!!!
看一下 会有神马
好啊。。。。。。。。。。。。。。。
好啊。。。。。。。。。。。。。。。
!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!
页:
[1]
2