Skip to main content

How can I check the total number of constraints created after running the model

Answered

Comments

1 comment

  • Riley Clement
    • Gurobi Staff

    With python, create the model, update, then use model attributes:

    m = gp.Model()
    ...
    m.update()
    print(m.NumConstrs)
    print(m.NumQConstrs)
    print(m.NumGenConstrs)
    print(m.NumSOS)

    Other APIs can be used in a similar fashion.

    - Riley

     

     

    0

Please sign in to leave a comment.