1

I've got a problem at solving an MIP with Docplex. The computation speed for my problem differs between 35 and 120 seconds while it is solved within 5 seconds using the OPL version. The model formulation does not differ between Python and OPL.

Does anyone have any idea what the difference in computation time might be due to?

Kind regards

  • What's the code in question? – no ai please Jun 28 '21 at 23:47
  • Assuming you're comparing on the same machine, are you using the same version of CPLEX in both cases, and the same parameters? To start, compare the two solve logs. – Philippe Couronne Jun 29 '21 at 08:15
  • I think I found the reason for the different CPU times. It is related to the following constraint: (OPL): //C9 forall(t in T, l in LR) sum(m in M: t in TM[m], r in R: p[r][l] > 0) Z[m,r,t,p[r][l]] <= Y[t,l]*sum(m in M) d[m]; (Python): c9 = mdl.add_quadratic_constraints(mdl.sum(Z[m,r,t,p[r][l]] for m in M if t in TM[m] for r in R if p[r][l] > 0) <= Y[t,l] * mdl.sum(d[m] for m in M) for t in T for l in LR) In the Python Version, I need to formulate it as a quadratic constraint while it is accepted as it is in the OPL Version. My idea would be to linearize the constraint? – memphisDepay21 Jun 29 '21 at 09:19
  • Both OPL and DOcplex handle quadratic constraints. Generate and compare LP files with OPl and Docplex, they should be identical. – Philippe Couronne Jun 30 '21 at 08:51

0 Answers0