How do I model the complete weekend? “If she/he works only one of the two days, Sat and Sun, this is penalized by the corresponding weight.”

Let’s enumerate all of the combinations as shown below.

Item No. SAT SUN Penalty
1 ✓ Yes
2 ✓ Yes
3 ✓ ✓
4

Penelized cases are only items 1 and 2. We prohibit the cases above as follows. Use Sat on the first day of the pattern.



✓ is It is a complement operator(means NOT) for the shift. Since the label ‘O’ here is the day-Off, ✓O displays “Work”.

See also How do I model ‘both Saturday and Sunday on or off’ constraints? .



Load the Project File

File → Open Project File from GitHub