Suppose I have a simplified problem like this
x1 = cp.Variable(boolean=True)
x2 = cp.Variable(boolean=True)
sum = x1 + x2
prob = cp.Problem(cp.Maximize(sum))
prob.solve(verbose=True)
The possible combinations of x1, x2 are (0,0),(0,1),(1,0),(1,1). How can I remove (1,1) from my feasible region, so the optimal sum could be 1 instead of 2?
I tried the following, but it didn't work.
cp.transforms.indicator([x1==1, x2==1])>=1
Just add a linear-constraint:
A more general example (from below comment):
In discrete optimization, these kind of inequalities are often coined nogoods as they are often used iteratively to forbid solutions.