Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <bop_lns.h>
Public Member Functions | |
NeighborhoodGenerator ()=default | |
virtual | ~NeighborhoodGenerator ()=default |
virtual void | GenerateNeighborhood (const ProblemState &problem_state, double difficulty, sat::SatSolver *sat_propagator)=0 |
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.
|
default |
|
virtualdefault |
|
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: