I have the following linear program that keeps evaluating all solutions to zero. Which additional constraints could I add to force $x>0$ or $y>0$ or both $z,y>0$?
\begin{equation*} \begin{aligned} & \underset{f}{\text{min}} & & f(x,y,z) = 0.23x + 0.05y - 0.03z \\ & \text{s.t.} & & x + y \le 7400 \\ &&& -x + z \ge -6500 \\ &&& -y - z \ge 0 \\ &&& z \le 0 \\ &&& x,y \ge 0 \end{aligned} \end{equation*}
The idea is that the optimizer support all 3 cases:
- if $y=0$ and $z=0$ then $x>0$
- if $x=0$ then $y>0$ and $z<0$
- if $x>0$ and $y>0$ and $z<0$ then $x+y \le 7400$
Using SciPy's linprog
c = [0.23, 0.05, -0.03]
A_ineq = [[1, 1, 0], [1, 0,-1], [0, 1, 1]]
b_ineq = [7400, 6500, 0]
bnds = ((0, None), (0, None), (None, 0))
res = linprog(c, A_ub=A_ineq, b_ub=b_ineq, bounds=bnds, method='simplex')
print(res)
```