I am looking for the best way to model and solve the following linear problem using Pulp where I have conditional statements on my variables to be added to the constraints:
Here is an example:
Max (x1*100 - a*80 - b*100) + (x2*80 - c*120 - d*75)
s.t.
a + b = x1
c + d = x2
x1 > 0
x2 > 0
if x1 > 0 then x2 = 0
if x2 > 0 then x1 = 0
a, b, c, d <= 100
I have declared x1, x2, a, b, c, and d as variables in my pulp problem.
I tried to add 2 indicator functions in my obj function (one for x1 and one for x2) but they are not accepted by Pulp.
I found some good answers: Converting conditional constraints to linear constraints in Linear Programming
But do not know the exact wording to use to code it.