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

How to handle absolute value in objective function?

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Dear Yingcong,

    A very detailed description of how to formulate the minimization of the absolute function can be found in the stackexchange post Converting absolute value program into linear program.

    Regarding the formulation \((a \cdot b - c) \cdot (a \cdot b - c)\). It is possible to formulate it with Gurobi, if you introduce an auxiliary variable \(z\) and the equality constraint \[ z = a \cdot b.\] Your problem would then read

    \[\begin{align*}
    \min z &\cdot z - 2 \cdot c \cdot z + c \cdot c \\
          z &= a\cdot b
    \end{align*}\]

    You can find more information in our Knowledge Base article on How do I model multilinear terms in Gurobi?

    Best regards,
    Jaromił

    1
  • Yingcong Zhong
    • Gurobi-versary
    • First Question
    • First Comment

    Dear Jaromił,

    thank you very much for the sharing of the link about the problem formulation and the advice on the implementation. I have followed your lead and found a proper approach to solve it. 

    Best regards,

    Yingcong

    0

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