Skip to main content

Programmatically determining warnings, e.g. large RHS

Answered

Comments

3 comments

  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Frederik,

    Apart from checking your data before or while building the model, you can also run a quick sanity check before optimizing it.

    This will print the model statistics:

    model.update()
    model.printStats()

    Please note that you must process pending model changes by calling update() before displaying the statistics.

    I hope that helps!

    Cheers,
    Matthias

    0
  • Frederik Schadd
    Gurobi-versary
    First Comment
    First Question

    Hi Matthias,

    thanks for the response. This approach would print the stats to the stdout which I would then have to read back in again. Is there a more direct of doing this? Also, what are the thresholds that gurobi applies to decide whether to throw a warning? 

    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

     You could also check the Model Attributes, for example, MaxRHS
    The threshold for the warning is 1e+09 for rhs, bounds, and obj coefficients. It is 1e+08 for matrix coefficients.
    But we recommend to even have smaller values, see Recommended ranges for variables and constraints and Advanced user scaling.

    1

Please sign in to leave a comment.