Dear Gams World Forum,
i’ve looked through the Post before but found nothing similar to my problem.
In the problem, I try to define a SOS1 variable, which could look like this.
Sets
i set which represents the later "Sets" of the SOS1 Variable /1*10/
l set which represents the later "Elements" in each "Set" of the SOS1 Variable /1*50/
;
SOS1 Variable
x(i,l) SOS1-Variable consisting of 10 sets whith 50 elements each;
The next step is to ensure that the non-zero value of each set is exactly 1.
You can find the following code for this in the Gams Documentation (adapted to my definitions above):
SOS1 Variable
x(l);
Equation
defx;
defx.. sum(l, x(l)) =e= 1 ;
Applied to the problem I presented, the code could be reformulated as follows:
SOS1 Variable
x(i,l) SOS1-Variable consisting of 10 sets whith 50 elements each;
Equation
defx(i);
defx(i).. sum(l, x(i,l)) =e= 1 ;
With this formulation now each “Set” of the SOS1-Variable must have one Element with the Value “1”.
And thats where the tricky point starts . For the formulation of my model, there must be a further condition that not all, but a maximum of 5 sets for example, may contain a 1. This could be realized by an additional condition:
Equation
additionalEq;
additionalEq.. sum((i,l), x(i,l)) =e= 5;
Obviously the combination of both equations results in an infeasable model.
Therefore, my question now is whether it is possible to define the SOS1 variable in such a way that the non-zero values must be 1, but not every set needs a non-zero value (as required by the first equation).
I also attached a (sadly infeasable) minimalistic Model.
Minimal_Example.gms (1009 Bytes)
I hope i could explain my problem in a understandable way. Please excuse grammar mistakes, as english is not my mother tongue.
Thanks a lot and have a nice day.
Greetings Pinguin_Fan