Trying to add conditional constraint into LP excel

195 Views Asked by At

I have an LP equation with a condition of at least 3/4 of the constraints has to be satisfied

$z = 60X_1 + 50X_2 + 120X_3$

s.t:

$60X_1 + 40X_2 + 30X_3 >= 45$

$40X_1 + 15X_2 + 40X_3 >= 20$

$20X_1 + 40X_2 + 60X_3 >= 40$

$5X_2 + 10X_3 >= 5$

$X_1,X_2,X_3 >= 0$

How am I able to add this into Solver in Excel?

1

There are 1 best solutions below

0
On BEST ANSWER

Not sure if Solver can handle mixed-integer problems but if it can, one way is to define binary variables $c_{1},c_{2},c_{3},c_{4}$, and reformulate the constraints as

$60X_{1} + 40X_{2} + 30X_{3} >= 45c_{1} \\ 40X_{1} + 15X_{2} + 40X_{3} >= 20c_{2} \\ 20X_{1} + 40X_{2} + 60X_{3} >= 40c_{3} \\ 5X_{2} + 10X_{3} >= 5c_{4} \\ X_{1},X_{2},X_{3} >= 0\\ c_{1}+c_{2}+c_{3}+c_{4}>= 3 \\ c_{1},c_{2},c_{3},c_{4} \in \{0,1\}$