Module travelling_salesman::random_search
source · [−]Expand description
Find an approximate solution to the Travelling Salesman Problem using Random Search
For more information, please see the metaheuristics::random_search documentation.
Examples
extern crate time;
extern crate travelling_salesman;
fn main() {
let tour = travelling_salesman::random_search::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);
}
Functions
Returns an approximate solution to the Travelling Salesman Problem using Random Search