System.out.print("->"+(chain[k]));
}
System.out.print("->"+j);
}
}
}
}
}
public static void main(String[] args) {
Integer[][] dist = {
{ 0, 1, 4, M, M, M },
{ 1, 0, 2, 7, 5, M },
{ 4, 2, 0, M, 1, M },
{ M, 7, M, 0, 3, 2 },
{ M, 5, 1, 3, 0, 6 },
{ M, M, M, 2, 6, 0 } };// 建立一个权值矩阵
ArrayList list=flody(dist);
display_path(list);
}
}