Enum grb::attribute::VarIntAttr
source · pub enum VarIntAttr {
BranchPriority,
IISLB,
IISUB,
PWLObjCvx,
Partition,
VBasis,
VarHintPri,
IISLBForce,
IISUBForce,
PoolIgnore,
}
Variants§
BranchPriority
- Modifiable: Yes
- Type: integer (
i32
)
Variable branching priority. The value of this attribute is used as the primary criterion for selecting a fractional variable for branching during the MIP search. Variables with larger values always take priority over those with smaller values. Ties are broken using the standard branch variable selection criteria. The default variable branch priority value is zero.
Note that deleting variables from your model will cause several attributes to be discarded (variable hints and branch priorities). If you’d like them to persist, your program will need to repopulate them after deleting the variables and making a subsequent model update call.
Only affects MIP models.
IISLB
- Modifiable: No
- Type: integer (
i32
)
For an infeasible model, indicates whether the lower bound participates in the computed Irreducible Inconsistent Subsystem (IIS). Note that the bounds for a binary variable are considered to be implicit in the variable type and will never participate in an IIS.
Only available after you have computed an IIS.
IISUB
- Modifiable: No
- Type: integer (
i32
)
For an infeasible model, indicates whether the upper bound participates in the computed Irreducible Inconsistent Subsystem (IIS). Note that the bounds for a binary variable are considered to be implicit in the variable type and will never participate in an IIS.
Only available after you have computed an IIS.
PWLObjCvx
- Modifiable: No
- Type: integer (
i32
)
Indicates whether a variable has a convex piecewise-linear objective. Returns 0 if the piecewise-linear objective function on the variable is non-convex. Returns 1 if the function is convex, or if the objective function on the variable is linear.
This attribute is useful for isolating the particular variable that caused a continuous model with a piecewise-linear objective function to become a MIP.
Partition
- Modifiable: Yes
- Type: integer (
i32
)
Variable partition. The MIP solver can perform a solution improvement heuristic using user-provided partition information. The provided partition number can be positive, which indicates that the variable should be included when the correspondingly numbered sub-MIP is solved, 0 which indicates that the variable should be included in every sub-MIP, or -1 which indicates that the variable should not be included in any sub-MIP. Variables that are not included in the sub-MIP are fixed to their values in the current incumbent solution. By default, all variables start with a value of -1.
To give an example, imagine you are solving a model with 400 variables and you set the partition attribute to -1 for variables 0-99, 0 for variables 100-199, 1 for variables 200-299, and 2 for variables 300-399. The heuristic would solve two sub-MIP models: sub-MIP 1 would fix variables 0-99 and 300-399 to their values in the incumbent and solve for the rest, while sub-MIP 2 would fix variables 0-99 and 200-299.
Use the PartitionPlace parameter to control where the partition heuristic runs.
Only affects MIP models.
VBasis
- Modifiable: Yes
- Type: integer (
i32
)
The status of a given variable in the current basis. Possible values are 0 (basic), -1 (non-basic at lower bound), -2 (non-basic at upper bound), and -3 (super-basic). Note that, if you wish to specify an advanced starting basis, you must set basis status information for all constraints and variables in the model. Only available for basic solutions.
Note that if you provide a valid starting extreme point, either through PStart, DStart, or through VBasis, CBasis, then LP presolve will be disabled by default. For models where presolve greatly reduces the problem size, this might hurt performance. To allow presolve, it needs to set parameter LPWarmStart to 2.
VarHintPri
- Modifiable: Yes
- Type: integer (
i32
)
Priorities on user hints. After providing variable hints through the VarHintVal
attribute, you can optionally also
provide hint priorities to give an indication of your level of confidence in your hints.
Hint priorities are relative. If you are more confident in the hint value for one variable than for another, you simply need to set a larger priority value for the more solid hint. The default hint priority for a variable is 0.
Please refer to the VarHintVal
discussion for more details on the role of variable hints.
Only affects MIP models.
IISLBForce
- Modifiable: Yes
- Type: integer (
i32
)
When computing an Irreducible Inconsistent Subsytem (IIS) for an infeasible model, indicates whether the variable lower bound should be included or excluded from the IIS.
The default value of -1 lets the IIS algorithm decide.
If the attribute is set to 0, the bound is not eligible for inclusion in the IIS.
If the attribute is set to 1, the bound is included in the IIS and the IIS algorithm never considers the possibility of removing it.
Note that setting this attribute to 0 may make the resulting subsystem feasible (or consistent), which would then make it impossible to construct an IIS. Trying anyway will result in a GRB_ERROR_IIS_NOT_INFEASIBLE error. Similarly, setting this attribute to 1 may result in an IIS that is not irreducible. More precisely, the system would only be irreducible with respect to the model elements that have force values of -1 or 0.
See the Model.computeIIS documentation for more details.
IISUBForce
- Modifiable: Yes
- Type: integer (
i32
)
When computing an Irreducible Inconsistent Subsytem (IIS) for an infeasible model, indicates whether the variable upper bound should be included or excluded from the IIS.
The default value of -1 lets the IIS algorithm decide.
If the attribute is set to 0, the bound is not eligible for inclusion in the IIS.
If the attribute is set to 1, the bound is included in the IIS and the IIS algorithm never considers the possibility of removing it.
Note that setting this attribute to 0 may make the resulting subsystem feasible (or consistent), which would then make it impossible to construct an IIS. Trying anyway will result in a GRB_ERROR_IIS_NOT_INFEASIBLE error. Similarly, setting this attribute to 1 may result in an IIS that is not irreducible. More precisely, the system would only be irreducible with respect to the model elements that have force values of -1 or 0.
See the Model.computeIIS documentation for more details.
PoolIgnore
- Modifiable: Yes
- Type: integer (
i32
)
When solving a MIP model, the Gurobi Optimizer maintains a solution pool that contains the best solutions found during
the search. The PoolIgnore
attribute allows you to discard some solutions. Specifically, if multiple solutions differ
only in variables where PoolIgnore
is set to 1, only the solution with the best objective will be kept in the pool.
The default value for the attribute is 0, meaning that the variable should be used to distinguish solutions.
This attribute is particularly helpful when used in conjunction with the PoolSearchMode parameter. By identifying variables that do not capture meaningful differences between solutions, you can make sure that the pool contains some interesting variety.
Trait Implementations§
source§impl Clone for VarIntAttr
impl Clone for VarIntAttr
source§fn clone(&self) -> VarIntAttr
fn clone(&self) -> VarIntAttr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VarIntAttr
impl Debug for VarIntAttr
source§impl FromCStr for VarIntAttr
impl FromCStr for VarIntAttr
source§impl Hash for VarIntAttr
impl Hash for VarIntAttr
source§impl PartialEq for VarIntAttr
impl PartialEq for VarIntAttr
source§fn eq(&self, other: &VarIntAttr) -> bool
fn eq(&self, other: &VarIntAttr) -> bool
self
and other
values to be equal, and is used
by ==
.