Skip to main content

Question about constraint

Answered

Comments

4 comments

  • Camyla Moreno
    Gurobi-versary
    First Comment
    First Question

    Let me correct the notation: 

    coord_z[j] E Zj/{0}

    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Can you please be more precise about what you want to do, what you tried, and what unexpected result you get?
    The code is not reproducible, and it is not clear how the code relates to your question.

    0
  • Camyla Moreno
    Gurobi-versary
    First Comment
    First Question

    Hi Marika,

    I'm sorry for not explaining in more detail earlier.

    I'm trying to model a bin packing problem with 3D dimensions. In these constraints, I want to establish that only for items of type j where the variable coord_z[j] != 0, these constraints should be applied. Gurobi did not allow me to use if coord_z[j] != 0. My question is whether there is another alternative to apply this condition in a way that the solver accepts.

     

    GurobiError: Inequality constraints not supported
    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Camyla,

    If coord_z is a binary variable, this can be done using Indicator constraints.
    For the case that coord_z is integer (or continuous), please have a look at How do I model conditional statements in Gurobi?

    I hope this helps,
    Marika

    0

Please sign in to leave a comment.