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")