pub struct LnsSolver { /* private fields */ }Expand description
Large Neighborhood Search solver.
Implementations§
Source§impl LnsSolver
impl LnsSolver
Sourcepub fn new(destroy_fraction: f64) -> Self
pub fn new(destroy_fraction: f64) -> Self
Creates a new LNS solver with specified destroy fraction 0.0..1.0.
Sourcepub fn solve(
&self,
graph: &ValidatedGraph,
options: &SolverOptions,
) -> SolveOutcome
pub fn solve( &self, graph: &ValidatedGraph, options: &SolverOptions, ) -> SolveOutcome
Solves the COP problem using Large Neighborhood Search.
If options.shared_incumbent is set (see crate::solver::SharedIncumbent, used by
crate::solver::ParallelSolver), every improving solution found (including the initial
one) is also offered to it — write-only, like crate::solver::LocalSearchSolver.
§Complexity
Time: O(I * d^K) where I is number of LNS iterations, K is number of destroyed variables. Space: O(N * d) graph snapshot depth.
Sourcepub fn solve_from(
&self,
graph: &ValidatedGraph,
baseline: &Assignment,
options: &SolverOptions,
) -> SolveOutcome
pub fn solve_from( &self, graph: &ValidatedGraph, baseline: &Assignment, options: &SolverOptions, ) -> SolveOutcome
Repairs from a caller-provided baseline assignment. The baseline is used as the LNS neighborhood center even when changed constraints make it infeasible.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LnsSolver
impl RefUnwindSafe for LnsSolver
impl Send for LnsSolver
impl Sync for LnsSolver
impl Unpin for LnsSolver
impl UnsafeUnpin for LnsSolver
impl UnwindSafe for LnsSolver
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