C++ Reference: class NeighborhoodGeneratorHelper

This documentation is automatically generated.

Contains pre-computed information about a given CpModelProto that is meant to be used to generate LNS neighborhood. This class can be shared between more than one generator in order to reduce memory usage.

Note that its implement the SubSolver interface to be able to Synchronize() the bounds of the base problem with the external world.

Return type: const std::vector<int>&

Returns the list of "active" variables.


Return type: Neighborhood

Arguments: const CpSolverResponse& initial_solution

Returns a trivial model by fixing all active variables to the initial solution values.


Return type: Neighborhood

Arguments: const CpSolverResponse& initial_solution, const std::vector<int>& variables_to_fix

Returns the LNS fragment where the given variables are fixed to the value they take in the given solution.


Return type: Neighborhood

Return a neighborhood that correspond to the full problem.


Return type: std::function<void()>

Arguments: int64 task_id


Return type: bool

Arguments: int var

Indicates if the variable can be frozen. It happens if the variable is non constant, and if it is a decision variable, or if focus_on_decision_variables is false.


Return type: const CpModelProto&

The initial problem. Note that the domain of the variables are not updated here.


Return type: absl::Mutex*

This mutex must be aquired before calling any of the function that access data that can be updated by Synchronize(). TODO(user): Refactor the class to be thread-safe instead, it should be safer and more easily maintenable. Some complication with accessing the variable<->constraint graph efficiently though.


Arguments: int id, CpModelProto const* model_proto, SatParameters const* parameters, SharedResponseManager* shared_response, SharedTimeLimit* shared_time_limit = nullptr, SharedBoundsManager* shared_bounds = nullptr


Return type: const SatParameters&


Return type: Neighborhood

Arguments: const CpSolverResponse& initial_solution, const std::vector<int>& relaxed_variables

Returns the LNS fragment which will relax all inactive variables and all variables in relaxed_variables.


Return type: const SharedResponseManager&


Return type: void


Return type: bool

SubSolver interface.


Return type: const absl::Span<const int>

Arguments: ConstraintProto::ConstraintCase type

Returns all the constraints indices of a given type.