pub enum ConstrDoubleAttr {
DStart,
FarkasDual,
Pi,
RHS,
SARHSLow,
SARHSUp,
ScenNRHS,
Slack,
}Variants§
DStart
- Modifiable: Yes
- Type: double (
f64)
The current simplex start vector. If you set DStart values for every linear constraint in the model and PStart
values for every variable, then simplex will use those values to compute a warm start basis. If you’d like to retract a
previously specified start, set any DStart value to GRB_UNDEFINED.
Note that any model modifications which are pending or are made after setting DStart (adding variables or constraints,
changing coefficients, etc.) will discard the start. You should only set this attribute after you are done modifying
your model.
Note also that you’ll get much better performance if you warm start your linear program from a simplex basis (using
VBasis and CBasis). The DStart attribute should only be used in situations where you don’t have a basis or you don’t
want to disable presolve.
If you’d like to provide a feasible starting solution for a MIP model, you should input it using the Start attribute.
Only affects LP models; it will be ignored for QP, QCP, or MIP models.
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.
FarkasDual
- 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.
Pi
- Modifiable: No
- Type: double (
f64)
The constraint dual value in the current solution (also known as the shadow price).
Given a linear programming problem
$\begin{array}{ll} \mathrm{minimize} & c’x \ \mathrm{subject\ to} & Ax \ge b \ & x \ge 0 \end{array}$
and a corresponding dual problem
$\begin{array}{ll} \mathrm{maximize} & b’y \ \mathrm{subject\ to} & A’y \le c \ & y \ge 0 \end{array}$
the Pi attribute returns $y$.
Of course, not all models fit this canonical form. In general, dual values have the following properties:
Dual values for $\ge$ constraints are $\ge 0$.
Dual values for $\le$ constraints are $\le 0$.
Dual values for $=$ constraints are unconstrained.
For models with a maximization sense, the senses of the dual values are reversed: the dual is $\ge 0$ for a $\le$ constraint and $\le 0$ for a $\ge$ constraint.
Note that constraint dual values for linear constraints of QCP models are only available when the QCPDual parameter is set to 1. To query the duals of the quadratic constraints in a QCP model, see QCPi.
Only available for convex, continuous models.
RHS
SARHSLow
- Modifiable: No
- Type: double (
f64)
Right-hand side sensitivity information: smallest right-hand side value at which the current optimal basis would remain optimal. Only available for basic solutions.
SARHSUp
- Modifiable: No
- Type: double (
f64)
Right-hand side sensitivity information: largest right-hand side value at which the current optimal basis would remain optimal. Only available for basic solutions.
ScenNRHS
- Modifiable: Yes
- Type: double (
f64)
When the model has multiple scenarios, this attribute is used to query or modify changes of the linear constraint right- hand sides in scenario $n$ w.r.t. the base model. You set $n$ using the ScenarioNumber parameter.
If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.
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.
Slack
Trait Implementations§
Source§impl AsCStr for ConstrDoubleAttr
impl AsCStr for ConstrDoubleAttr
Source§impl Clone for ConstrDoubleAttr
impl Clone for ConstrDoubleAttr
Source§fn clone(&self) -> ConstrDoubleAttr
fn clone(&self) -> ConstrDoubleAttr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more