energy-modelling-toolkit / Dispa-SET

The Dispa-SET unit-commitment and optimal dispatch model, developed at the JRC
European Union Public License 1.2
83 stars 38 forks source link

Aggressive Cplex options for difficult problems. #91

Closed MPavicevic closed 2 years ago

MPavicevic commented 2 years ago

Some problems take supper long time to solve. After experimenting a bit i did find a way to overcome this. However it compromises the speed of smaller and easy to solve problems. This are the cplex options that work well for such difficult problems:

cplex_options = {'cuts': 2, 'covers': 3, 'cliques': 3, 'disjcuts': 3, 'liftprojcuts': 3, 'localimplied': 3}

A mode elaborate explanation of this options can be found here and here

The parameter that does the trick is 'disjcuts'. according to cplex docs:

A MIP problem can be divided into two subproblems with disjunctive feasible regions of their LP relaxations by branching on an integer variable. Disjunctive cuts are inequalities valid for the feasible regions of LP relaxations of the subproblems, but not valid for the feasible region of LP relaxation of the MIP problem.

Other cutting parametes do not impact the cou time nor the convergence of the solver much. However if not specified alongside 'disjcuts' solver sometimes still gets stuck inside the loop. Its all or nothing solution.

MPavicevic commented 2 years ago

This has been added in 3759756aed163c5694fe7b0822beca20cf420be5