迪杰斯特拉 找到某一个顶点到其他所有顶点的最短距离 弗洛伊德 找到所有顶点之间的最短距离package Algorithm.floyd; import java.util.Arrays; public class floydDemo { public static void main(String[] args) { final int N = 65535; char[] vertex = {'A','B','C','D','E','F','G'}; int[][] weight = new int[][] { {0,5,7,N,N,N,2}, {5,0,N,9,N,N,3}, {7,N,0,N,8,N,N}, {N,9,N,0,N,4,N}, {N,N,8,N,0,5,4}, {N,N,N,4,5,0,6}, {2,3,N,N,4,6,0}, }; Graph graph = new Graph(vertex.length, weight, vertex); graph.floyd(); graph.showAll(); } } class Graph{ private cha...