I would like to simplify a group of repetitive constraints that appear in a model.
The aim is to ensure that a group of experts is staffed with a quantity of skills, each expert having 0..n skills.
Currently, I have to repeat the constraint for each skill in the set, but there is surely a way to simplify this with one "generic" constraint...
Relevant bit:
%Each group needs at least one expert with skill 1
constraint forall(g in Groups) (sum(e in Experts where expertskills[e,1]=1 \/ expertskills[e,2]=1) (assignment[g,e,1])>=1);
%Each group needs at least one expert with skill 2
constraint forall(g in Groups) (sum(e in Experts where expertskills[e,1]=2 \/ expertskills[e,2]=2) (assignment[g,e,2])>=1);
etc...