In an optimization, what constraints can I use to ensure that if one variable is positive, a separate variable is a specific value

29 Views Asked by At

Let's imagine a linear program where I have 3 assets, a b c, with inventory of 10, 20, and 30.

How would I design a constraint that says if ANY amount of asset 3 is sold, all of asset C must be sold. (so if a > 0, c = 30). However, c can be sold in any amount if a is not sold (c < 30, a = 0)

2

There are 2 best solutions below

0
On

Binary conditions like this are nonlinear.

What you have is two feasible regions, one with $a=0$ and $c$ arbitrary, and another with $c=30$ and $a$ arbitrary. Their union is no longer a region that can be handled with standard LP methods.

0
On

Basically we have: $c=30$ or $a=0$.

$$\begin{align} &c \ge 30\delta \\ & a \le 10\delta \\ & a \in [0,10] \\ & c \in [0,30] \\ & \delta \in \{0,1\} \end{align}$$