I have a floating-point variable x in a linear program which shall be either 0 or between two constants CONSTANT_A and CONSTANT_B:
LP.addConstraint(x == 0 OR CONSTANT_A <= x <= CONSTANT_B)
Of course there is no such thing as an explicit OR in linear programming. Is there a way to express this constraint?
semi-continuous variable. Most MIP solvers can handle this directly. It is also possible to use a binary to model this. .