public class DijkstraShortestPath extends Object implements IShortestPath
| 构造器和说明 |
|---|
DijkstraShortestPath() |
| 限定符和类型 | 方法和说明 |
|---|---|
int[] |
shortestPath(int[][] graph,
int start)
最短最短路径列表
接受一个有向图的权重矩阵,和一个起点编号start(从0编号,顶点存在数组中)
返回一个int[] 数组,表示从start到它的最短路径长度
TODO: 这里需要一个将矩阵转换为 graph 对象的方法。
|
public int[] shortestPath(int[][] graph,
int start)
IShortestPathshortestPath 在接口中 IShortestPathgraph - 图信息的邻接矩阵标识start - 开始的节点位置Copyright © 2020. All rights reserved.