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

how to rislove non linear error of my code, it is min flow but with linear function in 3 pieces

回答済み

コメント

4件のコメント

  • 正式なコメント
    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.
  • Jaromił Najman
    • Gurobi Staff

    You have terms vbk[i,j,0]*(c[i,j,1] * x[i,j]) where vbk and x are both optimization variables. Thus, you have a nonlinear term vbk * x.

    1
  • BASSEMBISKHAYROUN BASHIR KEDIS
    • Gurobi-versary
    • First Comment
    • First Question

    i thought if i do multiply a binary variable that is 0 or 1 with another variable shouldn't give me non linear equation. i delete it and now it works correctly and i can now finish my project, thank you sir a lot.

    0
  • Jaromił Najman
    • Gurobi Staff

    i thought if i do multiply a binary variable that is 0 or 1 with another variable shouldn't give me non linear equation. i delete it and now it works correctly and i can now finish my project, thank you sir a lot.

    A linearization of a product of a binary variable with an integer variable is not easily possible due to the discrete nature of the integer variable. You could represent the integer variable in terms of multiple binary variables but this trade-off is not always good.

     

    You can linearize binary * binary or binary * continuous if finite bounds are given.

    1

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