CPXXfeasoptext and CPXfeasoptext

The routine CPXXfeasoptext/CPXfeasoptext extends CPXXfeasopt/CPXfeasopt in several ways.

int  CPXXfeasoptext( CPXCENVptr env, CPXLPptr lp, CPXDIM grpcnt, CPXNNZ concnt, double const * grppref, CPXNNZ const * grpbeg, CPXDIM const * grpind, char const * grptype )

int  CPXfeasoptext( CPXCENVptr env, CPXLPptr lp, int grpcnt, int concnt, double const * grppref, int const * grpbeg, int const * grpind, char const * grptype )

Description

The routine CPXXfeasoptext/CPXfeasoptext extends CPXXfeasopt and CPXfeasopt in several ways. Unlike CPXXfeasopt and CPXfeasopt, CPXXfeasoptext/CPXfeasoptext enables the user to relax indicator constraints and quadratic constraints (except for explicit second order cone constraints). In addition, it allows the user to treat a group of constraints as a single constraint for the purposes of determining the penalty for relaxation.

Thus, according to the various INF relaxation penalty metrics (see CPXXfeasopt and CPXfeasopt for a list of the available metrics), all constraints in a group can be relaxed for a penalty of one unit. Similarly, according to the various QUAD metrics, the penalty for relaxing a group grows as the square of the sum of the individual member relaxations, rather than as the sum of the squares of the individual relaxations.

If you use INF mode, the resulting feasopt problems will be MIPs even if your problem is continuous. Similarly, if you use QUAD mode, the feasopt problems will become quadratic even if your original problem is linear. This difference can result in greater than expected solve times.

The routine also computes a relaxed solution vector that can be queried with CPXXsolution and CPXsolution, CPXXgetcolinfeas and CPXgetcolinfeas for columns, CPXXgetrowinfeas and CPXgetrowinfeas for rows, CPXXgetqconstrinfeas and CPXgetqconstrinfeas for quadratic constraints, CPXXgetindconstrinfeas and CPXgetindconstrinfeas for indicator constraints, or CPXXgetsosinfeas and CPXgetsosinfeas for special ordered sets.

The arguments to this routine define the set of groups. Each group contains a list of member constraints, and each member has a type (lower bound, upper bound, linear constraint, quadratic constraint, or indicator constraint). The group members and member types are entered by means of a data structure similar to the sparse matrix data structure used throughout CPLEX. (See CPXXcopylp and CPXcopylp for one example.) The argument grpbeg gives the starting location of each group in grpind and grptype. The list of members for group i can be found in grpind[grpbeg[i]] through grpind[grpbeg[i+1]-1], for i less than grpcnt-1 and grpind[grpbeg[i]] through grpind[concnt-1] for i = grpcnt-1. The corresponding constraint types for these members can be found in grptype[grpbeg[i]] through grptype[grpbeg[i+1]-1], for i less than concnt-1 and grptype[grpbeg[grpcnt-1]] through grptype[concnt-1] for i = grpcnt-1. A constraint can appear in at most one group. A constraint that appears in no group will not be relaxed.

Table 1. Table 1: Possible values for elements of grptype
CPX_CON_LOWER_BOUND = 1 variable lower bound
CPX_CON_UPPER_BOUND = 2 variable upper bound
CPX_CON_LINEAR = 3 linear constraint
CPX_CON_QUADRATIC = 4 quadratic constraint
CPX_CON_INDICATOR = 6 indicator constraint
These four parameters do not influence this routine. If you want to study infeasibilities introduced by those parameters, consider adding an objective function constraint to your model to enforce their effect before you invoke this routine.
Warning:

For efficiency reasons, this function temporarily modifies your problem to account for the relaxations. In certain corner cases, such as out of memory situations, CPLEX may fail to restore your problem to its original state. In such a case, CPLEX clears your problem, and the lp argument will refer to an empty object. The only valid operation on this object is then for you to call CPXXfreeprob and CPXfreeprob.

Arguments

env
A pointer to the CPLEX environment as returned by the routine CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX problem object as returned by CPXXcreateprob/CPXcreateprob.
grpcnt
The number of constraint groups to be considered.
concnt
An integer specifying the total number of indices passed in the array grpind, or, equivalently, the end of the last group in grpind.
grppref
An array of preferences for the groups. The value grppref[i] specifies the preference for the group designated by the index i. A negative or zero value specifies that the corresponding group should not be relaxed.
grpbeg
An array of integers specifying where the constraint indices for each group begin in the array grpind. Its length must be at least grpcnt.
grpind
An array of integers containing the constraint indices for the constraints as they appear in groups. Group i contains the constraints with the indices grpind[grpbeg[i]], ..., grpind[grpbeg[i+1]-1] for i less than grpcnt-1 and grpind[grpbeg[i]], ..., grpind[concnt-1] for i == grpcnt-1. Its length must be at least concnt, and a constraint must not be referenced more than once in this array. If a constraint does not appear in this array, the constraint will not be relaxed.
grptype
An array of characters containing the constraint types for the constraints as they appear in groups. The types of the constraints in group i are specified in grptype[grpbeg[i]], ..., grptype[grpbeg[i+1]-1] for i less than grpcnt-1 and grptype[grpbeg[i]], ..., grptype[concnt-1] for i == grpcnt-1. Its length must be at least concnt, and every constraint must appear at most once in this array. Possible values appear in Table 1.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.