[Top][All Lists]

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

Re: [Help-glpk] Modelling constaints

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

Hello Ioannis.

You may be correct. As I indicated earlier, very often the objective function will drive D down to zero unless the constraints force it otherwise.  In the models I build that invariably seems to be the case.  If that doesn't apply to you or you are not 100% sure, you could add further constraints.  For example, you could have:

    D <= A
    D <= U+K

I think this would do what you need


Norman Jessup

On 28/03/2015 9:56 am, john tass wrote:
Very good idea! Thank you very much.
I would like to add though, that because I want to get D = 0 in case A = 0 or ((U <= 0 AND K <= 0), I have to add the two constraints : D <= A , D <= E.
Am I correct?
Thanks again

2015-03-28 0:24 GMT+02:00 Norman Jessup <address@hidden>:
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

reply via email to

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