OR-Tools  8.0
linear_programming_constraint.h
Go to the documentation of this file.
1 // Copyright 2010-2018 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #ifndef OR_TOOLS_SAT_LINEAR_PROGRAMMING_CONSTRAINT_H_
15 #define OR_TOOLS_SAT_LINEAR_PROGRAMMING_CONSTRAINT_H_
16 
17 #include <limits>
18 #include <utility>
19 #include <vector>
20 
21 #include "absl/container/flat_hash_map.h"
22 #include "ortools/base/int_type.h"
27 #include "ortools/sat/cuts.h"
29 #include "ortools/sat/integer.h"
33 #include "ortools/sat/model.h"
34 #include "ortools/sat/util.h"
35 #include "ortools/util/rev.h"
37 
38 namespace operations_research {
39 namespace sat {
40 
41 // Stores for each IntegerVariable its temporary LP solution.
42 //
43 // This is shared between all LinearProgrammingConstraint because in the corner
44 // case where we have many different LinearProgrammingConstraint and a lot of
45 // variable, we could theoretically use up a quadratic amount of memory
46 // otherwise.
47 //
48 // TODO(user): find a better way?
50  : public gtl::ITIVector<IntegerVariable, double> {
52 };
53 
54 // Helper struct to combine info generated from solving LP.
55 struct LPSolveInfo {
57  double lp_objective = -std::numeric_limits<double>::infinity();
59 };
60 
61 // A SAT constraint that enforces a set of linear inequality constraints on
62 // integer variables using an LP solver.
63 //
64 // The propagator uses glop's revised simplex for feasibility and propagation.
65 // It uses the Reduced Cost Strengthening technique, a classic in mixed integer
66 // programming, for instance see the thesis of Tobias Achterberg,
67 // "Constraint Integer Programming", sections 7.7 and 8.8, algorithm 7.11.
68 // http://nbn-resolving.de/urn:nbn:de:0297-zib-11129
69 //
70 // Per-constraint bounds propagation is NOT done by this constraint,
71 // it should be done by redundant constraints, as reduced cost propagation
72 // may miss some filtering.
73 //
74 // Note that this constraint works with double floating-point numbers, so one
75 // could be worried that it may filter too much in case of precision issues.
76 // However, by default, we interpret the LP result by recomputing everything
77 // in integer arithmetic, so we are exact.
81  public:
82  typedef glop::RowIndex ConstraintIndex;
83 
86 
87  // Add a new linear constraint to this LP.
89 
90  // Set the coefficient of the variable in the objective. Calling it twice will
91  // overwrite the previous value.
92  void SetObjectiveCoefficient(IntegerVariable ivar, IntegerValue coeff);
93 
94  // The main objective variable should be equal to the linear sum of
95  // the arguments passed to SetObjectiveCoefficient().
96  void SetMainObjectiveVariable(IntegerVariable ivar) { objective_cp_ = ivar; }
97 
98  // Register a new cut generator with this constraint.
99  void AddCutGenerator(CutGenerator generator);
100 
101  // Returns the LP value and reduced cost of a variable in the current
102  // solution. These functions should only be called when HasSolution() is true.
103  //
104  // Note that this solution is always an OPTIMAL solution of an LP above or
105  // at the current decision level. We "erase" it when we backtrack over it.
106  bool HasSolution() const { return lp_solution_is_set_; }
107  double SolutionObjectiveValue() const { return lp_objective_; }
108  double GetSolutionValue(IntegerVariable variable) const;
109  double GetSolutionReducedCost(IntegerVariable variable) const;
110  bool SolutionIsInteger() const { return lp_solution_is_integer_; }
111 
112  // PropagatorInterface API.
113  bool Propagate() override;
114  bool IncrementalPropagate(const std::vector<int>& watch_indices) override;
115  void RegisterWith(Model* model);
116 
117  // ReversibleInterface API.
118  void SetLevel(int level) override;
119 
120  int NumVariables() const { return integer_variables_.size(); }
121  const std::vector<IntegerVariable>& integer_variables() const {
122  return integer_variables_;
123  }
124  std::string DimensionString() const { return lp_data_.GetDimensionString(); }
125 
126  // Returns a LiteralIndex guided by the underlying LP constraints.
127  // This looks at all unassigned 0-1 variables, takes the one with
128  // a support value closest to 0.5, and tries to assign it to 1.
129  // If all 0-1 variables have an integer support, returns kNoLiteralIndex.
130  // Tie-breaking is done using the variable natural order.
131  //
132  // TODO(user): This fixes to 1, but for some problems fixing to 0
133  // or to the std::round(support value) might work better. When this is the
134  // case, change behaviour automatically?
135  std::function<LiteralIndex()> HeuristicLPMostInfeasibleBinary(Model* model);
136 
137  // Returns a LiteralIndex guided by the underlying LP constraints.
138  // This computes the mean of reduced costs over successive calls,
139  // and tries to fix the variable which has the highest reduced cost.
140  // Tie-breaking is done using the variable natural order.
141  // Only works for 0/1 variables.
142  //
143  // TODO(user): Try to get better pseudocosts than averaging every time
144  // the heuristic is called. MIP solvers initialize this with strong branching,
145  // then keep track of the pseudocosts when doing tree search. Also, this
146  // version only branches on var >= 1 and keeps track of reduced costs from var
147  // = 1 to var = 0. This works better than the conventional MIP where the
148  // chosen variable will be argmax_var min(pseudocost_var(0->1),
149  // pseudocost_var(1->0)), probably because we are doing DFS search where MIP
150  // does BFS. This might depend on the model, more trials are necessary. We
151  // could also do exponential smoothing instead of decaying every N calls, i.e.
152  // pseudo = a * pseudo + (1-a) reduced.
153  std::function<LiteralIndex()> HeuristicLPPseudoCostBinary(Model* model);
154 
155  // Returns a LiteralIndex guided by the underlying LP constraints.
156  // This computes the mean of reduced costs over successive calls,
157  // and tries to fix the variable which has the highest reduced cost.
158  // Tie-breaking is done using the variable natural order.
159  std::function<LiteralIndex()> LPReducedCostAverageBranching();
160 
161  // Average number of nonbasic variables with zero reduced costs.
162  double average_degeneracy() const {
163  return average_degeneracy_.CurrentAverage();
164  }
165 
166  private:
167  // Helper methods for branching. Returns true if branching on the given
168  // variable helps with more propagation or finds a conflict.
169  bool BranchOnVar(IntegerVariable var);
170  LPSolveInfo SolveLpForBranching();
171 
172  // Helper method to fill reduced cost / dual ray reason in 'integer_reason'.
173  // Generates a set of IntegerLiterals explaining why the best solution can not
174  // be improved using reduced costs. This is used to generate explanations for
175  // both infeasibility and bounds deductions.
176  void FillReducedCostReasonIn(const glop::DenseRow& reduced_costs,
177  std::vector<IntegerLiteral>* integer_reason);
178 
179  // Reinitialize the LP from a potentially new set of constraints.
180  // This fills all data structure and properly rescale the underlying LP.
181  //
182  // Returns false if the problem is UNSAT (it can happen when presolve is off
183  // and some LP constraint are trivially false).
184  bool CreateLpFromConstraintManager();
185 
186  // Solve the LP, returns false if something went wrong in the LP solver.
187  bool SolveLp();
188 
189  // Add a "MIR" cut obtained by first taking the linear combination of the
190  // row of the matrix according to "integer_multipliers" and then trying
191  // some integer rounding heuristic.
192  //
193  // Return true if a new cut was added to the cut manager.
194  bool AddCutFromConstraints(
195  const std::string& name,
196  const std::vector<std::pair<glop::RowIndex, IntegerValue>>&
197  integer_multipliers);
198 
199  // Computes and adds Chvatal-Gomory cuts.
200  // This can currently only be called at the root node.
201  void AddCGCuts();
202 
203  // Computes and adds MIR cuts.
204  // This can currently only be called at the root node.
205  void AddMirCuts();
206 
207  // Updates the bounds of the LP variables from the CP bounds.
208  void UpdateBoundsOfLpVariables();
209 
210  // Use the dual optimal lp values to compute an EXACT lower bound on the
211  // objective. Fills its reason and perform reduced cost strenghtening.
212  // Returns false in case of conflict.
213  bool ExactLpReasonning();
214 
215  // Same as FillDualRayReason() but perform the computation EXACTLY. Returns
216  // false in the case that the problem is not provably infeasible with exact
217  // computations, true otherwise.
218  bool FillExactDualRayReason();
219 
220  // Returns number of non basic variables with zero reduced costs.
221  int64 CalculateDegeneracy();
222 
223  // From a set of row multipliers (at LP scale), scale them back to the CP
224  // world and then make them integer (eventually multiplying them by a new
225  // scaling factor returned in *scaling).
226  //
227  // Note that this will loose some precision, but our subsequent computation
228  // will still be exact as it will work for any set of multiplier.
229  std::vector<std::pair<glop::RowIndex, IntegerValue>> ScaleLpMultiplier(
230  bool take_objective_into_account,
231  const glop::DenseColumn& dense_lp_multipliers, glop::Fractional* scaling,
232  int max_pow = 62) const;
233 
234  // Computes from an integer linear combination of the integer rows of the LP a
235  // new constraint of the form "sum terms <= upper_bound". All computation are
236  // exact here.
237  //
238  // Returns false if we encountered any integer overflow.
239  bool ComputeNewLinearConstraint(
240  const std::vector<std::pair<glop::RowIndex, IntegerValue>>&
241  integer_multipliers,
243  IntegerValue* upper_bound) const;
244 
245  // Simple heuristic to try to minimize |upper_bound - ImpliedLB(terms)|. This
246  // should make the new constraint tighter and correct a bit the imprecision
247  // introduced by rounding the floating points values.
248  void AdjustNewLinearConstraint(
249  std::vector<std::pair<glop::RowIndex, IntegerValue>>* integer_multipliers,
251  IntegerValue* upper_bound) const;
252 
253  // Shortcut for an integer linear expression type.
254  using LinearExpression = std::vector<std::pair<glop::ColIndex, IntegerValue>>;
255 
256  // Converts a dense represenation of a linear constraint to a sparse one
257  // expressed in terms of IntegerVariable.
258  void ConvertToLinearConstraint(
260  IntegerValue upper_bound, LinearConstraint* result);
261 
262  // Compute the implied lower bound of the given linear expression using the
263  // current variable bound. Return kMinIntegerValue in case of overflow.
264  IntegerValue GetImpliedLowerBound(const LinearConstraint& terms) const;
265 
266  // Tests for possible overflow in the propagation of the given linear
267  // constraint.
268  bool PossibleOverflow(const LinearConstraint& constraint);
269 
270  // Reduce the coefficient of the constraint so that we cannot have overflow
271  // in the propagation of the given linear constraint. Note that we may loose
272  // some strength by doing so.
273  //
274  // We make sure that any partial sum involving any variable value in their
275  // domain do not exceed 2 ^ max_pow.
276  void PreventOverflow(LinearConstraint* constraint, int max_pow = 62);
277 
278  // Fills integer_reason_ with the reason for the implied lower bound of the
279  // given linear expression. We relax the reason if we have some slack.
280  void SetImpliedLowerBoundReason(const LinearConstraint& terms,
281  IntegerValue slack);
282 
283  // Fills the deductions vector with reduced cost deductions that can be made
284  // from the current state of the LP solver. The given delta should be the
285  // difference between the cp objective upper bound and lower bound given by
286  // the lp.
287  void ReducedCostStrengtheningDeductions(double cp_objective_delta);
288 
289  // Returns the variable value on the same scale as the CP variable value.
290  glop::Fractional GetVariableValueAtCpScale(glop::ColIndex var);
291 
292  // Gets or creates an LP variable that mirrors a CP variable.
293  // The variable should be a positive reference.
294  glop::ColIndex GetOrCreateMirrorVariable(IntegerVariable positive_variable);
295 
296  // This must be called on an OPTIMAL LP and will update the data for
297  // LPReducedCostAverageDecision().
298  void UpdateAverageReducedCosts();
299 
300  // Callback underlying LPReducedCostAverageBranching().
301  LiteralIndex LPReducedCostAverageDecision();
302 
303  // Updates the simplex iteration limit for the next visit.
304  // As per current algorithm, we use a limit which is dependent on size of the
305  // problem and drop it significantly if degeneracy is detected. We use
306  // DUAL_FEASIBLE status as a signal to correct the prediction. The next limit
307  // is capped by 'min_iter' and 'max_iter'. Note that this is enabled only for
308  // linearization level 2 and above.
309  void UpdateSimplexIterationLimit(const int64 min_iter, const int64 max_iter);
310 
311  // This epsilon is related to the precision of the value/reduced_cost returned
312  // by the LP once they have been scaled back into the CP domain. So for large
313  // domain or cost coefficient, we may have some issues.
314  static const double kCpEpsilon;
315 
316  // Same but at the LP scale.
317  static const double kLpEpsilon;
318 
319  // Class responsible for managing all possible constraints that may be part
320  // of the LP.
321  LinearConstraintManager constraint_manager_;
322 
323  // Initial problem in integer form.
324  // We always sort the inner vectors by increasing glop::ColIndex.
325  struct LinearConstraintInternal {
326  IntegerValue lb;
327  IntegerValue ub;
328  LinearExpression terms;
329  };
330  LinearExpression integer_objective_;
331  IntegerValue objective_infinity_norm_ = IntegerValue(0);
334 
335  // Underlying LP solver API.
336  glop::LinearProgram lp_data_;
337  glop::RevisedSimplex simplex_;
338  int64 next_simplex_iter_ = 500;
339 
340  // For the scaling.
341  glop::LpScalingHelper scaler_;
342 
343  // Temporary data for cuts.
344  IntegerRoundingCutHelper integer_rounding_cut_helper_;
345  LinearConstraint cut_;
347  std::vector<double> tmp_lp_values_;
348  std::vector<IntegerValue> tmp_var_lbs_;
349  std::vector<IntegerValue> tmp_var_ubs_;
350  std::vector<glop::RowIndex> tmp_slack_rows_;
351  std::vector<IntegerValue> tmp_slack_bounds_;
352 
353  // Structures used for mirroring IntegerVariables inside the underlying LP
354  // solver: an integer variable var is mirrored by mirror_lp_variable_[var].
355  // Note that these indices are dense in [0, mirror_lp_variable_.size()] so
356  // they can be used as vector indices.
357  std::vector<IntegerVariable> integer_variables_;
358  absl::flat_hash_map<IntegerVariable, glop::ColIndex> mirror_lp_variable_;
359 
360  // We need to remember what to optimize if an objective is given, because
361  // then we will switch the objective between feasibility and optimization.
362  bool objective_is_defined_ = false;
363  IntegerVariable objective_cp_;
364 
365  // Singletons from Model.
366  const SatParameters& sat_parameters_;
367  Model* model_;
368  TimeLimit* time_limit_;
369  IntegerTrail* integer_trail_;
370  Trail* trail_;
371  SearchHeuristicsVector* model_heuristics_;
372  IntegerEncoder* integer_encoder_;
373  ModelRandomGenerator* random_;
374 
375  // Used while deriving cuts.
376  ImpliedBoundsProcessor implied_bounds_processor_;
377 
378  // The dispatcher for all LP propagators of the model, allows to find which
379  // LinearProgrammingConstraint has a given IntegerVariable.
380  LinearProgrammingDispatcher* dispatcher_;
381 
382  std::vector<IntegerLiteral> integer_reason_;
383  std::vector<IntegerLiteral> deductions_;
384  std::vector<IntegerLiteral> deductions_reason_;
385 
386  // Repository of IntegerSumLE that needs to be kept around for the lazy
387  // reasons. Those are new integer constraint that are created each time we
388  // solve the LP to a dual-feasible solution. Propagating these constraints
389  // both improve the objective lower bound but also perform reduced cost
390  // fixing.
391  int rev_optimal_constraints_size_ = 0;
392  std::vector<std::unique_ptr<IntegerSumLE>> optimal_constraints_;
393 
394  // Last OPTIMAL solution found by a call to the underlying LP solver.
395  // On IncrementalPropagate(), if the bound updates do not invalidate this
396  // solution, Propagate() will not find domain reductions, no need to call it.
397  int lp_solution_level_ = 0;
398  bool lp_solution_is_set_ = false;
399  bool lp_solution_is_integer_ = false;
400  double lp_objective_;
401  std::vector<double> lp_solution_;
402  std::vector<double> lp_reduced_cost_;
403 
404  // If non-empty, this is the last known optimal lp solution at root-node. If
405  // the variable bounds changed, or cuts where added, it is possible that this
406  // solution is no longer optimal though.
407  std::vector<double> level_zero_lp_solution_;
408 
409  // True if the last time we solved the exact same LP at level zero, no cuts
410  // and no lazy constraints where added.
411  bool lp_at_level_zero_is_final_ = false;
412 
413  // Same as lp_solution_ but this vector is indexed differently.
414  LinearProgrammingConstraintLpSolution& expanded_lp_solution_;
415 
416  // Linear constraints cannot be created or modified after this is registered.
417  bool lp_constraint_is_registered_ = false;
418 
419  std::vector<CutGenerator> cut_generators_;
420 
421  // Store some statistics for HeuristicLPReducedCostAverage().
422  bool compute_reduced_cost_averages_ = false;
423  int num_calls_since_reduced_cost_averages_reset_ = 0;
424  std::vector<double> sum_cost_up_;
425  std::vector<double> sum_cost_down_;
426  std::vector<int> num_cost_up_;
427  std::vector<int> num_cost_down_;
428  std::vector<double> rc_scores_;
429 
430  // All the entries before rev_rc_start_ in the sorted positions correspond
431  // to fixed variables and can be ignored.
432  int rev_rc_start_ = 0;
433  RevRepository<int> rc_rev_int_repository_;
434  std::vector<std::pair<double, int>> positions_by_decreasing_rc_score_;
435 
436  // Defined as average number of nonbasic variables with zero reduced costs.
437  IncrementalAverage average_degeneracy_;
438  bool is_degenerate_ = false;
439 
440  // Used by the strong branching heuristic.
441  int branching_frequency_ = 1;
442  int64 count_since_last_branching_ = 0;
443 
444  // Sum of all simplex iterations performed by this class. This is useful to
445  // test the incrementality and compare to other solvers.
446  int64 total_num_simplex_iterations_ = 0;
447 };
448 
449 // A class that stores which LP propagator is associated to each variable.
450 // We need to give the hash_map a name so it can be used as a singleton in our
451 // model.
452 //
453 // Important: only positive variable do appear here.
455  : public absl::flat_hash_map<IntegerVariable,
456  LinearProgrammingConstraint*> {
457  public:
459 };
460 
461 // A class that stores the collection of all LP constraints in a model.
463  : public std::vector<LinearProgrammingConstraint*> {
464  public:
466 };
467 
468 // Cut generator for the circuit constraint, where in any feasible solution, the
469 // arcs that are present (variable at 1) must form a circuit through all the
470 // nodes of the graph. Self arc are forbidden in this case.
471 //
472 // In more generality, this currently enforce the resulting graph to be strongly
473 // connected. Note that we already assume basic constraint to be in the lp, so
474 // we do not add any cuts for components of size 1.
476  int num_nodes, const std::vector<int>& tails, const std::vector<int>& heads,
477  const std::vector<Literal>& literals, Model* model);
478 
479 // Almost the same as CreateStronglyConnectedGraphCutGenerator() but for each
480 // components, computes the demand needed to serves it, and depending on whether
481 // it contains the depot (node zero) or not, compute the minimum number of
482 // vehicle that needs to cross the component border.
483 CutGenerator CreateCVRPCutGenerator(int num_nodes,
484  const std::vector<int>& tails,
485  const std::vector<int>& heads,
486  const std::vector<Literal>& literals,
487  const std::vector<int64>& demands,
488  int64 capacity, Model* model);
489 } // namespace sat
490 } // namespace operations_research
491 
492 #endif // OR_TOOLS_SAT_LINEAR_PROGRAMMING_CONSTRAINT_H_
var
IntVar * var
Definition: expr_array.cc:1858
operations_research::sat::LinearProgrammingConstraint::RegisterWith
void RegisterWith(Model *model)
Definition: linear_programming_constraint.cc:378
operations_research::sat::LinearProgrammingConstraint::HeuristicLPMostInfeasibleBinary
std::function< LiteralIndex()> HeuristicLPMostInfeasibleBinary(Model *model)
Definition: linear_programming_constraint.cc:2357
operations_research::sat::LPSolveInfo::new_obj_bound
IntegerValue new_obj_bound
Definition: linear_programming_constraint.h:58
time_limit.h
operations_research::sat::LinearProgrammingConstraintLpSolution::LinearProgrammingConstraintLpSolution
LinearProgrammingConstraintLpSolution()
Definition: linear_programming_constraint.h:51
operations_research::sat::LinearProgrammingConstraint::SetObjectiveCoefficient
void SetObjectiveCoefficient(IntegerVariable ivar, IntegerValue coeff)
Definition: linear_programming_constraint.cc:125
operations_research::glop::StrictITIVector< ColIndex, Fractional >
lp_data.h
operations_research::sat::CreateStronglyConnectedGraphCutGenerator
CutGenerator CreateStronglyConnectedGraphCutGenerator(int num_nodes, const std::vector< int > &tails, const std::vector< int > &heads, const std::vector< Literal > &literals, Model *model)
Definition: linear_programming_constraint.cc:2321
linear_constraint.h
operations_research::sat::LPSolveInfo::status
glop::ProblemStatus status
Definition: linear_programming_constraint.h:56
operations_research::sat::PropagatorInterface
Definition: integer.h:1008
operations_research::sat::LinearProgrammingConstraintCollection
Definition: linear_programming_constraint.h:463
operations_research::sat::LinearProgrammingConstraintLpSolution
Definition: linear_programming_constraint.h:50
operations_research::sat::LinearProgrammingDispatcher
Definition: linear_programming_constraint.h:456
operations_research::sat::LinearProgrammingConstraint::average_degeneracy
double average_degeneracy() const
Definition: linear_programming_constraint.h:162
operations_research::sat::LinearExpression
Definition: linear_constraint.h:165
operations_research::sat::LinearProgrammingConstraint::AddLinearConstraint
void AddLinearConstraint(const LinearConstraint &ct)
Definition: linear_programming_constraint.cc:87
model.h
operations_research::Trail
Definition: constraint_solver.cc:716
operations_research::sat::LinearProgrammingConstraint::SolutionObjectiveValue
double SolutionObjectiveValue() const
Definition: linear_programming_constraint.h:107
operations_research::sat::LinearProgrammingConstraint::integer_variables
const std::vector< IntegerVariable > & integer_variables() const
Definition: linear_programming_constraint.h:121
operations_research
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
Definition: dense_doubly_linked_list.h:21
operations_research::sat::LinearProgrammingConstraint::IncrementalPropagate
bool IncrementalPropagate(const std::vector< int > &watch_indices) override
Definition: linear_programming_constraint.cc:450
operations_research::glop::LinearProgram
Definition: lp_data.h:55
operations_research::RevRepository< int >
int64
int64_t int64
Definition: integral_types.h:34
operations_research::sat::LinearProgrammingConstraint::DimensionString
std::string DimensionString() const
Definition: linear_programming_constraint.h:124
operations_research::sat::LPSolveInfo
Definition: linear_programming_constraint.h:55
operations_research::sat::Model
Class that owns everything related to a particular optimization model.
Definition: sat/model.h:38
operations_research::sat::LinearProgrammingConstraint::GetSolutionValue
double GetSolutionValue(IntegerVariable variable) const
Definition: linear_programming_constraint.cc:487
revised_simplex.h
operations_research::glop::Fractional
double Fractional
Definition: lp_types.h:77
operations_research::sat::LinearProgrammingConstraintCollection::LinearProgrammingConstraintCollection
LinearProgrammingConstraintCollection()
Definition: linear_programming_constraint.h:465
operations_research::sat::LinearProgrammingConstraint::NumVariables
int NumVariables() const
Definition: linear_programming_constraint.h:120
operations_research::glop::LinearProgram::GetDimensionString
std::string GetDimensionString() const
Definition: lp_data.cc:423
operations_research::sat::LinearProgrammingConstraint::LinearProgrammingConstraint
LinearProgrammingConstraint(Model *model)
Definition: linear_programming_constraint.cc:54
operations_research::sat::LinearConstraint
Definition: linear_constraint.h:39
lp_data_utils.h
operations_research::sat::LinearProgrammingConstraint::LPReducedCostAverageBranching
std::function< LiteralIndex()> LPReducedCostAverageBranching()
Definition: linear_programming_constraint.cc:2566
int_type.h
operations_research::TimeLimit
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
Definition: time_limit.h:105
integer_expr.h
operations_research::glop::RevisedSimplex
Definition: revised_simplex.h:147
operations_research::ReversibleInterface
Definition: rev.h:29
operations_research::sat::LinearProgrammingDispatcher::LinearProgrammingDispatcher
LinearProgrammingDispatcher(Model *model)
Definition: linear_programming_constraint.h:458
operations_research::sat::LPSolveInfo::lp_objective
double lp_objective
Definition: linear_programming_constraint.h:57
operations_research::sat::LinearProgrammingConstraint::GetSolutionReducedCost
double GetSolutionReducedCost(IntegerVariable variable) const
Definition: linear_programming_constraint.cc:492
operations_research::sat::LinearProgrammingConstraint::~LinearProgrammingConstraint
~LinearProgrammingConstraint() override
Definition: linear_programming_constraint.cc:82
operations_research::glop::LpScalingHelper
Definition: lp_data_utils.h:51
ct
const Constraint * ct
Definition: demon_profiler.cc:42
operations_research::sat::IncrementalAverage::CurrentAverage
double CurrentAverage() const
Definition: sat/util.h:113
operations_research::sat::LinearProgrammingConstraint::SetLevel
void SetLevel(int level) override
Definition: linear_programming_constraint.cc:420
operations_research::sat::LinearConstraintManager
Definition: linear_constraint_manager.h:40
implied_bounds.h
rev.h
model
GRBmodel * model
Definition: gurobi_interface.cc:195
operations_research::sat::LinearProgrammingConstraint::AddCutGenerator
void AddCutGenerator(CutGenerator generator)
Definition: linear_programming_constraint.cc:443
operations_research::sat::kMinIntegerValue
constexpr IntegerValue kMinIntegerValue(-kMaxIntegerValue)
util.h
linear_constraint_manager.h
operations_research::glop::ProblemStatus
ProblemStatus
Definition: lp_types.h:101
operations_research::sat::LinearProgrammingConstraint::SetMainObjectiveVariable
void SetMainObjectiveVariable(IntegerVariable ivar)
Definition: linear_programming_constraint.h:96
operations_research::sat::LinearProgrammingConstraint::Propagate
bool Propagate() override
Definition: linear_programming_constraint.cc:1171
gtl::ITIVector
Definition: int_type_indexed_vector.h:76
capacity
int64 capacity
Definition: routing_flow.cc:129
operations_research::sat::CutGenerator
Definition: cuts.h:40
operations_research::sat::LinearProgrammingConstraint
Definition: linear_programming_constraint.h:80
operations_research::sat::LinearProgrammingConstraint::ConstraintIndex
glop::RowIndex ConstraintIndex
Definition: linear_programming_constraint.h:82
operations_research::sat::CreateCVRPCutGenerator
CutGenerator CreateCVRPCutGenerator(int num_nodes, const std::vector< int > &tails, const std::vector< int > &heads, const std::vector< Literal > &literals, const std::vector< int64 > &demands, int64 capacity, Model *model)
Definition: linear_programming_constraint.cc:2337
operations_research::sat::LinearProgrammingConstraint::HasSolution
bool HasSolution() const
Definition: linear_programming_constraint.h:106
operations_research::sat::LinearProgrammingConstraint::SolutionIsInteger
bool SolutionIsInteger() const
Definition: linear_programming_constraint.h:110
operations_research::sat::LinearProgrammingConstraint::HeuristicLPPseudoCostBinary
std::function< LiteralIndex()> HeuristicLPPseudoCostBinary(Model *model)
Definition: linear_programming_constraint.cc:2408
lp_types.h
cuts.h
integer.h
name
const std::string name
Definition: default_search.cc:807