0

I have a MILP model that I run on cplex python API. When I use "cplex.populate_solution_pool()" it takes almost 50 minutes to run which is very long for me. How can I speed up running this command?

  • Did you change other parameters? In particulra the solution pool intensity? What is your goal here? Do you want to enumerate all (optimal) solutions or do you just want to get some alternative solutions? – Daniel Junglas Jul 10 '20 at 17:06
  • I set solution pool intensity to 4 and it took 77 min to run, then I changed it to 2 but the timing was the same. I want at least 20 solutions and at most 50( if possible). What parameters can affect the run time? – Ashkan Rezaee Jul 12 '20 at 18:24
  • And when I try to run the model for 30 different times each time it takes more time that doesn't make scenes. it starts with 300 seconds and goes up to 70 minutes and then 80 minutes and more. I didn't have these problems before – Ashkan Rezaee Jul 13 '20 at 07:25
  • my last cplx.papulate_solution_pool() took 16 hours to run! – Ashkan Rezaee Jul 13 '20 at 07:43
  • There is a solution limit parameter for populate. You can set this parameter to make populate stop once a particular solution is found. It seems you performed a lot of experiments. It would probably easier to help if you updated your question with what exactly you did (code!), what you observed, what was unexpected and what you expected to see instead. – Daniel Junglas Jul 15 '20 at 13:30
  • Can I use Cplex.Param.timelimit ? for example I say if it took more than 1 hour stop populating. If so, how can I use it? – Ashkan Rezaee Jul 16 '20 at 11:58
  • You may want to take a look at the documentation, in particular at https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/soln_pool/11_populate_stop.html. It lists all the stopping criteria for populate. The global time limit is one of them. – Daniel Junglas Jul 17 '20 at 04:59
  • Thanks Daniel. I still can not figure out what cases my model to be solved this slow – Ashkan Rezaee Jul 20 '20 at 16:09
  • Also, is there a way that I could measure run time before solving it? – Ashkan Rezaee Jul 21 '20 at 09:00
  • There is no way to predict the running time of a solve. Could it be that your models just become harder and harder? Also note that setting the intensity to 4 is asking to enumerate *al* solutions! This likely forces CPLEX to explore a *huge* number of nodes, so large solution times are not very surprising. You could set the solution pool gap to limit the result to only (near-)optimal solutions. See https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/soln_pool/18_howTo.html – Daniel Junglas Jul 30 '20 at 04:31

0 Answers0