0

I'm trying to obtain the total number of cuts from a solved docplex model, so basically the sum of the following output:

Implied bound cuts applied: 7 Flow cuts applied: 10 Mixed integer rounding cuts applied: 7 Zero-half cuts applied: 2 Lift and project cuts applied: 5 Gomory fractional cuts applied: 4

Anonymous
  • 3
  • 1
  • 3

1 Answers1

0

This is not yet directly provided by docplex, we'll keep this in mind for future versions. In the meantime you can use this code here:

https://github.com/PhilippeCouronne/docplex_contribs/blob/master/docplex_contribs/src/numcuts.py

Beware this uses non-documented classes and does not check that the model is actually a MIP. Anyway, it returns a dictionary of cut_name : number of cuts used, e.g.:

 {'cover': 88, 'GUB_cover': 9, 'flow_cover': 6, 'fractional': 5, 'MIR': 9, 'zero_half': 9, 'lift_and_project': 5}
Philippe Couronne
  • 826
  • 1
  • 5
  • 6