Using solutions from the solution pool

Describes routines and methods to exploit solutions from the solution pool.

The solutions in the solution pool are available for use in applications or further optimizations. For example, you can write a particular solution from the solution pool to a solution file in SOL format.

  • In Concert Technology

    • In the C++ API, use IloCplex::writeSolution.

    • In the Java API, use IloCplex.writeSolution.

    • In the .NET API, use Cplex.WriteSolution.

  • In the Callable library, use the routine CPXsolwritesolnpool .

  • In the Interactive Optimizer, use this command, where i represents the index of the solution in the solution pool: write filename .sol i

You can also write all the solutions from the solution pool into a single SOL file.

  • In Concert Technology

    • In the C++ API, use IloCplex::writeSolutions.

    • In the Java API, use IloCplex.writeSolutions.

    • In the .NET API, use Cplex.WriteSolutions.

  • In the Callable library, use the routine CPXsolwritesolnpoolall.

  • In the Interactive Optimizer, use this command: write filename .sol all

Similarly, you can use a solution from the solution pool to change the fixed problem of your MIP model. Only these two types are supported for this change:

  • CPXPROB_FIXEDMILP

  • CPXPROB_FIXEDMIQP

  • In Concert Technology

    • In the C++ API, use IloCplex::solveFixed.

    • In the Java API, use IloCplex.solveFixed.

    • In the .NET API, use Cplex.SolveFixed.

  • In the Callable Library (C API), use the routine CPXchgprobtypesolnpool.

  • In the Interactive Optimizer, the following command changes the fixed problem to that of the solution at index i in the pool: change problem fixed i

The parameter write level for MST, SOL files (WriteLevel, CPX_PARAM_WRITELEVEL), documented in the CPLEX Parameters Reference Manual, enables you to specify various levels of information, such as values for only discrete variables, values for all variables, and so forth, for CPLEX to record about a solution when it writes the solution to a formatted file.