SOS1 Modelling

Problems with modeling
Post Reply
Nikou
User
User
Posts: 33
Joined: 4 years ago

SOS1 Modelling

Post by Nikou »

I would like to model the following in GAMS

B(i1,j,t) + B(i2,j,t) + B(i3,j,t) =l= V , B(.,.,.) nonnegative variables and V a constant.
B(i1,j,t) * B(i2,j,t) * B(i3,j,t) =e= 0

I would like to solve the problem using SOS1 sets. The triplet B(i1,j,t), B(i2,j,t), B(i3,j,t) forms a SOS1.

How can I translate this logic in GAMS code?
User avatar
bussieck
Moderator
Moderator
Posts: 1042
Joined: 7 years ago

Re: SOS1 Modelling

Post by bussieck »

Read https://www.gams.com/latest/docs/UG_Lan ... Type1-SOS1. Move your i index to the last position in variable, i.e. B(j,t,i) and declare the variable as SOS1 variables. But the SOS1 constraint is not equivalent with B(i1,j,t)*B(i2,j,t)*B(i3,j,t)=e=0;.

-Michael
Nikou
User
User
Posts: 33
Joined: 4 years ago

Re: SOS1 Modelling

Post by Nikou »

Thank you very much!

I suppose you mean that

B(i1,j,t) * B(i2,j,t) * B(i3,j,t) =e= 0

implies that at least one of the Bs has to be zero while SOS1 means that at most one of the Bs is nonzero.
This is ok for my model.
Post Reply