Skip to main content

Making constraints non-binding

Ongoing

Comments

2 comments

  • Simranjit Kaur
    Gurobi Staff 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
    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

Please sign in to leave a comment.