CPLEX settings for MIP optimization

Hi everyone,

I have been trying to solve mixed-integer optimization problems of an energy system optimization model with unit commitment and integer investment decisions using CPLEX. Unfortunately, the solver often runs into “out of memory” problems or exceeds a run time of 24h. Do you have any experience in choosing the right solver settings when solving MIP problems in order to speed up the optimization? Any help would be highly appreciated!

Thank you in advance!

Best,
Shima

Hi @Shima, it sounds like you’re going to struggle to make your model tractable without some major model changes. However, here are some tips:

  1. Take a look at the CPLEX solver logs, they will indicate how long the model takes to reach a relaxed LP solution. If this is very short, you could look at changing the relative or absolute MIP gap. There are also many more CPLEX parameters that can be tweaked, but they all end up being quite model specific, so you’ll need to do some tests.
  2. If the relaxed LP solution takes a long time to be reached, consider changing your LP algorithm from “simplex” to “barrier”.
  3. The branch-and-cut method benefits from parallelism - ensure you’re using as many cores/threads as you have available on your device. This is another CPLEX parameter that can be set.
  4. Consider whether you actually need your integer/binary variables in your model. The model will be a lot easier to solve if it is an LP one.
  5. Reduce your model size.
    a) You could look at timeseries reduction strategies, such as resolution adjustment from 1h to 3h, 6h, etc., or to cluster based on “typical days”. Just be careful: it may seem like your saviour, but key results (LCOE, capacities, etc.) are sensitive to timeseries reduction, and storage technologies need extra special care when clustering.
    b) Remove technologies that you care less about or aggregate model regions/nodes that share a lot of the same characteristics.
  6. Get access to more computational power. Many research institutes and universities have access to high-performance computing clusters. If you can get access to one, many of your problems will sort themselves out.
1 Like

Just noting this recent preprint on model complexity. The paper is still in the pipeline at the time of posting (although I am not involved in any way).

  • Kotzur, Leander, Lars Nolting, Maximilian Hoffmann, Theresa Groß, Andreas Smolenko, Jan Priesmann, Henrik Büsing, Robin Beer, Felix Kullmann, Bismark Singh, Aaron Praktiknjo, Detlef Stolten, and Martin Robinius (under review). “A modeler’s guide to handle complexity in energy system optimization — Preprint”. Renewable and Sustainable Energy Reviews. ISSN 1364-0321. Submitted 15 July 2020. arXiv PDF.
1 Like

Thank you so much for your detailed response!
I am already using the barrier algorithm, using several threads (32), doing my calculation on high-perfomance computing clusters and already tried to adjust the MIP gap. The solution of the relaxed LP problem takes a few hours but the branch-and-cut still does not exceed the first iteration after 24 hours. What are the most promising CPLEX parameters in your opinion that I could try to adjust?

Best,
Shima

Try different solvers? If you’re an academic, you can obtain a Gurobi license in seconds through your institutional affiliation. I’ve had good results using Gurobi on MIP problems. Even if you don’t want to use Gurobi, it’s worth checking out their documentation, which I find a bit more accessible than that of CPLEX (https://www.gurobi.com/documentation/9.1/refman/mip_models.html). You might get some hints you can transfer over to CPLEX.

1 Like
Text and images licensed under CC BY 4.0Data licensed under CC0 1.0Code licensed under MITSite terms of serviceOpenmod mailing list.