[Top][All Lists]

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

Re: [Help-glpk] Asking information on modelling conditional constraints

From: john tass
Subject: Re: [Help-glpk] Asking information on modelling conditional constraints
Date: Mon, 22 Feb 2016 16:00:25 +0200

Finally, I found the answer to the problem.
In general, both [1] and [2] are necessary to ensure the correct modelling of [Rel 1].
Nevertheless, the fact is that in my problem, the cases that all follow the form of [Rel 1] are not independent. So, by forcing both [1] and [2] to only one of them ensures that both [1] and [2] are set to all cases, even if [2] is not set explicitly.
In other words, the fact of dependency of the cases in my model, allows to set only the [1], while [2]  implicitly holds, provided that both [1] and [2] are set to only one of the total cases.
Hope that the information on this topic  will be helpful to some one and I ma sorry if I waste your time.

2016-02-22 1:44 GMT+02:00 ΤΑΣΣΟΠΟΥΛΟΣ ΙΩΑΝΝΗΣ <address@hidden>:
Good evening to everyone.
I am facing a rather peculiar situation which is as follows:
I have a MIP problem with several constraints (about five). All of them have the same type (with different parameters, though).
The form of these constraints is:
Let U denotes some integer variables (indices not included for simplicity reasons), where 
      - Lower <= U <= Upper (where -Lower and Upper depend on the variable U)
Let D be a binary variable.
I mast model the following:

D = 1 if U > 0 (i.e. 1 <= U <=Upper) and D = 0 otherwise (i.e. -Lower <= U <= 0).   [Rel 1]

I have tested the following model:

[1]  U <= Upper*D
[2] U + Lower >= (Lower + 1)*D

As it is easily verified these two constraints ensure the relation [Rel 1].
Now, I noticed that if I  exclude the second form of  constraints ([2]) from my model at all, an error occurs . To be more exact, D takes wrong value, when -Lower <= U <= 0.
At the other hand, if I include both [1] and [2], the solution is correct but the execution time is too much while the value of objective function is high. (but correct).
To make things even more complex, I noticed that when I exclude again the form [2] from all my constraints, but I keep it in only one of them, the model works perfectly. The execution is done fast and the objective value is almost optimal.
Now the question is: in order to model a condition like [Rel 1] are both [1] and [2] constraints necessary or [1] should be enough?
Thanks in advance for spending your time on my issue and for any answer.

Help-glpk mailing list

Ioannis X. Tassopoulos

reply via email to

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