NO FRAMES

CPXfeasoptext

public int CPXfeasoptext(CPXCENVptr env, CPXLPptr lp, int grpcnt, int concnt, double * grppref, const int * grpbeg, const int * grpind, const char * grptype)
Definition file: cplex.h

The routine CPXfeasoptext extends CPXfeasopt in several ways. Unlike CPXfeasopt, CPXfeasoptext enables the user to relax quadratic constraints and indicator 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 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 of 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.

Note that if you use INF mode, the resulting feasopt models will be MIPs even if your model is continuous. Similarly, if you use QUAD mode, the feasopt models will become quadratic even if your original model 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 CPXsolution, CPXgetcolinfeas for columns, CPXgetrowinfeas for rows, CPXgetqconstrinfeas for quadratic constraints, CPXgetindconstrinfeas for indicator constraints, or 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 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: Possible values for elements of grptype
CPX_CON_LOWER_BOUND= 1variable lower bound
CPX_CON_UPPER_BOUND= 2variable upper bound
CPX_CON_LINEAR= 3linear constraint
CPX_CON_QUADRATIC= 4quadratic constraint
CPX_CON_INDICATOR= 6indicator constraint

Parameters:

env

A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX.

lp

A pointer to a CPLEX problem object as returned by CPXcreateprob.

grpcnt

The number of constraint groups to be considered.

concnt

An integer indicating 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 indicates that the corresponding group should not be relaxed.

grpbeg

An array of integers indicating 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.

Returns:

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