Trait LocalSearch

Source
pub trait LocalSearch<P, C>:
    Debug
    + Send
    + Sync
where P: Phenotype, C: Challenge<P> + ?Sized,
{ // Required method fn search(&self, phenotype: &mut P, challenge: &C) -> bool; }
Expand description

A trait for local search algorithms.

Local search algorithms improve solutions by exploring their neighborhood and moving to better solutions. They are often used in combination with genetic algorithms to refine solutions.

Required Methods§

Source

fn search(&self, phenotype: &mut P, challenge: &C) -> bool

Applies the local search algorithm to the given phenotype.

Returns true if the phenotype was improved, false otherwise.

Implementors§

Source§

impl<P, C> LocalSearch<P, C> for HillClimbing
where P: Phenotype, C: Challenge<P>,

Source§

impl<P, C> LocalSearch<P, C> for HybridLocalSearch<P, C>
where P: Phenotype, C: Challenge<P> + Debug,

Source§

impl<P, C> LocalSearch<P, C> for SimulatedAnnealing
where P: Phenotype, C: Challenge<P>,

Source§

impl<P, C> LocalSearch<P, C> for TabuSearch<P>
where P: Phenotype + Eq, C: Challenge<P>,