help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Modelling constaints


From: Norman Jessup
Subject: [Help-glpk] Modelling constaints
Date: Sat, 28 Mar 2015 09:24:59 +1100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

Hello Ioannis.

If I understand your problem correctly, you can achieve the result you need using the "Big M" method, though I think you may need to introduce some new integer variables

Let E in {0, 1} binary
M*E >= U
M*E> = K
Where M is some "large" positive constant, though in this particular case it just needs to be greater than 6.  This will force E to be positive if either U or K is positive.

D >= A + E - 1

This will require D to be positive if both A and E are positive.  Note that for this to work the objective must prefer to drive D to zero if possible, which typically turns out to be the case.  If not then you will need to add complementary constraints to drive D to zero if the conditions are not met.

On 28/03/2015 3:00 am, address@hidden wrote:
Good evening to every one,
I have a problem in modelling the following situation:
Let U, K in {-6, .. , 6} integers
Let A in {0, 1} binary
Let D in {0, 1} binary
What I want to do  is to model the condition:
D = 1, iff (U > 0 OR K > 0) AND A = 1
Otherwise, D should equal 0.
I can not figure out how to model this situation.
Can any one give me an answear or even a hint? It would be very welcome.
Thanks a lot
-- 
Norman Jessup


reply via email to

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