Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <cp_model_lns.h>
Public Member Functions | |
ConstraintGraphNeighborhoodGenerator (NeighborhoodGeneratorHelper const *helper, absl::string_view name) | |
Neighborhood | Generate (const CpSolverResponse &initial_solution, double difficulty, absl::BitGenRef random) final |
Public Member Functions inherited from operations_research::sat::NeighborhoodGenerator | |
NeighborhoodGenerator (absl::string_view name, NeighborhoodGeneratorHelper const *helper) | |
virtual | ~NeighborhoodGenerator ()=default |
virtual bool | ReadyToGenerate () const |
Returns true if the neighborhood generator can generate a neighborhood. | |
double | GetUCBScore (int64_t total_num_calls) const |
void | AddSolveData (SolveData data) |
double | Synchronize () |
std::string | name () const |
Returns a short description of the generator. | |
int64_t | num_calls () const |
Number of times this generator was called. | |
int64_t | num_fully_solved_calls () const |
Number of time the neighborhood was fully solved (OPTIMAL/INFEASIBLE). | |
int64_t | num_improving_calls () const |
Out of num_calls(), how many improved the given solution. | |
int64_t | num_consecutive_non_improving_calls () const |
double | difficulty () const |
The current difficulty of this generator. | |
double | deterministic_limit () const |
The current time limit that the sub-solve should use on this generator. | |
Additional Inherited Members | |
Protected Attributes inherited from operations_research::sat::NeighborhoodGenerator | |
const std::string | name_ |
const NeighborhoodGeneratorHelper & | helper_ |
absl::Mutex | generator_mutex_ |
Pick a random subset of constraint and relax all of their variables. We are a bit smarter than this because after the first constraint is selected, we only select constraints that share at least one variable with the already selected constraints. The variable from the "last" constraint are selected randomly.
Definition at line 559 of file cp_model_lns.h.
|
inlineexplicit |
Definition at line 561 of file cp_model_lns.h.
|
finalvirtual |
Start by a random constraint.
Stop if we have a full connected component.
Pick a random unprocessed constraint.
Add all the variable of this constraint and increase the set of next possible constraints.
Implements operations_research::sat::NeighborhoodGenerator.
Definition at line 1490 of file cp_model_lns.cc.