TSP Solver

Main module for the TSP solver. This module contains the main entry point for the TSP solver. To use it, first import it

import fast_tsp

find_tour(dists[, duration_seconds])

Find a tour using the fast heuristic.

greedy_nearest_neighbor(dists)

Solve the TSP using the greedy nearest neighbor algorithm.

solve_tsp_exact(dists)

Solve the TSP using the exact algorithm.

is_valid_tour(n, tour)

Check if a tour is valid.

compute_cost(tour, dists)

Returns the cost of a tour.

score_tour(tour, dists, opt_cost)

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