Modeling the quotient of continuous decision variable in a MIP

88 Views Asked by At

For a continuous decision variable $S_{i,j}\geq 0$, I would like to know the quotient of its division by some number $x$, because I need to use it in another constraint. My initial thoughts to do this were as follows:

  • Realize that $S_{i,j} = q_{i,j}\cdot x + r_{i,j}$, where $q_{i,j}\in\mathbb{N}_{\geq 0}$ and $r_{i,j}\in\mathbb{R}_{\geq 0}$ are the quotient and remainder of $S_{i,j}/x$, respectively.
  • Add $q_{i,j}$ and $r_{i,j}$ as decision variables to the MIP model, together with the constraint $$S_{i,j} = q_{i,j}\cdot x + r_{i,j}.$$ However, this does not yield the correct value of the quotient $q_{i,j}$, as we can simply set $r_{i,j}=S_{i,j}$ in all cases.
  • I realized that I actually want to find the largest integer $q_{i,j}$, such that the above equality holds (note that $r_{i,j}>0$). This would mean that I need to add $q_{i,j}$ to my objective.

Question:

Is there another way to get this quotient, without getting an extra optimization problem?

1

There are 1 best solutions below

1
On BEST ANSWER

I'm going to assume that $x$ is not a decision variable in your model. If it is, you will run into nonlinearity problems.

Given that assumption, you can almost get what you want (but not quite) using the approach you suggested. Make $q_{i,j}$ a nonnegative integer variable and $r_{i,j}$ a nonnegative variable. Add the constraints $$S_{i,j} = q_{i,j} \cdot x + r_{i,j}$$ and $$r_{i,j} \le x.$$ The only problem with this formulation is that if $S_{i,j} = n \cdot x$ for some positive integer $n$, the solver has a choice between $q_{i,j}=n, r_{i,j}=0$ and $q_{i,j}=n-1, r_{i,j}=x$.

The alternative is to change the second constraint to $$r_{i,j}\le x-\epsilon$$ for some small positive $\epsilon$. That eliminates the ambiguity when $S_{i,j} = n \cdot x$, but it also prevents $S_{i,j} = n\cdot x - \delta$ for $0<\delta < \epsilon$. In other words, $S_{i,j}$ cannot be very close to an integer multiple of $x$ without being an integer multiple.