Page 1 of 1

Variable definition

Posted: Sun Mar 29, 2020 10:47 pm
by dunyayigezerken
Hi,

I deal with a model with these specifications;

Parameters: integer
rhs values: integer
variables: three of them is {0-1}, other is integer.

However, I try to add 3 more variables to calculate and use it other constraints. When I add them as integer variable, the problem goes to infeasible. But, when I define them as positive variables, it results with proven optimal solution (integer solution).

But, my problem nature, as you notice that, is integer, not mixed integer. What do I miss here?

Thanks,

Re: Variable definition

Posted: Mon Mar 30, 2020 8:12 am
by bussieck
Tim,

Integer variables come by default with an upper bound of 100. See https://www.gams.com/latest/docs/UG_Lan ... rVariables and also for the ways around this, e.g. "option intvarup=0;"

Hope this helps,
-Michael

Re: Variable definition

Posted: Mon Mar 30, 2020 10:49 pm
by dunyayigezerken
Hello Bussieck,

That is really logical advice, thanks for your time :)
However when I try it as " option intvarup = 0;", I get error below.

May this occur due to version difference?
Ekran Alıntısı2.JPG

Re: Variable definition

Posted: Mon Mar 30, 2020 11:40 pm
by dunyayigezerken
Hello again,

I could not manage to add it up. However, I made the limit of each variables manually by "varname.up(i) = big number"

Hence, thanks for your idea about variable boundary default,

Have a nice and healthy week,

Thanks,

Re: Variable definition

Posted: Tue Mar 31, 2020 1:08 am
by dunyayigezerken
When I use varname.up(i), the solution period is really long. Is there any problem to define them as positive variable instead of integer?
I have one integer variable so it will make the other positive variables to be integer as well. (some kind of total unimodular)

What do you think about this approach? It saves time by defining them positive variables instead of integer.

Re: Variable definition

Posted: Tue Mar 31, 2020 1:20 am
by dunyayigezerken
I mean that;

I have 4 variables in an integer programming model. If I define all as integer with variablename.up(i) = 1000 etc., solution period is increasing.

If I define three of them as positive variables and one of them as integer, model is solved within shorter period and found same optimal solution. But, I need all values for all variables as integer.

All parameters and rhs values are integer in the problem. I think total unimodular is an effect to make positive variables become integer, but I am not sure about that.

What do you think about this approach? Is it logical to define 3 of them positive variables and 1 of them integer to save time?

Re: Variable definition

Posted: Wed Jun 24, 2020 2:19 pm
by aozmen296
Hello, i also have the problem now, could you solve this out?