Reputation: 19
I have implemented a UBQP (that is a quadratic problem without constraints and with binary variables) in CPLEX (v 12.6.2) in the Callable Library in C and I'm interested in obtaining multiple solutions (not only the optimum, but also other feasible).
I took CPLEX original populate.cpp code and getting its routines in order to get a solution pool, such as CPXpopulate(env,lp).
The problem is that the size of my solution pool is always 1, it only contains the optimum. Instead, if I give to populate.cpp a LP problem (i.e. a minimization linear problem) it works correctly.
I tried the usual commands:
status = CPXsetdblparam (env, CPXPARAM_MIP_Pool_RelGap, 0.5);
status = CPXsetintparam (env, CPXPARAM_MIP_Pool_Capacity, 25);
status = CPXsetintparam (env, CPXPARAM_MIP_Pool_Replace, 1);
status = CPXsetdblparam (env,CPXPARAM_Simplex_Tolerances_Feasibility,0.01);
status = CPXsetdblparam (env, CPXPARAM_MIP_Tolerances_Integrality, 0.01);
status = CPXsetintparam (env, CPXPARAM_MIP_Pool_Intensity, N);
that should force CPLEX to generate more solutions, but it does not.
If I set N = 4 (that is the max value) in CPXPARAM_MIP_Pool_Intensity it failed to optimize, but if set N = 0,...,3 I don't get more than 1 solution.
Is there a way to obtain multiple solutions in such a kind of problem?
Upvotes: 1
Views: 435
Reputation: 33
In order to obtain a large number of feasible solutions with CPLEX, you should use CPLEX.populate() instead of CPLEX.solve()
Upvotes: 0