Skip to main content

Adding Constraints

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 Swapnil,

    I would recommend finding the relevant elements in the specname list first. This should make constructing the constraint more readable.

    Furthermore, addConstrs(generator, name) does not accept lhs, rhs, and sense parameters. These are used for the addConstr() method.

    I hope that helps.

    Cheers,
    Matthias

    0
  • Swapnil Brahmankar
    • Gurobi-versary
    • First Question
    • Conversationalist

    Thank you Matthias! let me try that, if you don't mind can you please point me to an example that has that construct? Thanks

    0
  • Matthias Miltenberger
    • Gurobi Staff

    You should check out the different examples - either in the examples directory or online. The diet one uses addConstrs(). I would recommend reading some of those to get a feeling of how to use the code.

    Cheers,
    Matthias

    0

Post is closed for comments.