Handling office hours, lunch breaks and weekends in staff scheduling problem
09:03 09 Jan 2026

I'm modeling with MiniZinc a quite classical scheduling problem where some tasks with a given duration (in hours) have to be assigned to staff members of a company. Right now I'm just using the cumulatives constraint and minimizing the makespan and it preliminarily works. Time is measured with the granularity of hours. However, I'm not sure how to handle the fact that people do not work all the time. I need to handle correctly the fact that work happens only during office hours (e.g. 9am-5pm), not in the weekends, and not during lunch breaks and similar recurring things.

I can simulate breaks, weekends, etc. by other fake activities that always keep all the people busy. In this way, activities are not scheduled in overlap with them. However, this is too restrictive, because in this way activities cannot be started one day and resumed the next.

For example consider two activities one lasting four hours and one five hours in a 8-hours work day. With the above encoding there's no way to tell the staff member to start and finish the first activity, then work on the second one for four hours, and resume work for one hour the next morning.

I'm thinking of many possibilities but I don't have experience to anticipate how efficient each solution would be.

Is there any standard modeling approach for this sort of scenario?

mathematical-optimization minizinc