这里用到了 dijkstra 最短路径算法步骤:.............................................................................30
public class DijkstraAlgorithm {......................................................................................................30
Set<Node> open=new HashSet<Node>();......................................................................................30
Set<Node> close=new HashSet<Node>();......................................................................................30
Map<String,Integer> path=new HashMap<String,Integer>();//封装路径距离..........................30
Map<String,String> pathInfo=new HashMap<String,String>();//封装路径信息......................30
public Node init(){...........................................................................................................................30
//初始路径,因没有 A->E 这条路径,所以 path(E)设置为 Integer.MAX_VALUE...............30
path.put("B", 1);...............................................................................................................................30
pathInfo.put("B", "A->B");..............................................................................................................30
path.put("C", 1);...............................................................................................................................30
pathInfo.put("C", "A->C");..............................................................................................................30
path.put("D", 4);...............................................................................................................................30
pathInfo.put("D", "A->D");..............................................................................................................30
path.put("E", Integer.MAX_VALUE);.............................................................................................30
pathInfo.put("E", "A");.....................................................................................................................30
path.put("F", 2);................................................................................................................................30
pathInfo.put("F", "A->F");...............................................................................................................30
path.put("G", 5);...............................................................................................................................30
pathInfo.put("G", "A->G");..............................................................................................................30
path.put("H", Integer.MAX_VALUE);............................................................................................30
pathInfo.put("H", "A");....................................................................................................................30
//将初始节点放入 close,其他节点放入 open.........................................................................30
Node start=new MapBuilder().build(open,close);...........................................................................30
return start;.......................................................................................................................................30
}........................................................................................................................................................30
4.2 日志功能模块..........................................................................................................................32
4.3 安装部署...................................................................................................................................32
5 系统测试......................................................................................................................................33
5.1 系统调试的目的和意义............................................................................................33
5.2 功能测试用例...............................................................................................................35
6 总结...............................................................................................................................................38