limiting a variable with a lower boundary

Problems with modeling
Post Reply
player
User
User
Posts: 8
Joined: 3 years ago

limiting a variable with a lower boundary

Post by player »

Hi all,

I want to use a lower boundary for a positive variable (holdtime(i,w1,w2)) iff the flight (i) requires it.

If I use holdtime.lo(i,w1,w2)>=50, the model gives 50 secs to all flights(i). But, I just want iff the flight requires holdtime going from w1 to w2., then it can get at least 50 secs.

Code: Select all

time(i,w2) =e= time(i,w1) + parktime(i,w1) + holdtime(i,w1,w2);
player
User
User
Posts: 8
Joined: 3 years ago

Re: limiting a variable with a lower boundary

Post by player »

I have just solved, but still wondering if any more sophisticated solution. I have just added three constraints with a new binary variable;
It makes holdtime either 0 or greater than 50 secs.

Code: Select all

c11(i,w1,w2)$(ord(w1)<>ord(w2))..
holdtime(i,w1,w2) =g= 0 - m*y(i,w1,w2);

c12(i,w1,w2)$(ord(w1)<>ord(w2))..
holdtime(i,w1,w2) =l= 0 + m*y(i,w1,w2);

c13(i,w1,w2)$(ord(w1)<>ord(w2))..
holdtime(i,w1,w2) =g= 50 - m*(1 - y(i,w1,w2));
User avatar
bussieck
Moderator
Moderator
Posts: 1043
Joined: 7 years ago

Re: limiting a variable with a lower boundary

Post by bussieck »

You have implemented a semicont variable (https://www.gams.com/44/docs/UG_Languag ... sVariables). Many solvers do support them natively. But performance is usually comparable to your own binary reformulation (if your bigM is small enough).

-Michael
player
User
User
Posts: 8
Joined: 3 years ago

Re: limiting a variable with a lower boundary

Post by player »

bussieck wrote: 8 months ago You have implemented a semicont variable (https://www.gams.com/44/docs/UG_Languag ... sVariables). Many solvers do support them natively. But performance is usually comparable to your own binary reformulation (if your bigM is small enough).

-Michael
Hello Michael,

Thank you for your kind reply!
That is really good to know about semicont var. I did not have any knowledge about that.

Have a great weekend.
Post Reply