1

I have an integer programming problem with linear objective function and some quadratic constraints. When I use Gurobi to solve this problem, Gurobi uses Presolve to create a Quadratically Constrained Integer Programming model. Now, I would like to know if the objective function of the Presolve model is quadratic too.

Thanks in advance.

1 Answers1

0

Gurobi will give you the presolved model with the method presolve on the model object. That object is a regular model object and you can query its attributes. The attribute isQCP is true if there are any quadratic constraints. The attribute isQP indicates that the model has a quadratic objective, but no quadratic constraints. The attribute NumQConstrs is a count of the number of quadratic constraints. You can also use the printStats method to print the numbers or you could use the write method to write the presolved model to a file.

presolved_model = model.presolve()
print(presolved_model.IsQCP)
print(presolved_model.IsQP)
presolved_model.printStats()
presolved_model.write("presolved.lp")
David Nehme
  • 21,379
  • 8
  • 78
  • 117