Skip to main content

Suggestion for Improvement: Default bounds not displayed

Answered

Comments

3 comments

  • Riley Clement
    • Gurobi Staff

    Hi Philipp,

    We would not consider changing display() because it is an old undocumented method that is not intended to be used.  It will likely be removed in a future release.

    The preferred method to inspect the model like this is to write to a LP file.  It also exhibits the same behavior.  Not printing the lower bound when it is 0 is a common convention among solvers and modelling frameworks.  This is motivated by the fact it is not uncommon for the vast majority of variables in a model to have a lower bound of 0 and this would potentially mean hundreds of thousands of extra lines added to the LP file, so it is unlikely that this would be adopted.

    - Riley

    0
  • Philipp Kern
    • Gurobi-versary
    • First Comment
    • First Question

    Of course, you wouldn't want to print an additional `x_i >= 0` line for every variable that uses the default bounds.

    But how about adding just one line, `other_vars >= 0`? This would have been sufficient for me to track down the error I made.

    0
  • Riley Clement
    • Gurobi Staff

    Adding `other_vars >= 0` would be problematic, especially for other solvers unaware of this convention, but I'll suggest to the dev team that we could add a comment to the LP file such as:

    " \ Note, lower bound is 0 unless specified otherwise"

    0

Please sign in to leave a comment.