help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Help-glpk] Need help using glpk API


From: Becker, Basil
Subject: RE: [Help-glpk] Need help using glpk API
Date: Tue, 2 Oct 2007 14:22:07 +0200

-----Original Message-----
From: Andrew Makhorin [mailto:address@hidden 
Sent: Dienstag, 2. Oktober 2007 12:51
To: Becker, Basil
Cc: address@hidden
Subject: Re: [Help-glpk] Need help using glpk API

>> I have some problems concerning the use of glpk's API. I want to
build 
>> a complex, mixed integer problem using glpk's API and I have already 
>> figured out how to add constraints and integer respective binary 
>> variables to the problem. What I need in addition is a way to add 
>> IF...THEN...ELSE constraints. Is there a way to add these constraints

>> to a glpk program using glpk's api?
>
>
>> If I understood the GMPL language reference right these constraints 
>> exists and could be used in conjunction with glpk.
>
> No, neither glpk nor the mathprog language support constraints like
if-then-else. However, if necessary, you       > can model such
constraints using standard techniques based on binary variables.

But how do I set a binary variable's value depending on a linear
inequality. I.e. in CPLEX I would use something like: b_0 = 1 <-> a_0
x_0 + a_1 x_1 + ... + a_n x_n < c with b_0 a binary variable, a_0 ...
a_n, c constants and x_0 ... x_n either integer or continous variables.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]