I want a constraint that:
if c=0 become x=0
if c > 0 become x=1
for example:
C < = M.X or
C> = M.X or
X=exp(-M*C)
that X is binary variable and M is huge value.
This constraint is very important for me.
Please help me.
Asked
Active
Viewed 66 times
-2

AminRasi
- 9
- 2
-
3If it's so important, you must have tried very hard to find the answer yourself. It would probably save people a lot of time detailing what you tried and why it didn't work, so they didn't have to duplicate your effort. – David Richerby Jun 29 '15 at 12:12
-
1
- Binary variables don't work in linear programming; they move you into the domain of integer programming. 2) $\lceil c/(c+1) \rceil$.
– Raphael Jun 29 '15 at 12:23
1 Answers
2
Such a constraint is impossible to express in a linear program. The set of feasible solutions of a linear program is convex: if $a,b$ are feasible solutions (assignments to all variables satisfying all constraints), then so is $pa+(1-p)b$ for all $p \in [0,1]$.
In your case, let us look at the values of variables $c,x$. One feasible solution is $(c,x) = (0,0)$, and another is $(c,x) = (1,1)$ (say). Therefore $(c,x) = (1/2,1/2)$ should also be feasible, contrary to your specification.

Yuval Filmus
- 276,994
- 27
- 311
- 503