Trait Neighborhood

Source
pub trait Neighborhood<S>: Send + Sync {
    // Required method
    fn neighbors_of<'a>(
        &'a self,
        current_solution: &'a S,
    ) -> Box<dyn Iterator<Item = S> + Send + Sync + 'a>;
}
Expand description

A local search neighborhood that provides for each solution an iterator over all neighbors. The provided current_solution, as well as the Neighborhood instance must live as long as the iterator. (Note that the iterator highly depends on the current_solution and that the Neighborhood may have some attributes which goes into the iterator.)

Required Methods§

Source

fn neighbors_of<'a>( &'a self, current_solution: &'a S, ) -> Box<dyn Iterator<Item = S> + Send + Sync + 'a>

Returns an iterator over all neighbors of current_solution.

Implementors§