Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK - even though you have an answer, let me take a shot. </p> <p>Let's take the general problem: 7 days x 3 shifts = 21 different shifts to fill There are 7 possible employee schedules expressed as days on (1) &amp; days off (0)</p> <p>MTWTFSS 0011111 1001111 1100111 1110011 1111001 1111100 0111110</p> <p>We want to minimize the number of scheduled employees that matches the number of required hours. </p> <p>I have a matrix of number of employees of each type per shift and that number is an integer variable. My optimization model is:</p> <p>Min (number of employees)</p> <p>Subject to: sum of (# of emp sched * employee schedule) <strong>=</strong> staff required for each shift</p> <p>and </p> <p>number of employees scheduled is integer </p> <p>You can change the = sign in the first constraint to a >=. Then you'll get a feasible solution with extra staff. You can solve this in Excel with the basic SOLVER addin. </p> <p>Let's say I need four employees for each day on a shift but I'm willing to tolerate extra staff. </p> <p>A solution using the schedules above is: </p> <p>Number of staff by schedule type: 0,2,0,2,0,2,0</p> <p>Schedule types 0011111,1001111,1100111,1110011,1111001,1111100,0111110</p> <p>(In other words 2 with schedules 1001111, 2 with schedules 1111001, and 2 more with schedules 1111100)</p> <p>This results in one day (Monday) with two extra staff and 4 employees on all the other days. </p> <p>Of course, this isn't a unique solution. There are at least 6 other solutions with two extra staff members. Constraint programming would be a better and much faster approach since there will often be many feasible schedules.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload