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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

§

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.

Reference manual.

Trait Implementations§

source§

impl AsCStr for VarIntAttr

source§

fn as_cstr(&self) -> &'static CStr

Represent self as a &CStr
source§

impl Clone for VarIntAttr

source§

fn clone(&self) -> VarIntAttr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VarIntAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromCStr for VarIntAttr

§

type Err = &'static str

The error type returned if parsing fails. Read more
source§

fn from_cstr(s: &CStr) -> Result<Self, Self::Err>

Parse the &CStr for an instance of Self. Read more
source§

impl Hash for VarIntAttr

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for VarIntAttr

source§

fn eq(&self, other: &VarIntAttr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for VarIntAttr

source§

impl Eq for VarIntAttr

source§

impl StructuralPartialEq for VarIntAttr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<A> ObjAttrGet<<A as ObjAttr>::Obj, i32> for A
where A: IntAttr + ObjAttr + AsCStr,

source§

fn get(&self, model: &Model, idx: i32) -> Result<i32, Error>

Get the value for this attribute
source§

fn get_batch<I>(&self, model: &Model, inds: I) -> Result<Vec<i32>, Error>
where I: IntoIterator<Item = Result<i32, Error>>,

Get multiple values for this attribute at once
source§

impl<A> ObjAttrSet<<A as ObjAttr>::Obj, i32> for A
where A: IntAttr + ObjAttr + AsCStr,

source§

fn set(&self, model: &Model, idx: i32, val: i32) -> Result<(), Error>

Set the value for this attribute
source§

fn set_batch<I>(&self, model: &Model, idx_val_pairs: I) -> Result<(), Error>
where I: IntoIterator<Item = (Result<i32, Error>, i32)>,

Set multiple values for this attribute at once
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.