fast_tsp.is_valid_tour

fast_tsp.is_valid_tour(n, tour)

Check if a tour is valid.

Parameters:
  • n (int) – The number of cities.

  • tour (List[int]) – The tour to test whether it is valid.

Return type:

bool

Returns:

True if the tour is valid, False otherwise.