fast_tsp.score_tour

fast_tsp.score_tour(tour, dists, opt_cost)

Return the score of a tour, where 1 is better and 0 is worst.

Returns a double in the range 0..1, where 0 denotes a solution that is worse than or equivalent to the naive solution and 1 denotes a solution that is equivalent to the optimal solution.

Parameters:
  • tour (List[int]) – The tour.

  • dists (Union[List[List[int]], ndarray]) – The distance matrix.

  • opt_cost (int) – The cost of the optimal tour.

Return type:

float

Returns:

The score of the tour.