[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Need help using glpk API
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Need help using glpk API |
Date: |
Tue, 2 Oct 2007 16:47:08 +0400 |
> 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.
Probably like follows:
a_0 x_0 + a_1 x_1 + ... + a_n x_n <= c + M * (1 - b_0)
where M is an appropriate "big" constant.
Note that the same non-linear constraint can be modeled in different
ways.