63 const std::function<
void()>& feasible_solution_observer,
69 const int kUnextracted = -1;
72 std::vector<Literal> assumptions,
73 std::vector<std::vector<Literal>>* core);
76 void ExtractObjectiveVariables();
80 void ExtractAdditionalVariables(absl::Span<const IntegerVariable> to_extract);
85 std::vector<IntegerVariable> ComputeAdditionalVariablesToExtract();
92 int GetExtractedIndex(IntegerVariable
var)
const;
95 bool ComputeInitialMpModel();
98 void ProjectAndAddAtMostOne(absl::Span<const Literal> literals);
114 void TightenMpModel();
117 void AddCoresToTheMpModel(absl::Span<
const std::vector<Literal>> cores);
120 std::vector<Literal> BuildAssumptions(
121 IntegerValue stratified_threshold,
122 IntegerValue* next_stratified_threshold);
125 bool ProcessSolution();
128 bool ImportFromOtherWorkers();
131 const CpModelProto& model_proto_;
133 const std::function<void()> feasible_solution_observer_;
139 const SatParameters& parameters_;
146 MPConstraintProto* obj_constraint_ =
nullptr;
147 MPModelRequest request_;
148 MPSolutionResponse response_;
156 absl::flat_hash_map<LiteralIndex, std::vector<int>> assumption_to_indices_;
160 absl::flat_hash_map<std::pair<int, int64_t>,
int> mp_integer_literals_;
170 std::vector<std::pair<IntegerVariable, MPVariableProto*>>
171 extracted_variables_info_;
173 int num_extracted_at_most_ones_ = 0;
174 std::vector<std::pair<int, MPConstraintProto*>> linear_extract_info_;
177 std::vector<IntegerVariable> normalized_objective_variables_;
178 std::vector<IntegerValue> normalized_objective_coefficients_;
181 std::vector<std::vector<Literal>> temp_cores_;