ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Solution Pool: Generating and Keeping Multiple Solutions > Parameters of the Solution Pool > Example: Diverse Solutions through Replacement Parameter

It is often impractical to manage a very large number of solutions, and in those situations, a smaller set of solutions with different characteristics proves more useful. You can achieve this aim in two steps:

  1. Set the solution pool capacity parameter (SolnPoolCapacity, CPX_PARAM_SOLNPOOLCAPACITY) to a manageable number, rather than its default value, which is quite large.
  2. Set the solution pool replacement strategy (SolnPoolReplace, CPX_PARAM_SOLNPOOLREPLACE) to 2: replace least diverse solutions.

These settings make sure that pool capacity will not increase as solutions are added. Instead, solutions will be replaced in the pool according to their diversity if the number of solutions generated exceeds the limited capacity of the pool.

As an example of this idea of using the replacement strategy parameter to control diversity of solutions in the solution pool, consider the following session in the Interactive Optimizer, again reading the model in Example: Simple Facility Location Problem, setting parameters, and calling populate.

read location.lp
set mip pool intensity 2
set mip pool relgap 0.1
set mip pool replace 2
set mip pool capacity 10
set mip limits populate 10000
set time 1
populate

Logically, the pool contains only ten solutions now (its capacity) even though more solutions have been generated. The number of solutions that have been generated but are not retained in the pool is reported in the log by the number of solutions replaced.

If you apply a time limit of 10 seconds instead of 1 (one), many more solutions will be generated. That greater number of solutions also leads to greater diversity among the solutions retained in the pool.