Formulating linear (or perhaps non-linear) program to fix variables across one dimension

48 Views Asked by At

I have been working with linear programs for a few years now but have no formal mathematics training, so hoping for some help with formulating a problem. I think its non-linear but want to be sure.

I need to select individuals according to 3 different dimensions, using boolean variables. The unique part is that I need to constrain one of the dimensions for specific instances of the other two dimensions.

So, ideally, it would look like:

max $\sum_{i,j,k=0,0,0}^{m,n,o} x_{i,j,k}*a_{i,j,k}$

where $x_{i,j,k}$ is binary

where $a_{i,j,k}$ is a known constant

I am frankly unsure how to formulate the constant, but essentially for each $i$, there can only be one value of $j$, regardless of $k$ ... and I don't know what that $j$ value is ahead of time. I want it to be determined by the solver.

I have formulated this as a non-linear problem that multiplies two binary variables (and refactored as a linear problem) and the constraints were much easier to structure, however, the solver time of that solution is impractical.

Just hoping there is a way to formulate a constraint so as to avoid two binary variables.

Appreciate any help.

1

There are 1 best solutions below

1
On BEST ANSWER

If I understand correctly, you can model this rule by introducing a binary variable $y_{i,j}$ and the following linear constraints: \begin{align} x_{i,j,k} &\le y_{i,j} &&\text{for all $i,j,k$}\\ \sum_j y_{i,j} &\le 1 &&\text{for all $i$} \end{align} In fact, you can relax $y_{i,j}\in\{0,1\}$ to $y_{i,j}\ge 0$.