Function genetic_algorithm_tsp_api::tsp_solver::solve_tsp
source · [−]pub fn solve_tsp(
distance_matrix: &DistanceMat,
n_generations: usize,
n_routes: usize,
n_random_individuals_per_generation: usize,
top_n: usize
) -> Vec<Route>
Expand description
Compute an route that for the traveling-salesman-problem defined by the distance matrix.
Arguments
distance_matrix
- These distances define the fitness of an invidual.n_generation
- How many generations should the algorithm run for?n_routes
- How many routes should be kept in the population.n_random_route_per_generation
- How many random routes should be ingested in every generation to allow?