[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] "0 or greater than" condition
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] "0 or greater than" condition |
Date: |
Sat, 22 Mar 2008 20:00:34 +0300 |
> You generally do this by adding a binary variable (and, of course, this
> becomes an integer program rather than a simple linear program, and
> therefore more difficult to solve).
> For example:
> var z, binary;
> s.t. condition{f in FOO, b in BAR}: sum{a in BAZ} x[f,b,a] >= 5 * z;
Probably correct formulation should be the following:
s.t. condition1{f in FOO, b in BAR}:
sum{a in BAZ} x[f,b,a] >= 5 * z;
s.t. condition2{f in FOO, b in BAR}:
sum{a in BAZ} x[f,b,a] <= u[f,b,a] * z;
where u[f,b,a] is an upper bound of x[f,b,a].
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of JohannesJ
> Sent: Saturday, March 22, 2008 10:46 AM
> To: address@hidden
> Subject: [Help-glpk] "0 or greater than" condition
> Hi all,
> I want to use the following kind of condition in GLPK:
> s.t. condition{f in FOO, b in BAR}: sum{a in BAZ} x[f,b,a] "is
> either 0 or
> greater than 5"
> Is this possible at all? If yes, do you have any hints on how I can do
> this
> in MathProg? I tried it, but couldn't figure it out.
> Thanks in advance,
> Johannes