pub struct Tour {
pub cities: Vec<(f64, f64)>,
}Expand description
A symmetric travelling-salesperson instance over points in the plane.
Fields§
§cities: Vec<(f64, f64)>The city coordinates.
Implementations§
Source§impl Tour
impl Tour
Sourcepub fn length(&self, order: &[usize]) -> f64
pub fn length(&self, order: &[usize]) -> f64
The length of the closed tour visiting the cities in order.
Sourcepub fn circle(n: usize) -> Self
pub fn circle(n: usize) -> Self
The n cities on a circle of radius 1, numbered in a scrambled order; the optimal tour
is the circle, of length 2 n sin(π / n).
Sourcepub fn circle_optimum(n: usize) -> f64
pub fn circle_optimum(n: usize) -> f64
The optimal length of Tour::circle(n).
Trait Implementations§
impl StructuralPartialEq for Tour
Auto Trait Implementations§
impl Forget for Tour
impl Freeze for Tour
impl Move for Tour
impl RefUnwindSafe for Tour
impl Send for Tour
impl Sync for Tour
impl Unpin for Tour
impl UnsafeUnpin for Tour
impl UnwindSafe for Tour
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more