
From:  Yaron Kretchmer 
Subject:  Re: [Helpglpk] Implementing conditional amount constraints using binary variables 
Date:  Wed, 3 Jun 2009 15:41:04 0700 
Hello Yaron,
param M := 1000;
var a, >=0, <= M;
var b, >=0, <= M;
var x, binary;
minimize opt: a  .3 * b;
s.t. c0: a <= x * M;
s.t. c1: a  b <= ( 1  x ) * M;
s.t. c2: b  a <= ( 1  x ) * M;
solve;
display a, b, x;
end;
Best regards
Xypron
Yaron Kretchmer wrote:
Both a and b can be bounded by a large M.
So let me reformulate my problem:
0 <= a <= M
if a > 0 : a=b
if a=0 : 0<=b<=M
Thanks
Kretch
[Prev in Thread]  Current Thread  [Next in Thread] 