#solver #tsp #problem #genetic #travelling #salesman #point2-d

nightly tsp-solver

Genetic travelling salesman problem solver

2 releases

0.0.1 Mar 25, 2023
0.0.0 Mar 24, 2023

#6 in #salesman

MPL-2.0 license

18KB
497 lines

use tsp_solver::{Point2D, TspSolver};

pub fn main() {
    let problem = Point2D::random(20, 16.0, 9.0);
    let mut solver = TspSolver::load_or_create("target/days365/", problem.view());
    for solution in solver.ant_colony_optimization(20) {
        println!("{:04}: {}", solution.best_distance, solution.best_path);
    }
}

Dependencies

~2.8–4MB
~74K SLoC