#solver #tsp #problem #genetic #salesman #travelling #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

Download history 1/week @ 2024-02-20 11/week @ 2024-02-27 20/week @ 2024-03-12 2/week @ 2024-03-26 25/week @ 2024-04-02 1/week @ 2024-04-09 54/week @ 2024-04-16

82 downloads per month

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