
例如:W[0][5]=9 代表vo->v5的最短路径为9
W=:
0 1 3 7 4 9
1 0 2 6 3 8
3 2 0 4 1 6
7 6 4 0 3 2
4 3 1 3 0 5
9 8 6 2 5 0
package com.xh.Floyd; import java.util.ArrayList; public class Floyd_01 { public static int M = Integer.MAX_VALUE; public static int MAXSUM(int a,int b){ return (a!=M&&b!=M)?(a+b):M; } public static ArrayList flody(Integer[][] dist){ Integer[][] path=new Integer[6][6];//存储的是从i->j经过的最后一个节点 for (int i = 0; i https://www.shan-machinery.com
查看网友的精彩评论