Skip to main content

Modeling variable multiplication and/or divisions

Answered

Comments

2 comments

  • Official comment
    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

    The Knowledge Base article How do I divide by a variable in Gurobi? discusses the implementation of division of two optimization variables.

    Gurobi natively supports the multiplication of two optimization variables.

    For the particular two constraints you have shown, as long as \(z>0, y > 0\), and \(2x -y > 0\), you can formulate your constraints as

    \[\begin{align*}
    x\cdot z &\geq y + \epsilon \cdot y \cdot z\\
    x &\geq 2\cdot x \cdot z -  y \cdot z + 2\cdot \epsilon \cdot x - \epsilon \cdot y
    \end{align*}\]

    If one of the variables is negative, you would have to adjust the sense of the constraints.

    Note that it is crucial that \(z \neq 0, y\neq 0\), and \(2x -y \neq 0\) for all values of \(z,x,y\) to avoid singularities.

    Moreover, it is strongly recommended to provide tight bounds for all variables participating in a nonlinear term. This is because, the relaxation of nonlinear terms depends on variable bounds. For more details, I recommend having a look at our Non-Convex Quadratic Optimization webinar and Non-Convex Tech Talk.

    0

Post is closed for comments.