Skip to main content

Suspected bug in LP parser: Constraint without variables introduces new variables

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Matthias Miltenberger
    • Gurobi Staff

    Hi Lukas,

    I don't get your point. The constraint in this LP file is obviously nonsense. Gurobi handling it by adding a variable called "10" seems to be a straight-forward and logical resolution.

    Please note that the LP file documentation also states:

    Note that the left-hand side of a constraint may not contain a constant term; the constant must appear on the right-hand side.

    This renders this LP file formulation incorrect and when using the Gurobi command line tool, a warning is displayed:

    Warning: Numeric variable name in LP file ('10') - often the result
    of a constant term in the left-hand side of a constraint.

    Cheers,
    Matthias

    0
  • Lukas Barth
    • Gurobi-versary
    • First Question
    • Conversationalist

    Hi Matthias,

    Thanks for your reply. I missed the part about the left-hand side not being allowed to contain any constants, so Gurobi is right here!

    While these "constraints" are certainly nonsense, I'm faced with a tool that generates models for Gurobi, and in some specific cases generates constraints of this form. I probably need to patch it to avoid this.

    Thanks,

    Lukas

    0
  • Matthias Miltenberger
    • Gurobi Staff

    Hi Lukas,

    Just a piece of advice: don't use LP files for anything other than manually inspecting a model. There are many pitfalls when automatically generating LP files. I strongly recommend using our Python API or any other API to do this job and then save the model as MPS file.

    Cheers,
    Matthias

    0

Post is closed for comments.