compute_cost()
Returns the cost of a tour.
Computes the cost of a tour on a distance matrix. No validation on whether the tour is valid is performed.
tour (List[int]) – The tour.
List
int
dists (Union[List[List[int]], ndarray]) – The distance matrix.
Union
ndarray
float
The cost of the tour.