14 #ifndef OR_TOOLS_SAT_FEASIBILITY_PUMP_H_
15 #define OR_TOOLS_SAT_FEASIBILITY_PUMP_H_
40 max_fp_iterations_ =
std::max(1, max_iter);
65 return integer_solution_objective_;
68 return integer_solution_is_feasible_;
85 bool NearestIntegerRounding();
96 bool LockBasedRounding();
100 bool ActiveLockBasedRounding();
112 bool PropagationRounding();
114 void FillIntegerSolutionStats();
117 void InitializeWorkingLP();
121 void L1DistanceMinimize();
125 void MaybePushToRepo();
130 double GetVariableValueAtCpScale(glop::ColIndex
var);
133 using LinearExpression = std::vector<std::pair<glop::ColIndex, IntegerValue>>;
137 glop::ColIndex GetOrCreateMirrorVariable(IntegerVariable positive_variable);
140 void UpdateBoundsOfLpVariables();
145 static const double kCpEpsilon;
149 struct LinearConstraintInternal {
154 LinearExpression integer_objective_;
155 IntegerValue objective_infinity_norm_ = IntegerValue(0);
156 double objective_normalization_factor_ = 0.0;
157 double mixing_factor_ = 1.0;
160 int model_vars_size_ = 0;
177 std::vector<IntegerVariable> integer_variables_;
178 absl::flat_hash_map<IntegerVariable, glop::ColIndex> mirror_lp_variable_;
181 std::vector<bool> var_is_binary_;
186 std::vector<int> var_up_locks_;
187 std::vector<int> var_down_locks_;
191 bool objective_is_defined_ =
false;
194 const SatParameters& sat_parameters_;
196 IntegerTrail* integer_trail_;
198 IntegerEncoder* integer_encoder_;
199 SharedIncompleteSolutionManager* incomplete_solutions_;
200 SatSolver* sat_solver_;
201 IntegerDomains* domains_;
202 const CpModelMapping* mapping_;
205 bool lp_solution_is_set_ =
false;
206 bool lp_solution_is_integer_ =
false;
207 double lp_objective_;
208 std::vector<double> lp_solution_;
209 std::vector<double> best_lp_solution_;
211 double lp_solution_fractionality_;
214 bool integer_solution_is_set_ =
false;
215 bool integer_solution_is_feasible_ =
false;
216 int64 integer_solution_objective_;
217 std::vector<int64> integer_solution_;
218 std::vector<int64> best_integer_solution_;
219 int num_infeasible_constraints_;
221 int64 integer_solution_infeasibility_;
225 int64 total_num_simplex_iterations_ = 0;
228 int max_fp_iterations_ = 20;
230 bool model_is_unsat_ =
false;
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
bool HasIntegerSolution() const
double LPSolutionFractionality() const
int64 IntegerSolutionObjectiveValue() const
void SetMaxFPIterations(int max_iter)
FeasibilityPump(Model *model)
double LPSolutionObjectiveValue() const
glop::RowIndex ConstraintIndex
double GetLPSolutionValue(IntegerVariable variable) const
int64 GetIntegerSolutionValue(IntegerVariable variable) const
void AddLinearConstraint(const LinearConstraint &ct)
bool IntegerSolutionIsFeasible() const
bool HasLPSolution() const
void SetObjectiveCoefficient(IntegerVariable ivar, IntegerValue coeff)
bool LPSolutionIsInteger() const
Class that owns everything related to a particular optimization model.
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...