22 releases (7 stable)

Uses old Rust 2015

1.1.22 Jul 16, 2022
1.1.20 Feb 14, 2022
1.1.19 Dec 24, 2021
1.0.16 Jul 29, 2018
0.0.6 Jun 7, 2015

#11 in #problem

Download history 11/week @ 2024-06-15 19/week @ 2024-06-22 4/week @ 2024-06-29 13/week @ 2024-07-06 83/week @ 2024-07-13 17/week @ 2024-07-20 31/week @ 2024-07-27 67/week @ 2024-08-03 39/week @ 2024-08-10 12/week @ 2024-08-17 29/week @ 2024-08-24 90/week @ 2024-08-31 36/week @ 2024-09-07 41/week @ 2024-09-14 63/week @ 2024-09-21 52/week @ 2024-09-28

236 downloads per month
Used in catenary-backend

GPL-3.0 license

25KB
226 lines

Travelling Salesman

Travelling Salesman Problem Solvers

The aim of this crate is to host various Travelling Salesman Problem solvers. Patches implementing useful algorithms most welcome.

For more information, please see the Travelling Salesman Problem Wikipedia article, and In Pursuit of the Traveling Salesman: Mathematics at the Limits of Computation.

The documentation for this crate can be found here.

Examples

extern crate time;
extern crate travelling_salesman;

fn main() {
  let tour = travelling_salesman::simulated_annealing::solve(
    &[
       (27.0, 78.0),
       (18.0, 24.0),
       (48.0, 62.0),
       (83.0, 77.0),
       (55.0, 56.0),
    ],
    time::Duration::seconds(1),
  );

  println!("Tour distance: {}, route: {:?}", tour.distance, tour.route);
}

Support

Please report any bugs or feature requests at:

Feel free to fork the repository and submit pull requests :)

Author

Alfie John <alfie@alfie.wtf>

Warranty

IT COMES WITHOUT WARRANTY OF ANY KIND.

Copyright and License

Copyright (C) 2021 to Alfie John

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Dependencies

~1MB
~18K SLoC