Skip to main content

Making constraints non-binding

Ongoing

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Simranjit Kaur
    • Gurobi Staff

    The constraints

    self.model.addConstr(self.Q_prime[t, d, m, k] >= 1 - big_M * (1 - self.BETA[t, d, m, k]))
    self.model.addConstr(self.Y[d, n, k] <= t + big_M * (1 - self.gama[t, d, n, k]))

    will be "active" if the BETA and gama variables take the value 1, respectively.

    These can be modelled by adding two indicator constraints:

    self.model.addConstr( (self.BETA[t, d, m, k]==1) >> (self.Q_prime[t, d, m, k] >= 1) )
    self.model.addConstr( (self.gama[t, d, n, k]==1) >> (self.Y[d, n, k] <= t) )

    Would this not work for your model?

    0
  • Mohammadmahdi Farajollahi
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you for your response. I'm using Gurobi 13.0.0, and doesn't support this way. Eventually, I linearized the combination of these binary variables, and put the combination as the condition of indicator constraint instead of writing them in chain. Now I have another question. I want to make a new matrix of variables of matrix divided by the sum of all variables of that matrix. Since this not a linear operation, how can I linearize it?

    0

Post is closed for comments.