Multiple solution support
As we have seen in the previous section it is possible to retrieve into your model/application all MIP solutions found by Xpress Optimizer during the branch-and-bound search. Alternatively to defining the integer solution callback and saving the solution in your own structures you can make use of the MIP solution pool and MIP solution enumerator functionality to have solutions stored and made accessible after search has terminated.
The solution pool functionality is active by default. Through the control POOLLIMIT you can set the maximum number of solutions to save (if the search finds more solutions than the specified value, then only the best solutions are retained). The solution enumeration functionality is enabled by setting the control POOLENUMSTRATEGY. The solution enumerator configures the optimization algorithms to generate a large number of feasible solutions, as a consequence, solution times are generally longer than with the default algorithms that are tuned for maximum speed.
As shown in the example file examples\getting_started\Mosel\folioenumsol.mos, the procedure selectsol serves for switching to alternative solutions.
! Set the max. number of solutions to store (default: 10) setparam("XPRS_POOLLIMIT", 25) ! Solve the problem, enabling the solution enumerator setparam("XPRS_POOLENUMSTRATEGY", XPRS_POOLENUMSTRATEGY_FULL) maximize(Return) ! Print out all solutions saved by the enumerator forall(i in 1..getparam("XPRS_POOLSIZE")) do selectsol(i) ! Select a solution from the pool writeln("Solution ", i) writeln("Total return: ", getobjval) end-do
The example file examples\Mosel\Solving\solutionpool.mos shows some more advanced uses of the solution pool functionality.
Further information
- Documentation of solution pool functionality in Mosel: ``Mosel Language Reference Manual'', Chapter 13: `mmxprs'
- Optimizer: ``Xpress Optimizer Reference Manual'', Chapter 7 `Control Parameters'
© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
