0

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?

Routine Ma
  • 31
  • 3
  • 1
    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. – prubin May 27 '22 at 14:48

1 Answers1

1

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

Penghui Guo
  • 762
  • 3
  • 9