dist
with dimensions n x n
to store the shortest distances between all pairs of cities, setting the initial distances to infinity except for the diagonal (distance to self is 0).dist
with the direct distances between cities provided in the edges
array.distanceThreshold
.