Enum grb::attribute::ModelDoubleAttr [−][src]
pub enum ModelDoubleAttr {
Show 64 variants
BoundSVio,
BoundSVioSum,
BoundVio,
BoundVioSum,
ComplVio,
ComplVioSum,
ConstrResidual,
ConstrResidualSum,
ConstrSResidual,
ConstrSResidualSum,
ConstrSVio,
ConstrSVioSum,
ConstrVio,
ConstrVioSum,
DNumNZs,
DualResidual,
DualResidualSum,
DualSResidual,
DualSResidualSum,
DualSVio,
DualSVioSum,
DualVio,
DualVioSum,
FarkasProof,
IntVio,
IntVioSum,
IterCount,
Kappa,
KappaExact,
MIPGap,
MaxBound,
MaxCoeff,
MaxObjCoeff,
MaxQCCoeff,
MaxQCLCoeff,
MaxQCRHS,
MaxQObjCoeff,
MaxRHS,
MinBound,
MinCoeff,
MinObjCoeff,
MinQCCoeff,
MinQCLCoeff,
MinQCRHS,
MinQObjCoeff,
MinRHS,
NodeCount,
ObjBound,
ObjBoundC,
ObjCon,
ObjNAbsTol,
ObjNCon,
ObjNRelTol,
ObjNVal,
ObjNWeight,
ObjVal,
PoolObjBound,
PoolObjVal,
Runtime,
ScenNObjBound,
ScenNObjVal,
MaxVio,
OpenNodeCount,
Work,
}
Variants
- Modifiable: No
- Type: double (
f64
)
Maximum (scaled) bound violation.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (scaled) bound violations.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Maximum (unscaled) bound violation.
Available for all model types.
- Modifiable: No
- Type: double (
f64
)
Sum of (unscaled) bound violations.
Available for all model types.
- Modifiable: No
- Type: double (
f64
)
Maximum complementarity violation. In an optimal solution, the product of the value of a variable and its reduced cost must be zero. This isn’t always strictly true for interior point solutions. This attribute returns the maximum complementarity violation for any variable.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of complementarity violation.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Reporting constraint violations for the simplex solver is actually more complex than it may appear, due to the treatment
of slacks on linear inequality constraints. The simplex solver introduces explicit non-negative slack variables inside
the algorithm. Thus, for example, $a^Tx \le b$ becomes $a^Tx + s = b$. In this formulation, constraint errors can show
up in two places: (i) as bound violations on the computed slack variable values, and (ii) as differences between $a^Tx +
s$ and $b$. We report the former as ConstrVio
and the latter as ConstrResidual.
Only available for continuous models. For MIP models, constraint violations are reported in ConstrVio.
- Modifiable: No
- Type: double (
f64
)
Sum of (unscaled) linear constraint violations.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Maximum (scaled) primal constraint error.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (scaled) linear constraint violations.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Maximum (scaled) slack bound violation.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (scaled) slack bound violations.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Reporting constraint violations for the simplex solver is actually more complex than it may appear, due to the treatment
of slacks on linear inequality constraints. The simplex solver introduces explicit non-negative slack variables inside
the algorithm. Thus, for example, $a^Tx \le b$ becomes $a^Tx + s = b$. In this formulation, constraint errors can show
up in two places: (i) as bound violations on the computed slack variable values, and (ii) as differences between $a^Tx +
s$ and $b$. We report the former as ConstrVio
and the latter as ConstrResidual.
For MIP models, the maximum violation of the constraints, including linear, quadratic, SOS and general constraints, is reported in ConstrVio.
Available for all model types.
- Modifiable: No
- Type: double (
f64
)
Sum of (unscaled) slack bound violations.
Available for all model types.
- Modifiable: No
- Type: double (
f64
)
The number of non-zero coefficients in the linear constraints of the model. This attribute is provided in double precision format to accurately count the number of non-zeros in models that contain more than 2 billion non-zero coefficients.
- Modifiable: No
- Type: double (
f64
)
Reporting dual constraint violations for the simplex solver is actually more complex than it may appear, due to the
treatment of reduced costs for bounded variables. The simplex solver introduces explicit non-negative reduced-cost
variables inside the algorithm. Thus, $a^Ty \ge c$ becomes $a^Ty - z = c$ (where $y$ is the dual vector and $z$ is the
reduced cost). In this formulation, errors can show up in two places: (i) as bound violations on the computed reduced-
cost variable values, and (ii) as differences between $a^Ty - z$ and $c$. We report the former as DualVio
and the
latter as DualResidual.
DualResidual
reports the maximum (unscaled) dual constraint error.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (unscaled) dual constraint errors.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Maximum (scaled) dual constraint error.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (scaled) dual constraint errors.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Maximum (scaled) reduced cost violation.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (scaled) reduced cost violations.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Reporting dual constraint violations for the simplex solver is actually more complex than it may appear, due to the
treatment of reduced costs for bounded variables. The simplex solver introduces explicit non-negative reduced-cost
variables inside the algorithm. Thus, $a^Ty \ge c$ becomes $a^Ty - z = c$ (where $y$ is the dual vector and $z$ is the
reduced cost). In this formulation, errors can show up in two places: (i) as bound violations on the computed reduced-
cost variable values, and (ii) as differences between $a^Ty - z$ and $c$. We report the former as DualVio
and the
latter as DualResidual.
DualVio
reports the maximum (unscaled) reduced-cost bound violation.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Sum of (unscaled) reduced cost violations.
Only available for continuous models.
- Modifiable: No
- Type: double (
f64
)
Together, attributes FarkasDual
and FarkasProof
provide a certificate of infeasibility for the given infeasible
problem. Specifically, FarkasDual
can be used to form the following inequality from the original constraints that is
infeasible within the bounds of the variables:
$\lambda^tAx \leq \lambda^tb.$
This Farkas constraint is valid, because $\lambda_i \geq 0$ if the $i$-th constraint has a $\leq$ sense and $\lambda_i \leq 0$ if the $i$-th constraint has a $\geq$ sense.
Let
$\bar{a} := \lambda^tA$
be the coefficients of this inequality and
$\bar{b} := \lambda^tb$
be its right hand side. With $L_j$ and $U_j$ being the lower and upper bounds of the variables $x_j$ we have $\bar{a}_j \geq 0$ if $U_j = \infty$, and $\bar{a}_j \leq 0$ if $L_j = -\infty$.
The minimum violation of the Farkas constraint is achieved by setting $x^_j := L_j$ for $\bar{a}_j > 0$ and $x^_j := U_j$ for $\bar{a}_j < 0$. Then, we can calculate the minimum violation as
$\beta := \bar{a}^tx^* - \bar{b} = \sum\limits_{j:\bar{a}_j>0}\bar{a}jL_j + \sum\limits{j:\bar{a}_j<0}\bar{a}_jU_j - \bar{b}$
where $\beta>0$.
The FarkasProof
attribute provides $\beta$, and the FarkasDual
attributes provide the $\lambda$ multipliers for the
original constraints.
These attributes are only available when parameter InfUnbdInfo is set to 1.
- Modifiable: No
- Type: double (
f64
)
A MIP solver won’t always assign strictly integral values to integer variables. This attribute returns the largest distance between the computed value of any integer variable and the nearest integer.
Only available for MIP models.
- Modifiable: No
- Type: double (
f64
)
Sum of integrality violations.
Only available for MIP models.
- Modifiable: No
- Type: double (
f64
)
Number of simplex iterations performed during the most recent optimization.
- Modifiable: No
- Type: double (
f64
)
Estimated condition number for the current LP basis matrix. Only available for basic solutions.
- Modifiable: No
- Type: double (
f64
)
Exact condition number for the current LP basis matrix. Only available for basic solutions. The exact condition number
is much more expensive to compute than the estimate that you get from the Kappa
attribute. Only available for basic
solutions.
- Modifiable: No
- Type: double (
f64
)
Current relative MIP optimality gap; computed as
$\vert ObjBound-ObjVal\vert/\vert ObjVal\vert$ (where ObjBound
and ObjVal
are the MIP objective bound and incumbent
solution objective, respectively. Returns GRB_INFINITY when an incumbent solution has not yet been found, when no
objective bound is available, or when the current incumbent objective is 0.
- Modifiable: No
- Type: double (
f64
)
Maximum matrix coefficient (in absolute value) in the linear constraint matrix.
- Modifiable: No
- Type: double (
f64
)
Maximum linear objective coefficient (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Maximum coefficient in the quadratic part of all quadratic constraint matrices (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Maximum coefficient in the linear part of all quadratic constraint matrices (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Maximum (finite) quadratic constraint right-hand side value (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Maximum coefficient of the quadratic terms in the objective (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Maximum (finite) linear constraint right-hand side value (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Minimum non-zero matrix coefficient (in absolute value) in the linear constraint matrix.
- Modifiable: No
- Type: double (
f64
)
Minimum (non-zero) linear objective coefficient (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Minimum (non-zero) coefficient in the quadratic part of all quadratic constraint matrices (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Minimum (non-zero) coefficient in the linear part of all quadratic constraint matrices (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Minimum (non-zero) quadratic constraint right-hand side value (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Minimum (non-zero) coefficient of the quadratic terms in the objective (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Minimum (non-zero) linear constraint right-hand side value (in absolute value).
- Modifiable: No
- Type: double (
f64
)
Number of branch-and-cut nodes explored in the most recent optimization.
- Modifiable: No
- Type: double (
f64
)
The best known bound on the optimal objective. When solving a MIP model, the algorithm maintains both a lower bound and an upper bound on the optimal objective value. For a minimization model, the upper bound is the objective of the best known feasible solution, while the lower bound gives a bound on the best possible objective.
In contrast to ObjBoundC, this attribute takes advantage of objective integrality information to round to a tighter
bound. For example, if the objective is known to take an integral value and the current best bound is 1.5, ObjBound
will return 2.0 while ObjBoundC
will return 1.5.
- Modifiable: No
- Type: double (
f64
)
The best known bound on the optimal objective. When solving a MIP model, the algorithm maintains both a lower bound and an upper bound on the optimal objective value. For a minimization model, the upper bound is the objective of the best known feasible solution, while the lower bound gives a bound on the best possible objective.
In contrast to ObjBound, this attribute does not take advantage of objective integrality information to round to a
tighter bound. For example, if the objective is known to take an integral value and the current best bound is 1.5,
ObjBound
will return 2.0 while ObjBoundC
will return 1.5.
- Modifiable: Yes
- Type: double (
f64
)
A constant value that is added into the model objective. The default value is 0.
- Modifiable: Yes
- Type: double (
f64
)
This attribute is used to set the allowable degradation for objective $n$ when doing hierarchical multi-objective optimization. You set $n$ using the ObjNumber parameter.
Hierarchical multi-objective MIP optimization will optimize for the different objectives in the model one at a time, in priority order. If it achieves objective value $z$ when it optimizes for this objective, then subsequent steps are allowed to degrade this value by at most ObjNAbsTol.
Objective degradations are handled differently for multi-objective LP models. For LP models, solution quality for
higher-priority objectives is maintained by fixing some variables to their values in previous optimal solutions. These
fixings are decided using variable reduced costs. The value of the ObjNAbsTol
parameter indicates the amount by which
a fixed variable’s reduced cost is allowed to violate dual feasibility. The value of the related ObjNRelTol
attribute
is ignored.
The default absolute tolerance for an objective is 1e-6.
The number of objectives in the model can be queried (or modified) using the NumObj
attribute.
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
- Modifiable: Yes
- Type: double (
f64
)
When the model has multiple objectives, this attribute is used to query or modify the constant term for objective $n$.
You set $n$ using the ObjNumber parameter. Note that when ObjNumber is equal to 0, ObjNCon
is equivalent to ObjCon.
The number of objectives in the model can be queried (or modified) using the NumObj
attribute.
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
- Modifiable: Yes
- Type: double (
f64
)
This attribute is used to set the allowable degradation for objective $n$ when doing hierarchical multi-objective optimization for MIP models. You set $n$ using the ObjNumber parameter.
Hierarchical multi-objective MIP optimization will optimize for the different objectives in the model one at a time, in priority order. If it achieves objective value $z$ when it optimizes for this objective, then subsequent steps are allowed to degrade this value by at most ObjNRelTol*$\vert z\vert$.
Objective degradations are handled differently for multi-objective LP models. The allowable degradation is controlled strictly using the ObjNAbsTol.
The default relative tolerance for an objective is 0.
The number of objectives in the model can be queried (or modified) using the NumObj
attribute.
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
- Modifiable: No
- Type: double (
f64
)
This attribute is used to query the objective value obtained for objective $n$ by the $k$-th solution stored in the pool of feasible solutions found so far for the problem. You set $n$ using the ObjNumber parameter, while you set $k$ using the SolutionNumber parameter.
The number of objectives in the model can be queried (or modified) using the NumObj
attribute; while the number of
stored solutions can be queried using the SolCount
attribute.
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
- Modifiable: Yes
- Type: double (
f64
)
This attribute is used to query or modify the weight of objective $n$ when doing blended multi-objective optimization. You set $n$ using the ObjNumber parameter.
The default weight for an objective is 1.0.
The number of objectives in the model can be queried (or modified) using the NumObj
attribute.
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
- Modifiable: No
- Type: double (
f64
)
The objective value for the current solution. If the model was solved to optimality, then this attribute gives the optimal objective value.
- Modifiable: No
- Type: double (
f64
)
Bound on the objective of undiscovered MIP solutions. The MIP solver stores solutions that it finds during the MIP search, but it only provides quality guarantees for those whose objective is at least as good as PoolObjBound. Specifically, further exploration of the MIP search tree will not find solutions whose objective is better than PoolObjBound.
The difference between PoolObjBound
and ObjBound
is that the former gives an objective bound for undiscovered
solutions, while the latter gives a bound for any solution. Note that PoolObjBound
and ObjBound
can only have
different values if parameter PoolSearchMode is set to 2.
Please consult the section on Solution Pools for a more detailed discussion of this topic.
- Modifiable: No
- Type: double (
f64
)
This attribute is used to query the objective value of the $k$-th solution stored in the pool of feasible solutions found so far for the problem. You set $k$ using the SolutionNumber parameter.
The number of stored solutions can be queried using the SolCount
attribute.
Please consult the section on Solution Pools for a more detailed discussion of this topic.
- Modifiable: No
- Type: double (
f64
)
Runtime
for the most recent optimization (in seconds). Note that all times reported by the Gurobi Optimizer are wall-
clock times.
- Modifiable: No
- Type: double (
f64
)
When the model has multiple scenarios, this attribute is used to query the objective bound for scenario $n$. You set $n$ using the ScenarioNumber parameter.
The number of scenarios in the model can be queried (or modified) using the NumScenarios
attribute.
Please refer to the Multiple Scenarios discussion for more information.
- Modifiable: No
- Type: double (
f64
)
When the model has multiple scenarios, this attribute is used to query the objective value of the current solution for scenario $n$. You set $n$ using the ScenarioNumber parameter. If no solution is available, this returns GRB_INFINITY (for a minimization objective).
The number of scenarios in the model can be queried (or modified) using the NumScenarios
attribute.
Please refer to the Multiple Scenarios discussion for more information.
- Modifiable: No
- Type: double (
f64
)
Maximum of all (unscaled) violations that apply to model type.
- Modifiable: No
- Type: double (
f64
)
Number of open branch-and-cut nodes at the end of the most recent optimization. An open node is one that has been created but not yet explored.
- Modifiable: No
- Type: double (
f64
)
Work
spent on the most recent optimization. In contrast to Runtime, work is deterministic, meaning that you will get
exactly the same result every time provided you solve the same model on the same hardware with the same parameter and
attribute settings. The units on this metric are arbitrary. One work unit corresponds very roughly to one second on a
single thread, but this greatly depends on the hardware on which Gurobi is running and the model that is being solved.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ModelDoubleAttr
impl Send for ModelDoubleAttr
impl Sync for ModelDoubleAttr
impl Unpin for ModelDoubleAttr
impl UnwindSafe for ModelDoubleAttr
Blanket Implementations
Mutably borrows from an owned value. Read more