Indicating Convexity and Concavity
LINGO's global solver can exploit the fact that a constraint is either convex or concave to improve performance. In many cases, the global solver can automatically identify a constraint as either convex or concave. In other cases, though, the global solver can't make this determination. If you know a constraint is convex or concave then you can flag it as such. In order to do this, replace the standard equality and inequality operators (=, <= and >=) with either: =C=, <C= and >C=. The interpretations of these operators are:
Operator |
Interpretation |
<C= |
The constraint F(X) <= b is convex. |
>C= |
The constraint F(X) >= b is concave. |
=C= |
The function F(X) of the constraint F(X) = b is a convex function. |
As an example, consider the nonlinear model:
MODEL:
MAX= 5 * W1 - 3 * X1 - 4 * Y1
+ 5 * W2 - 3 * X2 - 4 * Y2
+ 5 * W3 - 3 * X3 - 4 * Y3;
- W1 <= 1;
W1 <= 1;
X1 + Y1 >= 1;
[NLROW1] W1 ^ 3 - X1 * Y1 <C= 0;
- W2 <= 1;
W2 <= 1;
X2 + Y2 >= 1;
[NLROW2] W2 ^ 3 - X2 * Y2 <C= 0;
- W3 <= 1;
W3 <= 1;
X3 + Y3 >= 1;
[NLROW3] W3 ^ 3 - X3 * Y3 <C= 0;
END
Model: CONVEX
The three nonlinear rows in this model: NLROW1, NLROW2 and NLROW3, are convex, and we have marked them as such using the convexity inequality operator (<C=). This will allow the global solver to exploit the convexity of these rows and solve the model almost instantly. The global solver would run considerably longer on this model if we were to remove the convexity operators, reverting back to the standard inequality operator <=.
Note: | If you have a constraint for which F(x) is only quasi-convex or quasi-concave, you may still apply the convexity markers to the same advantage. A convex objective, Min = F(x), can be identified by rewriting it: Min = z; z >C= F(x); |