I need to make a constraint for the following condition:
Among students 1, 2, 3, and 4, at least two of them must be on the team, if there are any on the team at all.
I have defined Y1, Y2, Y3, and Y4 to be 1 if student i is on the team and 0 if they are not.
My constraint looks as follows:
Y1 + Y2 + Y3 + Y4 >= 2 + MZ (where M is a very large number and Z is another binary variable) Y1 + Y2 + Y3 + Y4 = 0 + M(1-Z)
Would the constraint I wrote be correct to model this situation? Is there a way to make this constraint a single statement rather than two seperate ones?
Thanks for the help!
EDIT: Some more context: I am trying to make a linear programming model and these models cannot have "or" or "and" in them... essentially we must represent everything through equations that the solving software will try and satisfy simultaneously. Thus, the first set would not work since the computer software would try and satisfy both of them at once (since we cannot use OR). Additionally, we can only have equal signs and inequalities so your second one wouldn't work. Is there any other way to model this?