NO FRAMES

CPXaddsolnpooldivfilter

public int CPXaddsolnpooldivfilter(CPXCENVptr env, CPXLPptr lp, double lower_cutoff, double upper_cutoff, int nzcnt, const int * ind, const double * weight, const double * refval, const char * lname_str)
Definition file: cplex.h

The routine CPXaddsolnpooldivfilter adds a new diversity filter to the solution pool.

A diversity filter drives the search for multiple solutions toward new solutions that satisfy a measure of diversity specified in the filter.

This diversity measure applies only to binary variables.

Potential new solutions are compared to a reference set. You must specify which variables are to be compared. You do so with the argument ind designating the indices of variables to include in the diversity measure.

A reference set is the set of values specified by the argument refval.

You may optionally specify weights (that is, coefficients to form a linear expression in terms of the variables) in the diversity measure; if you do not specify weights, all differences between the reference set and potential new solutions will be weighted by the value 1.0 (one). The diversity measure is computed by summing the pair-wise weighted absolute differences from the reference values, like this:

 differences(x) = sum {weight[i] times |x[ind[i]] - refval[i]|}.
 

If you specify an upper bound on diversity with the argument upper_cutoff, CPLEX will look for solutions similar to the reference values. In other words, you can say, Give me solutions that are close to this one, within this set of variables.

If you specify a lower bound on the diversity with the argument lower_cutoff, CPLEX will look for solutions that are different from the reference values. In other words, you can say, Give me solutions that differ by at least this amount in this set of variables.

You may specify both a lower and upper bound on diversity.

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

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

lower_cutoff

Lower bound on the diversity measure for new solutions allowed in the pool.

upper_cutoff

Upper bound on the diversity measure for new solutions allowed in the pool.

nzcnt

Number of variables used to define diversity measure.

ind

An array of variable indices of variables in the diversity measure.

weight

An array of weights to be used in the diversity measure. The indices and corresponding weights must be stored in sequential locations in the arrays ind and weight from positions 0 to num-1. Each entry, ind[i], specifies the variable index of the corresponding weight, weight[i]. May be NULL, then weights of 1.0 will be used.

refval

An array of reference values for the the variable with indices in ind to compare with solution when diversity measure is computed.

lname_str

The name of the filter. May be NULL.

Returns:

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