Division between float and grb variable
回答済みI am trying to add a constraint on the inverse of the variable of the form
$$1/x[i, j] + a^Ty + b \leq c$$
but I get the message that div does not support float and MVar. Is this currently supported?
-
正式なコメント
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?. -
Hi Surya,
Division of variables is currently not supported.
You can model the division \(\frac{1}{x}\) with an additional variable \(z\) as
\[\begin{align*}
x \cdot z = 1.
\end{align*}\]In the above \(z\) has to be equal to \(\frac{1}{x}\) and can be used throughout your model.
Please note that you have to provide appropriate bounds for both \(x\) and \(z\) to make the above formulation work properly. For \(x \in [x^L, x^U], x^L>0\), the bounds for \(z\) should be \(z \in [\frac{1}{x^U}, \frac{1}{x^L}]\).
It is also required to set the NonConvex parameter to 2.
Best regards,
Jaromił0
投稿コメントは受け付けていません。
コメント
2件のコメント