0
$\begingroup$

How do I divide a variable by another variable?

For example, if I have a variable max, and a variable $\sum\sum X_{ij}$, what I want to do is max divided by $\sum\sum X_{ij}$.

But the question is that Gurobi does not have "division" system. What can I do in this situation?

$\endgroup$
1
  • 1
    $\begingroup$ First, I suggest not using "max" as a variable name in the question. It will likely cause some confusion. Second, the answer will depend on whether any of the variables are binary (or perhaps integer) as opposed to continuous. $\endgroup$
    – prubin
    Commented May 27, 2022 at 14:48

1 Answer 1

1
$\begingroup$

If your objective function is $\max \frac{x}{z}$, you can add a constraint $x = zy$, then set the objective function to $\max y$.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.