System.out.println();
for (int i = 0; i < dis.length; i++) {
System.out.print("("+vertex[k]+"µ½"+vertex[i]+"µÄ×î¶Ì·¾¶ÊÇ" + dis[k][i] + ") ");
}
System.out.println();
System.out.println();
}
}
public void floyd() {
int len = 0;
for(int k = 0; k < dis.length; k++) {
for(int i = 0; i < dis.length; i++) {
for(int j = 0; j < dis.length; j++) {
len = dis[i][k] + dis[k][j];
if(len < dis[i][j]) {
dis[i][j] = len;
pre[i][j] = pre[k][j];
}
}
}
}
}
}
Floyd佛洛依德算法详细解释(2):http://www.751com.cn/fanwen/lunwen_71174.html