# Python "Coffee Shop Scheduling Problem" - Scheduling Lunches/Breaks

I'm working on an employee scheduling program in python. Having never done this before, I've been researching different libraries that can be used to accomplish the task.

Unfortunately, none of the examples I have been able to find for scheduling problems (for any library) seem to address one of the most common scheduling requirements - optimally scheduling breaks and lunches.

My program is ultimately going to fit the "coffee shop scheduling" model found here: https://towardsdatascience.com/how-to-solve-a-staff-scheduling-problem-with-python-63ae50435ba4

I know how many employees I need to meet demand every hour, but it swings wildly. So I need the program to select the optimal shifts to staff, from a list of known shifts, to be able to meet all demand.

For reference, number of employees needed would look something like this:

etc.

I'd have a list of shifts to pull from, with pre-defined breaks. It's essentially a cartesian product of all acceptable shift/break/lunch combinations:

etc.,

I'm sure there are a number of ways to do this, but what would be one possible way to incorporate the break/lunch schedules into PuLP, Pyomo, or Google OR-Tools? I've researched PuLP, Pyomo, and Google OR-Tools and I'm willing to use whichever library can best solve for this problem, they all seem like they can do the rest of what I need.

• Welcome to OR.SE! I'd suggest explaining the problem in the body of your question rather than linking to a blog post that is behind a paywall and the author can remove it any time (on Medium, one can only read max 3 articles that are behind the paywall).
– EhsanK
Nov 21, 2021 at 21:24

The model you linked in the question will do the job. You just set $$a_{jt}=0$$ if a worker on shift $$j$$ would be taking a break at time $$t$$.