CPXXaddsolnpooldivfilter and CPXaddsolnpooldivfilter
The routine CPXXaddsolnpooldivfilter/CPXaddsolnpooldivfilter
adds
a new diversity filter to the solution pool.
int CPXXaddsolnpooldivfilter( CPXCENVptrenv, CPXLPptrlp, doublelower_bound, doubleupper_bound, CPXDIMnzcnt, CPXDIM const *ind, double const *weight, double const *refval, char const *lname_str )
int CPXaddsolnpooldivfilter( CPXCENVptrenv, CPXLPptrlp, doublelower_bound, doubleupper_bound, intnzcnt, int const *ind, double const *weight, double const *refval, char const *lname_str )
Description
The routine CPXXaddsolnpooldivfilter/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). CPLEX computes the diversity measure 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]|}.
A diversity filter makes sure that the solutions satisfy the constraint:
lower bound <= differences(x) <= upper bound
You may specify both a lower and upper bound on diversity.
In order to say, Give me solutions that are
close to this one, within this specified set of variables,
specify a lower_bound
of 0.0 (zero) and a finite
upper_bound
.
CPLEX then looks for solutions that differ from the reference
values by at most the value of upper_bound
, within
the specified set of variables.
In order to say, Give me solutions that are different
from this one, specify a finite lower_bound
and an infinite (that is, very large) upper_bound
on the diversity.
CPLEX then looks for solutions that differ from the reference values
by at least the value of lower_bound
, within the
specified set of variables.
Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX
. - lp
-
A pointer to a CPLEX problem object as returned by
CPXXcreateprob/CPXcreateprob
. - lower_bound
- Lower bound on the diversity measure for new solutions allowed in the pool.
- upper_bound
- Upper bound on the diversity measure for new solutions allowed in the pool.
- nzcnt
- Number of variables used to define the diversity measure.
- ind
- An array of 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
andweight
from positions 0 (zero) tonzcnt-1
. Each entry,ind[i]
, specifies the variable index of the corresponding weight,weight[i]
. Can beNULL
, in which case CPLEX uses weights of 1.0 (one). - refval
-
An array of reference values for the variables with indices in the array
ind
to compare with a solution when CPLEX computes the diversity measure. - lname_str
-
The name of the filter. Can be
NULL
.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXaddsolnpooldivfilter (env, lp, loval, hival,
cnt, ind, val, refval, fnamestr);