0

I am working on Linear Programming Problem with 800K Constraints and the problem takes 20 mins to solve but if I solve the problem for half horizon it just takes 1 min. Is there a way in DoCPLEX where I can solve for partial horizon and then use the solution to solve for other half of the problem without using a for-loop

2 Answers2

1

Three suggestions:

  1. load your problem as LP or SAV into cplex interactive optimizer and run display problem stats. This might show (or rule out) precision issues (ill-conditioned problem). Also it will output number of nonzeros

  2. set datacheck parameters to 2, this might detect numerical issues in data

  3. have you tried different LP algorithms? Using the lpmethod parameter you could try primal, dual or barrier algorithm to see whether one runs faster on your problem. Reference: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/LPMETHOD.html

In DOcplex:

model.parameters.datacheck = 2
model.parameters.lpmethod = 4 # for barrier
Philippe Couronne
  • 826
  • 1
  • 5
  • 6
  • Hi Phillippe, thank you for your suggestions. I am currently using barrier method which have better performances but my model do have numerical issues. Is rounding off is a good way to prevent them? – Kartik Kaushik Sep 23 '20 at 16:15
  • I was able to get solution by reducing penalties on objective but when I introduced new dataset I got Getting CPLEX Warning 1035: Detected 100.00% (1) ill-posed condition number(s) >= 1e+14 and though solution is optimal the solve code is 2 and it returns no solution with and when I further reduce penalty on one of the objective it gives out solution – Kartik Kaushik Sep 23 '20 at 18:25
0

From your answers, I can think of the following:

  • if you are in pure LP (is this true?) I see no point in rounding numbers (but yes, that would help in a MIP, try rounding coefficients whose fractional part is say less than 1e-7: 4.0000001 -> 4)
  • 1e+14 conditioning denotes serious modeling issue: a common source is mixing different objectives with coefficients. Have you tried multi-objective to avoid that? Another source is big_M formulations, to which you should prefer indicator constraints. If you are not in these two cases, then try to renormalize the data to keep in a smaller condition range...

Finally, you might try setting markowitz tolerance to 0.99, to add extra cautiouness in simplex factorizations, but behavior may vary from one dataset to the other...

Philippe Couronne
  • 826
  • 1
  • 5
  • 6
  • The model here is a pure LP. I have a multi-objective with different coefficients for different objective parts. I initially used Markowitz but will add it again and test few more things. – Kartik Kaushik Sep 24 '20 at 15:02