Skip to main content

Constraint: Sum of all variables to be equal to a given value

Answered

Comments

2 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 Roger,

    You can check this R example for three different ways of adding such a constraint:

    Gurobi R example - lp

    You need to define the matrix coefficients - in this case just a row of ones - to model the sum.

    Cheers,
    Matthias

    0

Post is closed for comments.