4.5 Objective statement

minimize name alias domain : expression ;

maximize name alias domain : expression ;


name is the symbolic name of the objective;

alias is an optional string literal which specifies the alias of the objective;

domain is an optional indexing expression which specifies the subscript domain of the objective;

expression is an linear expression for computing the linear form of the objective


minimize obj: x + 1.5 * (y + z);
maximize total_profit: sum{p in prd} profit[p] * make[p];

The objective statement declares an objective. If the subscript domain is not specified, the objective is a simple (scalar) objective. Otherwise it is a n-dimensional array of elemental objectives.

Elemental objective(s) associated with the model objective (if it is a simple objective) or its members (if it is an array) correspond to general linear constraints in the LP/MIP problem formulation (see Section “Linear programming problem”). However, unlike constraints the corresponding linear forms are free (unbounded).

Constructing the actual linear constraint included in the problem instance, which (constraint) corresponds to a particular elemental objective, is performed as follows. The linear expression specified in the objective statement is evaluated that gives the resultant linear form: $$f=a_1x_1+a_2x_2+\dots+a_nx_n+a_0,$$ where $x_1, x_2, \dots, x_n$ are elemental variables, $a_1, a_2, \dots, a_n$ are numeric coefficients, $a_0$ is the constant term. Then the linear form is used to construct the final elemental constraint in the standard form: $$-\infty<a_1x_1+a_2x_2+\dots+a_nx_n+a_0<+\infty.$$

As a rule the model description contains only one objective statement that defines the objective function (1) used in the problem instance. However, it is allowed to declare arbitrary number of objectives, in which case the actual objective function is the first objective encountered in the model description. Other objectives are also included in the problem instance, but they do not affect the objective function.