Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::bop::NeighborhoodGenerator Class Referenceabstract

#include <bop_lns.h>

Inheritance diagram for operations_research::bop::NeighborhoodGenerator:
operations_research::bop::ConstraintBasedNeighborhood operations_research::bop::ObjectiveBasedNeighborhood operations_research::bop::RelationGraphBasedNeighborhood

Public Member Functions

 NeighborhoodGenerator ()=default
 
virtual ~NeighborhoodGenerator ()=default
 
virtual void GenerateNeighborhood (const ProblemState &problem_state, double difficulty, sat::SatSolver *sat_propagator)=0
 

Detailed Description

Interface of the different LNS neighborhood generation algorithm.

NOTE(user): Using a sat_propagator as the output of the algorithm allows for a really simple and efficient interface for the generator that relies on it. However, if a generator doesn't rely on it at all, it may slow down a bit the code (to investigate). If this happens, we will probably need another function here and a way to select between which one to call.

Definition at line 64 of file bop_lns.h.

Constructor & Destructor Documentation

◆ NeighborhoodGenerator()

operations_research::bop::NeighborhoodGenerator::NeighborhoodGenerator ( )
default

◆ ~NeighborhoodGenerator()

virtual operations_research::bop::NeighborhoodGenerator::~NeighborhoodGenerator ( )
virtualdefault

Member Function Documentation

◆ GenerateNeighborhood()

virtual void operations_research::bop::NeighborhoodGenerator::GenerateNeighborhood ( const ProblemState & problem_state,
double difficulty,
sat::SatSolver * sat_propagator )
pure virtual

Interface for the neighborhood generation.

The difficulty will be in [0, 1] and is related to the asked neighborhood size (and thus local problem difficulty). A difficulty of 0.0 means empty neighborhood and a difficulty of 1.0 means the full problem. The algorithm should try to generate an neighborhood according to this difficulty, which will be dynamically adjusted depending on whether or not we can solve the subproblem.

The given sat_propagator will be reset and then configured so that all the variables propagated on its trail should be fixed. That is, the neighborhood will correspond to the unassigned variables in the sat_propagator. Note that sat_propagator_.IsModelUnsat() will be checked after this is called so it is okay to abort if this happens.

Preconditions:

  • The given sat_propagator_ should have the current problem loaded (with the constraint to find a better solution that any current solution).
  • The problem state must contains a feasible solution.

The documentation for this class was generated from the following file: