Add constraints for every other day for Google OR Tools "Employee Scheduling"

161 views Asked by At

How do I add constraints to Google OR-tool example? https://developers.google.com/optimization/scheduling/employee_scheduling

I want to add this:

  • shift1: can work every day.
  • shift2: can only work every other day. Need to work 2 days in one week and must start on Monday or Tuesday.

enter image description here

.

1

There are 1 answers

1
Laurent Perron On

Just a simple implication:

work[nurse, day, shift2] => not(work[nurse, day + 1, shift2])

Now

must start on Monday or Tuesday

BoolOr([work[nurse, Monday, shifts], work[nurse, Tuesday, shift2])