i would like to formulate a problem in linear programming and i cannot seem to be able to do it. The problem is: If A>0 then b=1 else(if A=0) then b=0,
where b is a binary variable and A>=0(integer).
Any suggestions/recommendations?
Assuming:
A
is not great)Constraints:
(1) A <= M * b
(2) b <= M * A
Check:
A = 2
(1) b = 1
(2) b free
A = 0
(1) b free
(2) b = 0
b = 1
(1) A free
(2) A > 0
b = 0
(1) A = 0
(2) A free
This pretty much follows:
x == y <-> (x -> y) & (y -> x)