Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::Neighborhood Struct Reference

Neighborhood returned by Neighborhood generators. More...

#include <cp_model_lns.h>

Public Attributes

bool is_generated = false
 True if neighborhood generator was able to generate a neighborhood.
 
bool is_reduced = false
 
bool is_simple = false
 True if this neighborhood was just obtained by fixing some variables.
 
CpModelProto delta
 
int64_t id = 0
 
std::string source_info = ""
 Overwrites the name of the neighborhood generator in the logs.
 
int num_relaxed_variables = 0
 Statistic, only filled when is_simple is true.
 
int num_relaxed_variables_in_objective = 0
 
std::vector< int > variables_that_can_be_fixed_to_local_optimum
 

Detailed Description

Neighborhood returned by Neighborhood generators.

Definition at line 46 of file cp_model_lns.h.

Member Data Documentation

◆ delta

CpModelProto operations_research::sat::Neighborhood::delta

Specification of the delta between the initial model and the lns fragment. The delta will contains all variables from the initial model, potentially with updated domains. It can contains new variables and new constraints, and solution hinting.

Definition at line 61 of file cp_model_lns.h.

◆ id

int64_t operations_research::sat::Neighborhood::id = 0

Neighborhood Id. Used to identify the neighborhood by a generator. Currently only used by WeightedRandomRelaxationNeighborhoodGenerator.

Todo
(user): Make sure that the id is unique for each generated neighborhood for each generator.

Definition at line 67 of file cp_model_lns.h.

◆ is_generated

bool operations_research::sat::Neighborhood::is_generated = false

True if neighborhood generator was able to generate a neighborhood.

Definition at line 48 of file cp_model_lns.h.

◆ is_reduced

bool operations_research::sat::Neighborhood::is_reduced = false

True if an optimal solution to the neighborhood is also an optimal solution to the original model.

Definition at line 52 of file cp_model_lns.h.

◆ is_simple

bool operations_research::sat::Neighborhood::is_simple = false

True if this neighborhood was just obtained by fixing some variables.

Definition at line 55 of file cp_model_lns.h.

◆ num_relaxed_variables

int operations_research::sat::Neighborhood::num_relaxed_variables = 0

Statistic, only filled when is_simple is true.

Definition at line 73 of file cp_model_lns.h.

◆ num_relaxed_variables_in_objective

int operations_research::sat::Neighborhood::num_relaxed_variables_in_objective = 0

Definition at line 74 of file cp_model_lns.h.

◆ source_info

std::string operations_research::sat::Neighborhood::source_info = ""

Overwrites the name of the neighborhood generator in the logs.

Definition at line 70 of file cp_model_lns.h.

◆ variables_that_can_be_fixed_to_local_optimum

std::vector<int> operations_research::sat::Neighborhood::variables_that_can_be_fixed_to_local_optimum

Only filled when is_simple is true. If we solve the fragment to optimality, then we can just fix the variable listed here to that optimal solution.

This can happen if the neighborhood fully cover some part that are completely independent from the rest of the model. Like for instance an unused but not yet fixed variable.

Warning
all such variables should be fixed at once in a lock-like manner, because they can be multiple optimal solutions on these variables.

Definition at line 85 of file cp_model_lns.h.


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