How to enumerate all solutions
Tells how to enumerate all solutions of a MIP model.
About this task
You can also enumerate all solutions that are valid for a specific criterion. For example, if you want to enumerate all alternative optimal solutions, do the following steps:
- Set the absolute gap for solution pool parameter
CPX_PARAM_SOLNPOOLAGAP) to 0.0 (zero).
- Set the solution pool intensity parameter
to 4 (
- Set the maximum number of solutions generated for solution pool by populate (
CPX_PARAM_POPULATELIM) to a value sufficiently large for your model; for example, 2 100 000 000.
- Call populate.
Beware, however, that, even for small models, the number of possible solutions is likely to be huge. Consequently, enumerating all of them will take time and consume a large quantity of memory.
mySolutions.solin the SOL file format, execute that procedure and then use the following command:
write mySolutions.sol all
In addition, when you attempt to enumerate all solutions, some restrictions apply, as explained in the following sections.