4 protected int[][] Distance
;
6 Distance(Graph graph
) {
7 this(graph
, new int[graph
.getNumOfCities()][graph
.getNumOfCities()]);
9 for (int i
= 0; i
< graph
.getNumOfCities(); i
++) {
10 for (int j
= 0; j
< graph
.getNumOfCities(); j
++) {
11 setDistance(i
,j
, graph
.getINFINITY());
17 Distance(Graph graph
, int[][] Distance
) {
19 this.Distance
= Distance
;
22 public int[][] getDistance() {
26 public int getDistance(int x
, int y
) {
27 return this.Distance
[x
][y
];
30 public void setDistance(int[][] Distance
) {
31 this.Distance
= Distance
;
34 public void setDistance(int x
, int y
, int Distance
) {
35 this.Distance
[x
][y
] = Distance
;