1

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?

  • There is a technote [here](http://www-01.ibm.com/support/docview.wss?uid=swg21399929) that is old but has some useful pointers. Have you tried using [populate](http://www.ibm.com/support/knowledgecenter/SSSA5P_12.6.3/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/soln_pool/10_populate_eg.html) from within the interactive (to make sure you get the same results)? – rkersh Oct 03 '16 at 18:10
  • So that others can take a closer look, you might consider sharing your model here (e.g., in SAV format) via a file sharing site like http://filedropper.com/. – rkersh Oct 03 '16 at 18:25
  • @rkersh Using **populate** from the interactive leads to 3 solutions instead than 1. The other 2 solutions are trivial: 000...0 and 111...1, they surely are not what I need, and I remember to have found them also in the Callable Library setting some parameters to some value that I don't remember. I'm not sute that I've implemented correctly what is written in that technote, however **now I can get multiple solutions** (basically, adding constraints that forces the incumbent to change and doing a loop). The problem now is that the execution time I see is much longer than what I expected! – Emanuele Guerrazzi Oct 04 '16 at 14:41
  • While populate worked in a very fast time (even if it gave me only 1 solution), the above-mentioned algorithm is very slow. With equal conditions, populate runs in less than 100 ms, while this algorithm took over 70.000 ms! – Emanuele Guerrazzi Oct 04 '16 at 14:48
  • It's hard to say anything about the performance without knowing more about your particular model. The technote does mention that enumerating all of the solutions and/or using the alternate methods can be time consuming. – rkersh Oct 04 '16 at 16:55
  • This is a LP file created by my model http://www.filedropper.com/prova2_2 . You can try this istance using "populate.c" file from CPLEX example. While it works correctly with linear programming problems (but also with some QP), it seems that the functions used to populate multiple solutions have some problems in generating multiple solutions for quadratic problems with binary variables. But maybe I'm wrong... PS: I have installed and used also CPLEX 12.6.3. – Emanuele Guerrazzi Oct 05 '16 at 10:31
  • This question was crossposted [here](https://www.ibm.com/developerworks/community/forums/html/topic?id=67cdaf3a-db08-4048-81b7-f4582aa0635c&ps=25). – rkersh Oct 05 '16 at 15:49

1 Answers1

0

In order to obtain a large number of feasible solutions with CPLEX, you should use CPLEX.populate() instead of CPLEX.solve()