メインコンテンツへスキップ

Question about constraint

回答済み

コメント

5件のコメント

  • 正式なコメント
    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.
  • Camyla Moreno
    • Gurobi-versary
    • First Comment
    • First Question

    Let me correct the notation: 

    coord_z[j] E Zj/{0}

    0
  • Marika Karbstein
    • 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

    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

投稿コメントは受け付けていません。