C++ Reference: class LinearConstraintManager
Note: This documentation is automatically generated.
This class holds a list of globally valid linear constraints and has some logic to decide which one should be part of the LP relaxation. We want more for a better relaxation, but for efficiency we do not want to have too much constraints while solving the LP.This class is meant to contain all the initial constraints of the LP relaxation and to get new cuts as they are generated. Thus, it can both manage cuts but also only add the initial constraints lazily if there is too many of them.
Method | |
---|---|
Add | Return type: Arguments: |
AddAllConstraintsToLp | Return type: This can be called initially to add all the current constraint to the LP returned by GetLp(). |
AddCut | Return type: Arguments: Same as Add(), but logs some information about the newly added constraint. Cuts are also handled slightly differently than normal constraints. Returns true if a new cut was added and false if this cut is not efficacious or if it is a duplicate of an already existing one. |
AllConstraints | Return type: All the constraints managed by this class. |
ChangeLp | Return type: Arguments: Heuristic to decides what LP is best solved next. The given lp_solution should usually be the optimal solution of the LP returned by GetLp() before this call, but is just used as an heuristic. The current solution state is used for detecting inactive constraints. It is also updated correctly on constraint deletion/addition so that the simplex can be fully iterative on restart by loading this modified state. Returns true iff LpConstraints() will return a different LP than before. |
DebugCheckConstraint | Return type: Arguments: If a debug solution has been loaded, this checks if the given constaint cut it or not. Returns true iff everything is fine and the cut does not violate the loaded solution. |
DEFINE_STRONG_INDEX_TYPE | Arguments: Add a new constraint to the manager. Note that we canonicalize constraints and merge the bounds of constraints with the same terms. We also perform basic preprocessing. If added is given, it will be set to true if this constraint was actually a new one and to false if it was dominated by an already existing one. |
LinearConstraintManager | Return type: Arguments: |
LpConstraints | Return type: The set of constraints indices in AllConstraints() that should be part of the next LP to solve. |
num_coeff_strenghtening | Return type: |
num_cuts | Return type: |
num_shortened_constraints | Return type: |
SetObjectiveCoefficient | Return type: Arguments: The objective is used as one of the criterion to score cuts. The more a cut is parallel to the objective, the better its score is. Currently this should only be called once per IntegerVariable (Checked). It is easy to support dynamic modification if it becomes needed. |
Statistics | Return type: Returns statistics on the cut added. |