Originally posted by: SystemAdmin
When CPLEX finds a solution, it will implicitly set an objective cutoff. This means that all inferior solutions will be treated as infeasible by CPLEX, and consequently, CPLEX will only produce a chain of solutions with improving objective value.
If you want to collect solutions, you can use the incumbent callback as you described. But there is a much easier way since CPLEX 11: the solution pool. If you want to have all solutions that CPLEX discovered while solving the problem, just set the solution pool capacity to infinity, and after the solve stopped, query the solutions from the pool.
If you really want to have
all feasible solutions to your problem, you need to use the "populate" feature of CPLEX, together with the solution pool as described above. You can set the populate parameters in such a way that all solutions are accepted, even the ones with very bad objective value.
Note that "all" solutions has a very special meaning if continuous variables are involved. Namely, if there are continuous variables, you will typically have an infinite amount of feasible solution vectors. Of course, CPLEX cannot generate all of those. "All" for CPLEX only means all combinations of values for the integer variables for which at least one assignment to the continuous variables exist to make the overall solution vector feasible. For each integer variable assignment, CPLEX will use an optimal assignment to the continuous variables to complement the solution.
Tobias
#CPLEXOptimizers#DecisionOptimization