Optimization Helps Scheduling Nursing Staff at the Long-Term Care Homes of the City of Toronto
Manion Anderson, Merve Bodur, Scott Rathwell, Vahid Sarhangian
OOptimization Helps Scheduling Nursing Staff at theLong-Term Care Homes of the City of Toronto
Manion Anderson, Merve Bodur, Scott Rathwell, Vahid Sarhangian
Department of Mechanical & Industrial Engineering, University of Toronto, Toronto, ON, CANADA { manion.anderson,scott.rathwell } @mail.utoronto.ca, { bodur,sarhangian } @mie.utoronto.ca The City of Toronto Long Term Care Homes & Services (LTCH&S) division is one of the largest providersof long-term care in the Canadian province of Ontario, providing care to 2,640 residents at 10 homes acrossToronto. Our collaboration with LTCH&S was initiated to facilitate the increasingly challenging task ofscheduling nursing staff and reduce high absenteeism rate observed among the part-time nurses. We devel-oped a spreadsheet-based scheduling tool to automate the generation of schedules and incorporate nurses’preferences for different shifts into the schedules. At the core of the scheduling tool is a hierarchical opti-mization model that generates a feasible schedule with the highest total preference score while satisfying themaximum possible demand. Feasible schedules had to abide by a set of complex seniority requirements whichprioritized more senior nurses when allocating the available shifts. Our scheduling tool was implementedin a 391-bed home in Toronto. The tool allowed nursing managers to generate feasible schedules within afraction of an hour, in contrast to the status-quo manual approach which could took up to tens of hours. Inaddition, the schedules successfully accounted for preferences with on average above 94% of the allocatedshifts ranked as most preferred.
Key words : Nurse scheduling, long-term care, integer programming, seniority constraints, shift preferences
1. Introduction
Background and Motivation.
The growing proportion of seniors in the population hasled to a steady increase in demand for long-term care services in North America. By 2050,the U.S. is expected to have 19 million elderly persons in need of some type of long-termcare, more than double the 9 million who required long-term care services in the year2000 (Spetz et al. 2015). As of 2016, there were 15,600 nursing homes operating 1,660,400long-term care beds throughout the country. The trend is similar in Canada. In 2018,the province of Ontario spent over C $ a r X i v : . [ c s . C Y ] F e b filling nursing shifts and 90% of care homes experienced difficulty recruiting new nursingstaff (Ontario Long Term Care Association 2019). As such, there is significant interestin improving the management of nursing resources with the goal of reducing costs andimproving the quality of care.The City of Toronto Long Term Care Homes & Services (LTCH&S) Division is one ofthe largest providers of long-term care in Ontario, providing care to 2,640 residents at 10separate homes across Toronto. The division provides 24-hour, resident-focused care andservice, from fundamental services such as personal care, medical care, and housekeeping,to specialized services such as community outreach, language and cultural partnerships,and short-stay respite beds. In order to provide consistent, high-quality care to its residents,the division employs over 3,400 staff and schedules over 573,000 shifts each year. Over two-thirds of all staff employed by the division work within the nursing department, responsiblefor providing nursing and personal care within the homes. The workforce is comprisedof Registered Nurses (RN), Registered Practical Nurses (RPN), and Personal SupportWorkers (PSW).Our collaboration with the division was initiated to address two main challenges facedby the division with respect to scheduling the required nursing staff in the long-termcare homes - in particular part-time nurses. (1) Status-quo practice involved manuallyconstructing and revising feasible schedules by nursing managers of each home. Full-timenurses were assigned to fixed rosters, but the part-time schedules needed to be constructedin each planning horizon depending on their availability and the remaining demand tobe filled. Due to the relatively large number of staff to be scheduled and the complexscheduling requirements (which we elaborate on further below), constructing and revisingschedules required a considerable effort and consumed a significant amount of time. Timewhich would ideally be spent on improving care for the residents. (2) The division faced ahigh rate of absenteeism, in particular among its part-time nursing staff. Over the course of2016, more than 12.5% of assigned shifts were not worked as scheduled due to call-ins, sickleave, vacation, and other forms of absenteeism. The status-quo scheduling practice did notaccount for nursing preferences. As a result, part-time nurses faced high-uncertainty withrespect to the number and timing of the shifts they would be allocated. Our collaboratorsat the LTCH&S division believed that this uncertainty contributed to the high absenteeismrate. Summary of the approach and contributions.
We developed a spreadsheet-basedscheduling tool to automate the process of generating schedules. The primary componentof the tool is a hierarchical optimization model. The model generates a feasible schedulethat maximizes the satisfied demand for each scheduling unit across a planning horizon of6 weeks. The model takes the (deterministic) demand over the horizon and the schedulefor full-time nurses as inputs, and assigns the available part-time nurses to the remainingshifts after allocating the full-time nurses. In addition, in order to reduce absenteeismfor part-time staff, the model incorporates the nurses’ shift preferences. (The preferencesare collected from the part-time staff prior to each scheduling cycle.) More specifically,among the schedules that achieve the maximum demand, the model returns the one(s)with maximum overall preference of the assigned nursing staff.In developing the model and solution approach we addressed a number of technical andpractical challenges, which enabled the implementation of our scheduling tool in practice.In particular, in addition to typical nurse scheduling constraints, the schedules had to abideby the so called
Armstrong seniority rules , according to which more senior nurses (i.e., whohave worked with the City for a longer time) receive higher priority when allocating thedemand. Although the motivation behind the seniority rules were known to the divisionmanagers, there was a lack of consensus with regards to certain details, in particular howthe rules were to be interpreted when in conflict with other scheduling requirements. Theinterpretation varied from home to home and even within a home in some cases. As such, wedeveloped a precise definition of the seniority rules through interviews with nurse managersand scheduling clerks, and incorporated them into our optimization model as constraints.Indeed, accounting for the seniority of staff is common when scheduling workforce and isnot unique to the City of Toronto. The seniority rules which we formalize in this work,provide a general framework for prioritizing the allocation of demand to staff with differentseniority levels and extend the previous models in the literature (see the discussion belowon related literature).To ensure the adaptation of the tool in practice, we opted to develop an Excel-baseduser interface which the scheduling staff was already familiar with. In addition, to developan inexpensive proof of concept, we decided to use an open source solver (OpenSolver).However, due to the complexity of the optimization model, in particular the large numberof constraints, the required time to generate an optimal schedule in OpenSolver became prohibitively large. As such, we also developed an approximate version of the model whichtogether with a heuristic algorithm can generate optimal or near-optimal schedules usingOpenSolver and within a reasonable time. We illustrate the quality of the generated sched-ules by comparing them with the optimal ones obtained using a commercial solver (Gurobi)for problem instances based on real data.Finally, we implemented the scheduling tool in 3 pilots at a 391-bed home in Toronto.For each pilot, we used the tool to generate a six-week schedule for two units comprisedof a total of 83-90 nurses with different specialties. In order to execute the pilots, weworked with the division to collect nursing preferences and inform nurses on the value ofincorporating their preferences into the scheduling procedure. Through these subsequentpilots we improved the scheduling tool and addressed several transitional challenges. Thepilots demonstrated the significant reduction in the amount of time spent on developingschedules (from multiple days to a fraction of a hour). In addition, the generated schedulessuccessfully incorporated preferences, with all except one scheduling pool having above92% of the allocated shifts ranked with the highest preference score.
Related literature.
There is a large body of literature on the nurse-rostering (orscheduling) problem, mainly focusing on scheduling nurses in clinical units of hospitals;see Burke et al. (2004) and De Causmaecker and Vanden Berghe (2011) for comprehensiveliterature reviews. Despite the large amount of literature related to nurse scheduling, Burkeet al. (2004) note that the majority of work is not implemented in practice nor utilizes realdata. Kellogg and Walczak (2007) find that only about 30% of the models proposed in theliterature are actually implemented. The authors indicate the lack of early communicationwith the nurses and those in charge of scheduling, lack of nurse-centered solutions, and thelimited relationships between the academics and third party scheduling software vendorsas the major contributors. In this work, we addressed such challenges by ensuring that thenurses and nurse scheduler were involved at all steps of the project from formulating theproblem to providing feedback on the schedules created; by including nursing preferencesfor shifts into the problem formulation; and by developing a spreadsheet-based softwaresolution which is easy to use and does not require the involvement of a third-party vendor.See Ovchinnikov and Milner (2008) for another example of spreadsheet-based schedulingsoftware.
Recognizing the need for better nursing management in long-term care homes, a numberof recent studies have focused on optimizing task scheduling, skill-mixes, and staffing levels.For instance, Lieder et al. (2015) present a dynamic optimization approach to minimizethe earliness and tardiness of executed care tasks from the residents’ preferred times,and Bekker et al. (2019) present a stochastic optimization approach to develop new shiftpatterns which improve the waiting times and service levels based upon fluctuating caredemand throughout the day. Slaugh et al. (2018) and Slaugh and Scheller-Wolf (2020)investigate staffing strategies to improve continuity (or consistency) of care. In contrast, inthis work we focus on optimal scheduling of part-time nurses while taking their preferencesinto account, in order to reduce absenteeism.An integral component of our model is the set of seniority rules which all schedulesmust abide by. The Armstrong seniority rules are unique to the City of Toronto, but sharesimilarities with other seniority rules proposed and studied in the literature. Caron et al.(1999) introduce seniority constraints into the classical assignment problem. They considertwo types of seniority constraints; weak and strong. The weak constraints are satisfiedwhen an unassigned person can only be scheduled by removing a scheduled shift from aperson of the same or higher seniority. The strong seniority constraints are satisfied underthe same condition but must hold for a chain of reassignments rather than individualreassignments. An individual reassignment occurs when a single shift is assigned fromone nurse to another. A chain of reassignments consists of a series of reassignments (notnecessarily associated with the same shift). Volgenant (2004) discusses the application ofthe assignment problem with seniority constraints to scheduling float nurses at a hospital.Topaloglu (2009) studies the problem of scheduling medical residents at a hospital unit. Theresidents are grouped into different seniority levels based on their experience. Residents’working preferences are taken into account using a multi-objective optimization modelwhich uses hard constraints to enforce seniority-based work rules and soft constraints toprioritize seniority when allocating workload and assigning shifts based on days of requests.The inclusion of seniority rules into our model differs from previous work along twodimensions. First, previous studies assume full availability of the workforce for the availableshifts. In contrast, in our model each nurse is available for a subset of shifts and henceavailability and seniority need to be considered jointly when assigning nurses to shifts. Inaddition, the seniority rules considered in our work are more general than those previously considered in the literature. Under Armstrong’s Seniority rules, different seniority tiers areassigned a minimum shift requirement. Once the minimum shift requirements are met,the seniority rules become similar to the seniority constraints discussed by Caron et al.(1999). The difference is that a more senior nurse must have the same or more shifts thana less senior nurse, relative to the minimum shift requirements of their corresponding tiers.The inclusion of minimum shift requirements considerably increases the complexity of themodel as the seniority must be prioritized when assigning shifts until the minimum shiftrequirements are met. This means a higher seniority employee should always receive theirminimum shift requirement before an employee of lower seniority receives even one shift.Different types of preferences have been incorporated into the nurse-scheduling problemin the literature. Bellanti et al. (2004) include preferences for which days/shifts to work onand which days/shifts to take off, Dowsland and Thompson (2000) introduce preferencesfor different shift patterns and sequences, and Bard and Purnomo (2005) assign a penaltycost depending on the degree to which individual preferences of nurses are violated. Weincorporated preferences by requiring nurses to provide a numeric score to indicate theirlow or high preference for all shifts which they are available for. We consider the totalpreference score of a feasible schedule as a measure of how favorable the schedule is and asa proxy for absenteeism. Other modeling approaches for incorporating nurse preferencesinclude using soft constraints (Berrada et al. 1996) or as an additional objective within amulti-objective optimization approach (Bard and Purnomo 2005).Here, we only account for preferences after making sure the maximum possible demand issatisfied. We do so using a hierarchical model that first finds the maximum possible demandthat can be satisfied while adhering to all the constraints, and then finds a schedule withmaximum total preference score which achieves the maximum demand and again satisfiesall the constraints. Other two-phase models have been proposed in the literature for thenurse scheduling problem, but for different purposes. Examples include obtaining feasibleschedules in the first phase and subsequently improving them in the second (Warner et al.1976), and scheduling specific portions of the schedule in the first phase (e.g., days off,vacations, or rotations) and then constructing the actual nurse schedules in the second(Valouxis et al. 2012).
Organization of the rest of the paper.
The remainder of the paper is organized asfollows. In Section 2, we provide a detailed description of our nurse scheduling problem including the objectives and the requirements that the schedules must meet. In Section 3,we outline our proposed solution approaches, with the detailed description of the optimiza-tion models and the heuristic algorithm provided in the Appendix. Section 4 provides anoverview of the user interface of our scheduling tool and provides an example of a sched-ule output. In Section 5, we describe the implementation of the scheduling tool in threepilots and present the results. Finally, we provide conclusions and a discussion of futuredirections in Section 6.
2. Problem Description
The nursing department within each home at the LTCH&S division is split into units.Each unit employs nurses with three designations; RNs, PRNs, and PSWs. Nurses in eachof the designations have a different skill set. Although RNs are in principle qualified towork as RPNs or PSWs, this is to be avoided due to concerns regarding continuity of care.As such, we do not consider scheduling across designations.Schedules are developed at the unit level and for each designation, which we refer toas a scheduling pool for the remainder of the paper. Further, schedules are developed fora six-week horizon, referred to as a cycle , which contains three two-week pay periods or blocks .Each RN, RPN, and PSW is assigned to a given scheduling pool as either a full-time orpart-time nurse. Full-time nurses are assigned a rotating schedule which repeats every sixweeks, guaranteeing the same shifts in each cycle as mandated by a collective bargainingagreement. As such, we focus on scheduling part-time nurses to fill remaining demand.The demand for each designation in each unit remains constant in time, but varies amongthe morning (7AM to 3PM), evening (3PM to 11PM), and night (11PM to 7AM) shifts.The demand for part-time nurses within a scheduling pool for a specific shift is thereforedetermined by subtracting the total number of full-time nurses scheduled for that shift,from the total demand for the shift. Although the total demand is determined by thenumber of beds in each unit and remains constant in time, the demand for part-time nursesin a unit may still vary due to vacations and leave requests of full-time nurses.Previously, within each cycle part-time nurses were required to provide their availabilityfor different shifts, without the option of specifying a higher preference for some shifts overthe others. Our proposed approach requires part-time nurses to also include a preference score for each shift they are available for. The scores take values in { , , , } with 0indicating unavailability, and a higher non-zero value indicating a higher preference. Wedefine the total preference score of a schedule as the sum of the preference scores of thescheduled part-time nurses for their assigned shifts.The scheduling problem can be described as follows. Given the demand over the cycle;find a feasible schedule (i.e., an assignment of the part-time nurses to each unit of demand)for each scheduling pool and for each shift, that conforms with the scheduling requirements,and satisfies the maximum possible demand. In addition, among feasible solutions thatsatisfy the maximum possible demand, select the (possibly non-unique) solution whichhas the maximum total preference score. In the following, we describe these hierarchicalobjectives as well the scheduling requirements in detail. We consider two possibly conflicting objectives: (1) maximizing the satisfied demand and(2) maximizing the total preference score. The process of filling the unfilled demand iscumbersome, costly, and sometimes unsuccessful. Unfilled demand results in additionalworkload for other nurses and could potentially impact the quality of care. The unfilleddemand is filled either through communication with existing nurses to see if they areable to extend their availability, work overtime, or by scheduling nurses across units andhence possibly compromising continuity of care. Therefore, we opt to prioritize demandsatisfaction over preference maximization. That is, we aim to select the schedule with themaximum total preference score among those satisfying the maximum possible demand. Indoing so, we do not explicitly account for the uncertainty in the total satisfied demand dueto absenteeism and its dependence on the provided preferences. (See Section 6 for furtherdiscussion.)
We divide the requirements into two categories; general scheduling requirements and senior-ity requirements.
General scheduling requirements.
The following requirements are mandated by thecollective bargaining agreement, and the division scheduling policies. All schedules mustsatisfy these requirements. • Availability : a nurse can only be scheduled for shifts he/she is available for. • Maximum number of assigned shifts : a nurse cannot be assigned overtime in any giventwo-week block within a six week cycle. This means that a maximum of 10 shifts can beassigned to each nurse within a two-week block. • No back-to-back shifts : a nurse cannot be scheduled for a shift within 11-hours ofanother scheduled shift. Since all shifts have the same length of 8 hours with fixed startand end times, this rule implies that any pair of shifts must be scheduled a minimum oftwo shifts apart. • Maximum Number of Weekend Shifts : a nurse cannot be scheduled for more than tenshifts on a weekend (Saturdays and Sundays) within a six-week cycle. • No overbooking : a nurse cannot be scheduled for a shift if the demand for that shifthas been filled.
Armstrong seniority requirements . The Armstrong Seniority rules (which we for-malize in this work) prescribe a method for allocating demand to part-time nurses basedupon their seniority level within their scheduling pool. Seniority rankings for each nurseare re-calculated after every scheduling cycle and can vary from cycle to cycle as nursesaccumulate working hours, or as new nurses are added and/or existing nurses are removedfrom a unit. The following elements are critical in understanding the requirements.
Armstrong tiers : Nurses in each scheduling pool are divided into four tiers using the tierallocation chart presented in Figure 1. The assignment is based on the total number ofpart-time nurses in the scheduling pool and their seniority rankings within their pool.
Minimum shift requirement : In order to generate a schedule that abides by the ArmstrongSeniority rules, each nurse must be assigned a minimum number of shifts. The minimumshift requirement is the same for all nurses of the same tier and corresponds to the numberof shifts that a nurse should receive within each of the three blocks of a cycle as longas enough demand is available. We denote the minimum shift requirement for nurse i ∈{ , . . . , n } in block k ∈ { , , } by g ik , where n is the total number of part-time nursesavailable. Armstrong Delta : The Armstrong Delta, defined for each scheduling block and eachnurse in the scheduling pool, is the total number of shifts assigned to the nurse in eachblock subtracted by their minimum shift requirement. If the Armstrong Delta is exactly 0for a nurse in a given block this means the nurse has been assigned exactly their minimumshift requirement. If the Armstrong Delta is negative the nurse has been assigned less shifts Figure 1 The Armstrong tier allocation chart: each nurse is assigned to a seniority rank based on the number ofnurses available in the pool (columns) and their seniority ranking within the pool (rows). than their minimum shift requirement, and if the Armstrong Delta is positive they havebeen assigned more shifts than their minimum shift requirement. We denote the ArmstrongDelta for nurse i in block k by δ ik . Rules : The following set of rules must hold in order for a schedule to adhere to theArmstrong Seniority rules. • Rule 1A: Prioritize seniority for shift allocation until minimum shift requirements aremet.
The first part of Rule 1 requires that a nurse in a lower seniority tier should not beassigned any shifts if a more senior nurse has not yet been assigned their minimum shiftrequirement unless an exception is occurred. (We will elaborate on the exceptions below.)Formally, δ ik < ⇒ δ i (cid:48) k ≤ − g i (cid:48) k , ∀ i ∈ { , .., n − } , i (cid:48) = { i + 1 , . . . , n } , k ∈ { , , } , (1)that is, if nurse i has a negative δ ik , then the Armstrong delta of all nurses in lower senioritytiers should be equal to the negative value of their minimum shift requirement, i.e., theyshould not be allocated any shifts. • Rule 1B: Prioritize seniority for shift allocation until minimum shift requirements aremet.
The second part of Rule 1 states that a nurse with higher seniority should not receivemore than their minimum shift requirement if any of the less senior nurses have not yetreceived their minimum shifts requirement, unless an exception has occurred. Formally, δ i (cid:48) k < ⇒ δ ik ≤ , ∀ i ∈ { , .., n − } , i (cid:48) = { i + 1 , . . . , n } , k ∈ { , , } , (2)that is, if a nurse has a negative δ ik , then the Armstrong delta of all nurses with higherseniority should not be greater than 0. • Rule 2: Prioritize sequential shift allocation once minimum shift requirements are met.
The second rule ensures that shifts are added sequentially and in the order of seniority,once all nurses have received their minimum shift requirements (unless an exception isoccurred). Formally, δ ik , δ i (cid:48) k ≥ ⇒ ( δ i (cid:48) k + 1) ≥ δ ik ≥ δ i (cid:48) k , ∀ i ∈ { , .., n − } , i (cid:48) = { i + 1 , . . . , n } , k ∈ { , , } , (3)that is, if a pair of nurses both have Armstrong delta values greater than 0, the more seniornurse should have a δ ik equal to or at most one greater than the less senior nurse. Exceptions : An exception allows an Armstrong seniority requirement or requirements tobe relaxed in order to satisfy the general scheduling requirements. For example, assumethat in a given block, a nurse with the highest seniority ranking is available for one lessshift than his/her minimum shift requirement. If Rule 1A were to be enforced strictly, noneof the nurses in the scheduling pool of lower seniority would be assigned to even a singleshift, even if there was unfilled demand. Instead, the requirement is relaxed since the nursecannot be scheduled for any more shifts without breaking the availability general schedulingrequirement. Similarly, an Armstrong seniority rule may be relaxed for a given nurse ifthey have been assigned their maximum number of assigned shifts for the block; if theyhave been assigned their maximum number of weekend shifts for the cycle; if a scheduledshift will result in back to back shifts; or if a scheduled shift will result in overbooking . Anexample detailing how the Armstrong Seniority rules and exceptions can be checked usingthe output of our scheduling tool is presented in Section 4.
3. Solution Approaches
In this section, we provide an overview of the two developed solution approaches and rele-gate the details to the Appendix. Both approaches involve sequentially solving two IntegerPrograms (IPs) - one for demand maximization and the other for preference maximization- but differ in terms of the optimality of the solution and required computational time.The implemented solution approach employs an approximate version of the Armstrongseniority rules and allocates shifts up to the minimum requirements of the seniority tiers.The remaining demand, if any, is then allocated using a heuristic algorithm. While thisapproach may lead to a sub-optimal schedule, it can generate a feasible schedule in a rea-sonable amount of time using Open Solver in Excel, even when the number of nurses in thepool is “large”. In the second approach, we model all seniority requirements in an exactmanner. This approach guarantees the optimality of the constructed schedule, but doesnot scale well as the number of nurses increases. We use the results of the exact modelin Section 5 to demonstrate the quality of the schedules generated by the implementedapproach.Figure 2 presents a context diagram of the implemented solution approach includingthe inputs and outputs of each phase. In the following we provide details of each phase(Sections 3.1 and 3.2) as well the exact solution approach (Section 3.3).
Nurse Information: • Names and ID’s • Designations and Units • Full Time/Part Time Status
Availability and Demand Information: • Part Time Nurse Availabilities • Full Time Nurse Rolling Schedules • Unit-Designation Demand
Inputs
Leave Request Information: • Vacation and leave requests
Outputs
Part-Time Schedules: • For each designation for each unit
Unfilled Shifts List: • A list of shifts unable to be filled due to the availability, demand, and constraints
Phase 1: Integer Programming Model • Objective:
Minimize Unfilled Shifts • Constraints:
General Scheduling, Approximate Armstrong Seniority
Phase 2: Integer Programming Model • Objective:
Maximize Employee Preferences • Constraints:
General Scheduling, Approximate Armstrong Seniority, Demand Satisfaction
Phase 3:Heuristic Algorithm • Objective:
Ensure Armstrong Seniority Rules Are Met • Demand Level (Phase 1 Objective) • Near-Optimal or Optimal Schedule • Unfilled Shifts
Figure 2 Context diagram of the implemented solution approach The main decision variables for both phases are binary variables indicating whether eachnurse in the scheduling pool is assigned to any of the shifts within the scheduling horizon.The objective in Phase 1 is to maximize the satisfied demand over the horizon subject tothe general scheduling and seniority requirements. The objective in Phase 2 is to maximizethe total preference score of all the assignments. In addition to the general scheduling andseniority requirement constraints, an additional constraint is included to ensure that themaximum (feasible) demand obtained in Phase 1 is achieved. That is, Phase 2 finds aschedule which maximizes the preferences while satisfying the maximum possible demand.In the implemented approach, the constraints enforce an approximate version of the Arm-strong seniority rules. The approximate constraints become exact when the total demandfor a scheduling pool is less than the sum of all minimum shift requirements for the nursesin the scheduling pool (as long as no exceptions occur). Although this is often the case forscheduling pools at the LTCH&S division, the total demand can exceed the total minimumrequirements. If this scenario occurs, the implemented (approximate) IP has a constraintwhich ensures that a nurse can only be allocated up to the same number of shifts as theirminimum shift requirement and no more. Any remaining shifts are then allocated using aheuristic algorithm which we discuss next. For details on the constraint sets of the IPs seeAppendix A.
The schedule generated in Phase 2 is used as a starting solution for the heuristic algorithmto allocate the remaining demand while adhering to the constraints. Here we provide anoverview of the idea. The full algorithm as well as a more detailed description can be foundin Appendix B.The algorithm starts by greedily assigning any unfilled demand to the most senior nursewho is available for the shift and can be scheduled without violating any of the generalscheduling requirements. (If no nurse can be assigned to the shift, it will be added to thelist of unfilled demand.) Next, it goes through all assigned shifts and checks whether eachshift can be reassigned to another nurse – who is currently not assigned to that shift but iseligible to be assigned – without violating any of the Armstrong seniority rules. Once thisprocedure is executed for all assigned shifts in the planning horizon, a single iteration of the algorithm is complete. The algorithm is then iterated multiple times until no reassignmentsare possible.The algorithm terminates after a finite number of iterations (in our experiments at mostthree iterations were sufficient) and the output schedule is guaranteed to meet the generalscheduling and Armstrong seniority rules, although it may be sub-optimal in terms of theunfilled demand and/or preferences of the nurses. (See Appendix B for details and formalarguments). In Section 5, we conduct numerical experiments using real data to demonstratethat the heuristic performs quite well compared to the exact IP model which we describenext. The exact IP model has a similar structure to the implemented one, except that theArmstrong seniority rules are exactly enforced. To this end, we developed a set of exactconstraints which utilize fifteen binary variables to ensure that all rules and exceptions areenforced simultaneously. These binary variables are used to indicate whether a nurse hashit an exception or not for a given block based upon the shift demand and all assignedshifts over the scheduling cycle. This enables Armstrong rules to be relaxed if an exceptionoccurs, so that a nurse is not preventing other nurses from receiving additional shifts. Theexact formulation provides an optimal feasible schedule for any combination of demand andavailability. The full model and further description can be found in Appendix A. Althoughthis approach provides optimal results, the binary variables are activated using a largenumber of logical constraints utilizing “big-M” constraints. These constraints are known tomake IP models challenging to solve. In Section 5 we use the exact formulation to illustratethe performance of the implemented approach for “smaller” instances of the problem.
4. User Interface
We developed the user interface in Excel using a combination of macros and user forms. Theinterface consists of five modules; Unit Management, Employee Management, AvailabilityManagement, Schedule Management, and Reporting. Each of these modules includes a setof functions which enable the user to input data, edit previously recorded data, generate aschedule, or generate reports. A screenshot of the Excel interface with functions for eachmodule is depicted in Figure 3. The Unit, Employee, and Availability Management modulesare all used to input data required for solving the IPs. Within the Unit Management module, the Create Unit function is used to create a database for each scheduling poolwithin a unit. Within the Unit Management module, the Create Employee function isused to create employee records and assign them to a scheduling pool. The Edit Employeefunction is used to edit an employee’s designation, full-time/part-time status, schedulingpool assignment, and seniority level. Within the Availability Management module, thefunctions are used to input availability and preferences of part-time nurses, as well as therolling schedule and vacation requests of full-time nurses. Figure 3 The user interface of the scheduling tool
The Reporting module is used to view and reconcile data between the Excel tool and alegacy LTCH&S employee management system. This includes making sure demand levels,nurse seniority, availability, full-time schedules, and vacation requests are all up to date.The schedule management module is used to generate part-time nurse schedules.The Generate Schedule function can be used to generate a schedule for all schedulingpools, scheduling pools within a specific unit, scheduling pools of a specific designation, orfor a specific scheduling pool. In order to generate a schedule, a scheduling cycle must beselected and an optional time limit can be provided. This time limit is for the solve timefor each of the IPs in the model. If the time limit is hit and a feasible solution has not been found then no solution is provided. Once the schedule is generated, a macro in Exceloutputs the schedule in a readable format. This consists of printing the schedule in threeseparate blocks each with the part-time demand, unfilled demand, and average preferencescore of nurses assigned to each shift. The output also includes a summary of the preferencescores for each nurse, including the percentage of assigned shifts that were most preferred,preferred, and least preferred. Finally, the output displays an unassigned shift code foreach shift in which a nurse was available, but was not assigned to that shift as well as asummary of the minimum shift requirements and the total number of shifts assigned toeach nurse in each block. Together, these outputs can be used to check that a scheduleabides by the general scheduling and Armstrong seniority requirements. A summary of theunassigned shift codes and the corresponding explanations are provided in Table 1. Table 1 Description of unassigned shift codes
Unassigned Shift Code Description
B Cannot be scheduled or else back-to-back constraintis violated (Two shifts within 11 hours of each other)D Demand has been filled by either more or lesssenior nurse(s) according to the Armstrong seniority ruleM The nurse has already received their maximumof 10 shifts within the two-week blockW The nurse has already been scheduled for the maximumof 10 weekend shifts in the six-week planning horizon
Example . Figure 4 presents an example of a generated schedule for one week of a six-week planning horizon. The full schedule including other summary measures can be foundin Appendix C. The output shown includes the assigned shifts (marked in green) to eachnurse, unassigned shifts (marked with codes presented in Table 1), part-time demand foreach shift, and the total unfilled demand in each shift (marked in red). The cells correspond-ing to weekends are shaded gray to help nursing managers check for weekend requirements.The total number of shifts assigned to each nurse, minimum shift requirements, and Arm-strong deltas is also generated as a part of the schedule output and can be found in Table2. Next, we will detail how the schedule in Figure 4 together with the summary values inTable 2 can be utilized by the nursing managers to verify that the seniority requirementsare satisfied.When examining the summary values in Table 2, at first it appears that Armstrong Rule1A is violated for the third block of the schedule. The potential violation is due to Nurse D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t Nurse 1 • W •2 • • • • M • •3 B, D D B • B D B • • B, D B, D B •4 D D B • B B, D • B D D B •5 D B, D • B, D • B, D • B, D • B, D D B, D • B, D6 D • • D7 D D D D D • B, D B, D B • B, D B, D D8 D D • D D D9 D D D D B, D B, D • B, D D D D
Part Time Demand
Unfilled Demand
Figure 4 Partial output of the scheduling tool for one week of a planning horizonTable 2 Total number of assigned shifts and Armstrong deltas for the schedule presented in Figure 4
Nurse maximum number of weekend shifts general schedulingrequirement.It also appears that Armstrong Rule 2 is in violation for the third block of the schedule.The potential violation is due to the third nurse having an Armstrong delta of zero whilethe second nurse has an Armstrong delta of two and the fourth through ninth nurses haveArmstrong deltas equal to one. It can again be verified that an exception has occurred. Inthe schedule, all shifts that the nurse was available for but remained unfilled have eithera “B” or “D” or both unassigned shift codes. The “B” shift code signifies that the shiftcould not be scheduled without breaking the no back-to-back shifts general schedulingrequirement. The “D” shift code signifies that either no demand exists for the shift or thatthe demand was filled by either more or less senior nurses according to the Armstrong seniority requirements. As long as no shifts marked with “D” can be reassigned to the thirdnurse from nurse two or nurses four through nine, the third nurse has hit an exception.Observe from Figure 4 that the third nurse has the shift code “D” for the Wednesdayevening and Friday evening shifts but neither nurse two nor nurses four through nine arescheduled for either of those shifts. Therefore, the second nurse has hit an exception andRule 2 is not violated.
5. Implementation and Results
In this section we discuss the execution of a series of pilots executed at a large care homeoperated by the City of Toronto LTCH&S division. We also present the challenges facedduring implementation and detail the quantitative and qualitative results achieved.
We conducted three pilots at a 391-bed home within the City of Toronto LTCH&S division.Two out of the seven units within the home, consisting of a total of roughly 90 full- andpart-time nurses were included in the pilots. Each pilot required a total of six schedulesto be generated for three scheduling pools (corresponding to different specialties) withineach of the two units. The size of the scheduling pools ranged from 3 to 12 nurses, which isrepresentative of the size of scheduling pools in most homes across the city. Schedules wererequired to be generated three weeks in advance of the six-week scheduling cycle in orderfor the schedules to be posted two weeks in advance as per the division’s policy. Table 3presents the timeline of the pilots.
Table 3 Timeline of the pilots
Pilot Employees Scheduling Cycle Schedule Post Date
We collected the required data for the pilots from multiple sources. The required dataincluded nursing demand, full-time nurse schedules, part-time nurse availability, and leaverequests. The demand and full-time nurse schedule data were obtained from the division’slegacy scheduling system. The legacy scheduling system ensures all human resources related data is automatically up to date and is utilized to store availability and leave data andmanage schedule changes and call-in shifts. The availability of part-time nurses during thetargeted cycles as well as leave requests had to be collected directly from the nurses. Aprocess for collecting leave requests was already in place and consequently no additionalefforts were required. While there was also an existing process for collecting availability,preferences were not collected. Therefore, we worked with the division to develop a newform and process for collecting preferences. The process of collecting preferences beganroughly seven weeks prior to the beginning of the scheduling cycle. The process consistedof a project lead distributing the new form to all part-time nurses in the units. Throughoutthe weeks leading up to the first distribution of the new ranked availability forms, wehelped the division to conduct information sessions explaining the purpose of the pilot andproviding instructions on how to fill the new forms. The forms were then collected by theproject lead three weeks prior to the start of the scheduling cycle and manually enteredinto our scheduling tool. The implementation of the new scheduling tool involved coordination with various stake-holders, revising existing procedures, and dealing with unforeseen technical challenges.When we initially began to collect ranked availability forms from the nurses, we observedthat a majority of shifts were ranked as most preferred. This may have been due to con-cerns that assigning low preference scores to shifts would lead to a smaller number of shiftseventually allocated. As such, with support from the nursing managers and in the subse-quent information sessions we clarified to the nurses that the rankings will not affect thenumber of allocated shifts, and encouraged them to provide truthful preferences.Another challenge was the poor synchronization of the processes that were used to collectand input data required by the model. The late submission of ranked availability forms inthe first pilot forced nurse managers to use historical availability data without rankings forsome nurses. Similarly, late submission of leave requests forced nurse managers to makemanual changes to the schedules generated by the model. We determined new timelines forthe subsequent pilots and improved the User Interface functions to facilitate the processof data entry. The latter was particularly challenging since the schedules had to be postedtwo weeks prior to each cycle, leaving us little time to address last-minute errors in theUser Interface or questions around the generated schedule. Finally, as alluded to earlier, formally defining the Armstrong seniority rules and con-vincing the stakeholders that the generated schedules complied with them was particularlychallenging. As we began to formally define the Armstrong seniority rules using existingdocumentation, as well as interviews with nurse managers, nurses, and scheduling clerks,we uncovered a lack of consensus with regards to the exceptions where seniority rules couldbe relaxed and whether general scheduling or Armstrong rules were to be prioritized. Weworked with all stakeholders to develop a formal definition of the seniority rules. The out-put generated by the User Interface which simplified the process of verifying seniority ruleswas instrumental in convincing the division that the generated schedules comply with theseniority rules, and in turn implementation of the tool in practice.
In order to test the quality of solutions generated by the implemented (approximate)approach, we compared its results with those of the exact IP in terms of running timeand sub-optimality of both objectives. We utilized data from the first two pilots in ourexperiments, including real preference and availability data collected from part-time nurses.As mentioned above, the number of nurses to be scheduled in each pool ranged from 3 to12. To examine how the solution time scales for larger pools we further combined data frommultiple scheduling pools to create four larger units (ranging from 19 to 22 employees).The results for the 15 scheduling pools are summarized in Table 4. For each pool andsolution approach, the table presents the total part-time demand (same for all solutionapproaches), total unfilled demand in the generated schedule, the percentage of total shiftsassigned that were most preferred, and the time it took to obtain the schedule (Run Time).Pools 1-11 are based on real availability and demand data, whereas pools 12-15 correspondto synthetic cases constructed by combining multiple scheduling pools. The results for theexact model are obtained using both Open Solver in Excel and Gurobi in Python.We observe that the implemented solution approach generates optimal or close to optimalschedules both in terms of the number of unfilled demand and the preference scores. In 8out of the 15 cases (Pools 1,2,3,4,6,7,8,11) the implemented approach provides the optimalsolution in terms of both unfilled demand and shift preferences. The percentage of firstpreferences for Pool 3 is lower compared to other pools (54%) since the model prioritizessatisfying the demand. We note however that preferences are still taken into account withthe rest of assigned shifts all having a preference score equal to two. Table 4 Performance summary of the generated schedules for 15 scheduling pools using the implementedapproach and the exact approach. TL indicates that the solver was not able to find an integer solution before the1 hour time limit per phase (not including setup time in Excel). Run times for each solution approach arereported in seconds.
Implemented Model (OpenSolver) Exact Model (OpenSolver) Exact Model (Gurobi)Pool
In two out of the remaining 7 non-optimal cases (Pools 8 and 9) the implementedapproach obtains a schedule with the optimal total unfilled demand but with a slightlylower percentage of first preference shifts. There is only one case (Pool 5) in which theimplemented model provides a schedule with both a larger unfilled demand and a lessfavorable preference score. Pool 5 corresponds to a special instance where the numberof available nurses was significantly lower than the total demand. Hence, a considerablenumber of shifts were allocated using the heuristic, leading to a sub-optimal solution. Thisscenario is an uncommon one, since the division follows strict staffing ratios to ensurethat the majority of demand can be met using the available staff. We observe that theproposed approach generates optimal or close to optimal solutions when the demand doesnot significantly exceed the available supply of part-time nurses.The implemented approach performs very well for the remaining synthetic pools(12,13,14,15), with all pools having no unfilled demand and a large percentage of firstpreference shifts assigned (above 97%). For these larger pools, the exact model did notgenerate feasible solutions within the time limit using OpenSolver and generated feasiblebut sub-optimal solutions using Gurobi. The solutions provided by Gurobi had more than85% of the total demand unfilled, compared to the implemented approach which providedschedules with zero unfilled demand. As the pool size increases, the number of constraints increases exponentially and hencerun times for the exact model could be very long, even with the commercial solver. In con-trast, the running times for the implemented solution approach scales well as the problemsize increases, and the solutions are optimal or close to optimal (for cases where the optimalsolution is known) especially when demand is less than the total minimum shift require-ments. This ability to generate high-quality schedules in a reasonable time was imperativeto the implementation of our scheduling tool in practice.
We were able to hear first hand from nurse managers, scheduling clerks, and the homeadministrators about how the scheduling tool helped to improve the scheduling process.A major improvement was the significant reduction in the amount of time required togenerate and revise a schedule. A process which could take up to tens of hours over thecourse of two weeks, was now completed within 15 minutes for the majority of schedules.This subsequently allowed the nurse manager to allocate their attention to other tasksincluding improving the quality of care for the residents of the home. Compared to manuallyconstructed schedules which could be sub-optimal (with respect to demand satisfaction)or do not meet some of the requirements, the generated schedules were also guaranteed toadhere to all scheduling requirements and satisfy the maximum possible demand.As illustrated in the previous section, the schedules achieved a high preference score, withthe majority of nurses receiving their most preferred shifts. Since absenteeism data wasnot systematically collected by the division, we were unable to conduct a formal empiricalevaluation of the impact of incorporating preferences into the schedules on the absenteeismrate. However, we expect that assigning part-time nurses to their preferred shifts wouldreduce the absenteeism rate and hence reduce costs and efforts required to fill unfilleddemand.
6. Conclusion
We developed and implemented a spreadsheet-based software to automate and optimizethe generation of schedules for nursing staff at long-term care homes of the LTCH&Sdivision of the City of Toronto. An important component of the optimization model is aset of seniority constraints, which (when possible) guarantees a minimum number of shiftsfor each seniority tier and prioritizes more senior staff (in receiving shifts) after allocating the minimum requirements. Explicit modeling of the seniority rules was crucial in makingsure the tool can be implemented. In addition, formalization of the seniority rules andincorporating them into the tool has allowed the division managers to easily examine theirimpact on the number of shifts assigned to less-senior staff.Upon successful completion of the pilots, we initiated discussions around the expansion ofthe tool to other homes. As the COVID-19 pandemic began in March 2020, major changeswere made to the staffing structure, including temporary status change of part-time nursesto full time. As such, our plans were temporarily delayed. Indeed, the pandemic and itsimpact on long-term care homes has further demonstrated the need for novel and advancedapproaches to managing nursing staff.Upon city-wide implementation of the tool, we aim to empirically measure the potentialreduction of absenteeism rate. This would require collecting pre- and post-implementationdata on the absenteeism rate among part-time staff and conducting a statistical compar-ison of the pre- and post-implementation rates. The data can be further used to betterunderstand and estimate the relationship between the provided preferences as well as othershift or nurse-related factors (see, e.g., Mudaly and Nkosi 2015) on the probability of ashift remaining unfilled. The estimated probabilities can then be directly incorporated intothe optimization model to maximize the total expected satisfied demand, e.g., through astochastic programming approach.Besides extensions to the model, integrating the spreadsheet tool with other informationsystems to automate the process of inputting the required data into the scheduling toolwould significantly facilitate its use. We plan to incorporate these features into the futureversions of the tool. References
Bard J, Purnomo H (2005) Preference scheduling for nurses using column generation.
European Journal ofOperational Research
Health Care Management Science
European Journal of Operational Research
Socio-Economic Planning Sciences
Journal of Scheduling
Operations Research
Journal of Schedul-ing
The Journal of the Operational Research Society
Interfaces
Operations Research for Health Care
Journal of Nursing Management .Ontario Ministry of Finance (2018) 2018 Ontario Budget A Plan for Care and Opportunity. https://budget.ontario.ca/2018/chapter-3c.html .Ovchinnikov A, Milner J (2008) Spreadsheet model helps to assign medical residents at the university ofvermont’s college of medicine.
Interfaces
Working paper, Available at SSRN 3555928 .Slaugh VW, Scheller-Wolf AA, Tayur SR (2018) Consistent staffing for long-term care through on-call pools.
Production and Operations Management
Health Affairs
European Journal of Operational Research
European Journal of Operational Research
EuropeanJournal of Operational Research
Operations Research
Appendix A: Integer Programming Model
The proposed model aims to find a schedule that maximizes nurse preferences while satisfying the maximumpossible demand, i.e., shifts, given nurses’ availability. The two interpretable outputs of the model are the schedule and any unfilled demand (that will need to be filled and managed outside of the model). A fewpractical assumptions (that are not limiting from the modeling perspective) are: • The model does not incur overtime. This shall be managed outside of the model. • Full-time staff already have a set schedule, thus, only part-time scheduling will be addressed. • Nurse i has higher seniority than nurse i + 1. • The first day of each week is Wednesday. • Schedules are built for a 6-week horizon which is made up of 3 two-week scheduling blocks . • Scheduled shifts are all of 8-hour length.In what follows, we provide objectives functions and constraints used in the model, for which the notation(indices, parameters, and decision variables) is given in Table 5.
Table 5:
Nomenclature
Indices: i Employee index j Shift index k Block index m Weekend index e Exception index
Sets: I Employee indices, { , . . . , n }J Shift indices, { , . . . , q }K Block indices, { , . . . , r }M Weekend indices, { , . . . , s }L m Indices of shifts that belong to weekend m E Exception types, { available, maxout, backtoback, weekend, demand } Parameters: n Number of employees in the scheduling unit q Number of shifts in each two-week scheduling block r Number of two-week scheduling blocks in 6-week scheduling horizon s Number of weekend days in each block d jk Demand for shift j in scheduling block k after adjusting for pre-scheduled shifts g ik Number of shifts guaranteed to employee i in scheduling block k based on Armstrong rule g max Maximum number of shifts a employee can be assigned per block w Minimum number of required weekend days off in scheduling horizon per employee y ijk i is available on shift j in scheduling block k ; 0 otherwise r ijk Rank of shift j in scheduling block k for employee i , where0 = unavailable, and 1 , . . . , Decision variables:
For General Scheduling Constraints:
Main Scheduling Variables: X ijk
1, if employee i is scheduled on shift j in scheduling block k ; 0 otherwise S jk Amount of unfilled demand for shift j in scheduling block k D ∗ Maximum demand that can be filled over the entire scheduling horizon
Exception Related Variables: F availableijk i can be assigned shift j as they are available; 0 otherwise F maxoutijk i can be assigned shift j without exceeding 10 shifts in block k ; 0 otherwise F backtobackijk i can be scheduled for shift j without being scheduled within two shifts ofanother scheduled shift or without already being scheduled for that shift; 0 otherwise F weekendijk i can be scheduled for shift j without exceeding 10 weekend shifts across allthree blocks in the scheduling cycle; 0 otherwise F demandijk i can be scheduled for shift j without breaking an Armstrong seniority rule,i.e., if the demand of the shift has not been filled by more senior employees; 0 otherwise F ijk F availableijk , F maxoutijk , F backtobackijk , F weekendijk , F demandijkp are all equal to 1; 0 otherwise M ik i is unable to be scheduled for any more shifts in block k ; 0 otherwise For Approximate Armstrong Constraint Set: σ ik i is assigned their minimum shift requirement or an exception has occurred( M ik = 1) in scheduling block k ; 0 otherwise For Approximate and Exact Armstrong Constraint Sets: θ ik i has met or exceeded their minimum shift requirement in block k ;0 otherwise For Exact Armstrong Constraint Set: δ ik The difference between the minimum shift requirement and the number of shifts assignedfor employee i in block kπ ik i has exceeded their minimum shift requirement in block k ( δ ik ≥ α ik i has not met their minimum shift requirement and is available to be scheduledfor additional shifts in block k ; 1 otherwise β ii (cid:48) k i and i (cid:48) have met or exceeded their minimum shift requirement andemployee i is available to be scheduled for additional shifts in block k ; 1 otherwise γ ii (cid:48) k i and i (cid:48) have met or exceeded their minimum shift requirement andemployee i (cid:48) is available to be scheduled for additional shifts in block k ; 1 otherwise a ijk π ik = 0 and X ijk = 1 for shift j in block k for employee i ; 0 otherwise b ii (cid:48) jk a ijk = 1 and θ i (cid:48) k = 0 for shift j in block k for employees i and i (cid:48) ; 0 otherwise F Demand − ijk (cid:80) i − i (cid:48) =0 b ii (cid:48) jk < D jk for shift j in block k for employee i ; 0 otherwise l ii (cid:48) k δ ik ≤ δ i (cid:48) k + 1 for block k for employees i and i (cid:48) ; 0 otherwise t ii (cid:48) k δ i (cid:48) k ≤ δ ik for block k for employees i and i (cid:48) ; 0 otherwise h ii (cid:48) jk l ii (cid:48) k = 1 and X ijk = 1 for shift j in block k for employees i and i (cid:48) ; 0 otherwise u ii (cid:48) jk t ii (cid:48) k = 1 and X i (cid:48) jk = 1 for shift j in block k for employees i and i (cid:48) ; 0 otherwise p ii (cid:48) jk h ii (cid:48) jk = 1 and θ i (cid:48) k = 1 for shift j in block k for employees i and i (cid:48) ; 0 otherwise v ii (cid:48) jk u ii (cid:48) jk = 1 and θ ik = 1 for shift j in block k for employees i and i (cid:48) ; 0 otherwise F Demand + ijk (cid:80) i − i (cid:48) =0 n i (cid:48) ijk + (cid:80) ni (cid:48) = i +1 v ii (cid:48) jk < D jk for shift j in block k for employee i ; 0 otherwise A.1. Objective Functions
The integer program is executed in two separate stages, each has a different objective function.
Stage 1.
In the first stage, we find the maximum demand that can be met with the availability providedby nurses: min (cid:88) j ∈J (cid:88) k ∈K S jk The total demand subtracted by the optimal objective value of the first phase is equal to D ∗ .7 Stage 2.
In the second stage, we maximize nurse preferences while fulfilling the maximum demand thatcan be met with the availability provided by nurses, D ∗ . So, the objective is as follows:max (cid:88) i ∈I (cid:88) j ∈J (cid:88) k ∈K r ijk X ijk A.2. Constraints
In this section, we provide all the model constraints whose explanations can be found in Section A.3. Forbrevity, we omit the respective domains I , J , K of the i, j, k indices in the forall parts of the constraints. Weuse I ( · ) to denote the indicator function, which returns 1 if the provided logical condition as the argumentin the subscript is true, and 0 otherwise. General Scheduling Constraints. d jk − S jk − (cid:88) i ∈I X ijk = 0 ∀ j, k (1) X ijk ≤ y ijk ∀ i, j, k (2) j (cid:88) j (cid:48) = j − (cid:0) I ( j (cid:48) ≥ X i,j (cid:48) ,k + I ( j (cid:48) ≤ X i,q + j (cid:48) ,k − (cid:1) ≤ ∀ i, j, k (3) F availableijk = y ijk ∀ i, j, k (4) (cid:88) j (cid:48) ∈J X ij (cid:48) k ≤ g max − F maxoutijk ∀ i, j, k (5) (cid:88) j (cid:48) ∈J X ij (cid:48) k ≥ g max (1 − F maxoutijk ) ∀ i, j, k (6) j +2 (cid:88) j (cid:48) = j − (cid:0) I ( j (cid:48) ∈J ) X ij (cid:48) k + I ( j (cid:48) ≤ X i,q + j (cid:48) ,k − + I ( j (cid:48) ≥ q +1) X i,j (cid:48) − q,k +1 (cid:1) ≤ − F backtobackijk ) ∀ i, j, k (7) j +2 (cid:88) j (cid:48) = j − (cid:0) I ( j (cid:48) ∈J ) X ij (cid:48) k + I ( j (cid:48) ≤ X i,q + j (cid:48) ,k − + I ( j (cid:48) ≥ q +1) X i,j (cid:48) − q,k +1 (cid:1) ≥ − F backtobackijk ∀ i, j, k (8) F weekendijk = 1 ∀ i, k, j / ∈ (cid:91) m ∈M L m (9) (cid:88) m (cid:48) ∈M (cid:88) j (cid:48) ∈L m (cid:48) (cid:88) k (cid:48) ∈K X ij (cid:48) k (cid:48) ≤ s · r − w − F weekendijk ∀ i, k, j ∈ (cid:91) m ∈M L m (10) (cid:88) m (cid:48) ∈M (cid:88) j (cid:48) ∈L m (cid:48) (cid:88) k (cid:48) ∈K X ij (cid:48) k (cid:48) ≥ ( s · r − w )(1 − F weekendijk ) ∀ i, k, j ∈ (cid:91) m ∈M L m (11) (cid:88) e ∈E (1 − F eijk ) ≥ − F ijk ∀ i, j, k (12) (cid:88) e ∈E (1 − F eijk ) ≤ (1 − F ijk ) |E| ∀ i, j, k (13) (cid:88) j ∈J F ijk ≥ − M ik ∀ i, k (14) F ijk ≤ − M ik ∀ i, j, k (15) Stage Two Additional General Scheduling Constraint. (cid:88) j ∈J (cid:88) k ∈K S jk ≤ (cid:88) j ∈J (cid:88) k ∈K D jk − D ∗ (16)8 Approximate Armstrong Constraints Set F demand jk ≤ d jk ∀ j, k (17) d jk ( F demand jk − ≥ ∀ j, k (18) i − (cid:88) i (cid:48) =1 X i (cid:48) jk ≤ d jk − F demandijk ∀ i (cid:54) = 1 , j, k (19) i − (cid:88) i (cid:48) =1 X i (cid:48) jk ≥ d jk (1 − F demandijk ) ∀ i (cid:54) = 1 , j, k (20) σ ik ≥ σ ( i +1) k ∀ i (cid:54) = n, k (21) θ ik + M ik ≥ σ ik ∀ i, k (22) (cid:88) j ∈J X ijk ≥ g ik θ ik ∀ i, k (23) (cid:88) j ∈J X ijk ≤ g ik σ ik + ( g ik − − σ ik ) ∀ i, k (24) Exact Armstrong Constraint Set (cid:88) j ∈J X ijk − g ik = δ ik ∀ i, k (25) δ ik ≥ − g ik (1 − θ ik ) ∀ i, k (26) δ ik ≤ (10 − g ik ) θ ik − ∀ i, k (27) α ik ≤ M ik + θ ik ∀ i, k (28) δ i (cid:48) k + g i (cid:48) k ≤ α ik g max ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (29) δ ik ≤ (10 − g ik ) α i (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (30) β ii (cid:48) k ≤ (1 − θ ik ) + (1 − θ i (cid:48) k ) + M ik ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (31) γ ii (cid:48) k ≤ (1 − θ ik ) + (1 − θ i (cid:48) k ) + M i (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (32)( δ ik − − δ i (cid:48) k ≤ γ ii (cid:48) k (10 − g ik + g i (cid:48) k − ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (33) δ i (cid:48) k − δ ik ≤ β ii (cid:48) k (10 − g i (cid:48) k + g ik ) ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (34) δ ik ≥ − ( g ik + 1)(1 − π ik ) ∀ i, k (35) δ ik ≤ (10 − g ik ) π ik ∀ i, k (36) a ijk ≤ − π ik ∀ i, j, k (37) a ijk ≤ X ijk ∀ i, j, k (38) a ijk ≥ X ijk − π ik ∀ i, j, k (39) b ii (cid:48) jk ≤ − θ i (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (40) b ii (cid:48) jk ≤ a ijk ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (41) b ii (cid:48) jk ≥ a ijk − θ i (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (42) i − (cid:88) i (cid:48) =0 b i (cid:48) ijk ≤ D jk − F Demand − ijk ∀ i, j, k (43)9 i − (cid:88) i (cid:48) =0 b i (cid:48) ijk ≥ D jk (1 − F Demand − ijk ) ∀ i, j, k (44) δ ik − (10 − g ik + g i (cid:48) k + 1)(1 − l ii (cid:48) k ) ≤ δ i (cid:48) k + 1 ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (45) δ ik + (10 − g i (cid:48) k + g ik + 2) l ii (cid:48) k ≥ δ i (cid:48) k + 2 ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (46) h ii (cid:48) jk ≤ l ii (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (47) h ii (cid:48) jk ≤ X ijk ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (48) h ii (cid:48) jk ≥ X ijk − (1 − l ii (cid:48) k ) ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (49) p ii (cid:48) jk ≤ h ii (cid:48) jk ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (50) p ii (cid:48) jk ≤ θ i (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (51) p ii (cid:48) jk ≥ θ i (cid:48) k − (1 − h ii (cid:48) jk ) ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (52) δ i (cid:48) k − (10 − g i (cid:48) k + g ik )(1 − t ii (cid:48) k ) ≤ δ ik ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (53) δ i (cid:48) k + (10 − g ik + g i (cid:48) k + 1) t ii (cid:48) k ≥ δ ik + 1 ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , k (54) u ii (cid:48) jk ≤ t ii (cid:48) k ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (55) u ii (cid:48) jk ≤ X i (cid:48) jk ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (56) u ii (cid:48) jk ≥ X i (cid:48) jk − (1 − t ii (cid:48) k ) ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (57) v ii (cid:48) jk ≤ u ii (cid:48) jk ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (58) v ii (cid:48) jk ≤ θ ik ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (59) v ii (cid:48) jk ≥ θ ik − (1 − u ii (cid:48) jk ) ∀ i (cid:54) = n, i (cid:48) ≥ i + 1 , j, k (60) i − (cid:88) i (cid:48) =0 n i (cid:48) ijk + I (cid:88) i (cid:48) = i +1 v ii (cid:48) jk ≤ D jk − F Demand + ijk ∀ i, j, k (61) i − (cid:88) i (cid:48) =0 n i (cid:48) ijk + I (cid:88) i (cid:48) = i +1 v ii (cid:48) jk ≥ D jk (1 − F Demand + ijk ) ∀ i, j, k (62) F Demandijk ≤ F Demand − ijk + θ ik ∀ i, j, k (63) F Demandijk ≤ F Demand + ijk + (1 − θ ik ) ∀ i, j, k (64) F Demandijk ≥ F Demand + ijk + ( θ ik − ∀ i, j, k (65) F Demandijk ≥ F Demand − ijk − θ ik ∀ i, j, k (66) A.3. Constraint Descriptions
The following is a description for each constraint of the General and Armstrong scheduling constraint sets.
General Scheduling Constraint Descriptions. (1) The total supply (total shifts assigned plus unfilled demand) must equal to the demand for any givenshift.(2) A nurse cannot be scheduled if they are not available.(3) A shift cannot be scheduled within two shifts of another scheduled shift for the same nurse. Note thatfor a given block k , if j (cid:48) = 0 and j (cid:48) = − j (cid:48) preceding j corresponds to the last (i.e., q th ) and0the second to the last (i.e., ( q − th ) shift of the block k −
1, respectively, thus the shift index in the secondterm in parenthesis is q + j (cid:48) . For k = 1, those previous shifts are considered as the status parameters of thenurse for the last two shifts of the previous planning horizon.(4) If a nurse is available for a given shift set F availableijk to 1 for that shift for that nurse otherwise set to0. ( F available variables are introduced for notational consistency with the other exception related variables.)(5) A nurse cannot be assigned more than g max shifts but if they are assigned exactly g max shifts in agiven block then set the F maxoutijk variable to 0 for all shifts in the given block for that nurse.(6) Given a shift and a nurse, if the nurse is assigned less than g max shifts for the block in which the shiftfalls, then set F maxoutijk variable to 1.(7) Given a shift and a nurse, if the nurse has been scheduled for at least one shift within two shifts of thegiven shift, the left-hand side of the constraint amounting to at least 1 out of 5 consecutive shifts considered,then set the F backtobackijk variable to 0. (Note: The indicator variables account for back-to-back shifts whichspan between two-week blocks in the six-week horizon.)(8) Given a shift and a nurse, if a nurse has not been scheduled for a shift within two shifts of the givenshift, set the F backtobackijk variable to 1.(9) For all shifts which do not fall on a weekend, set the F weekendijk variable to 1 for all nurses.(10) Given a weekend shift and a nurse, if the nurse has been scheduled for the maximum number ofweekend shifts allowable over the six-week horizon, s · r − w (i.e., the total number of weekend shifts minusthe minimum number of required weekend days off), set the F weekendijk variable to 0 for that shift.(11) Given a weekend shift and a nurse, if the nurse has not yet been scheduled for the maximum numberof weekend shifts allowable over the six-week horizon, set the F weekendijk variable to 1.(12) For a given nurse and a given shift, if all F ijk exception variables ( F availableijk , F demandijk , F backtobackijk , F maxoutijk , F weekendijk ) for that nurse and shift are equal to 1, set F ijk to 1.(13) For a given nurse and a given shift, if any F ijk exception variables ( F availableijk , F demandijk , F backtobackijk , F maxoutijk , F weekendijk ) for that nurse and shift are equal to 0, set F ijk to 0.(14) For a given nurse, if all F ijk variables in a given block are equal to 0, then the nurse cannot get anymore shifts, thus set M ik equal to 1 for that nurse and block.(15) If the F ijk variable for a given nurse and shift is equal to 1, set M ik equal to 0 for that nurse for theblock which the shift belongs to.(16) The total unfilled demand across the six-week scheduling horizon for the second stage should be lessthan or equal to the total demand over the horizon minus the maximum demand that can be filled over thehorizon with the availability provided by nurses. This constraint ensures that demand is not left unfilled inorder to improve the preference of shifts assigned. Approximate Armstrong Constraint Set Descriptions. (17) If the demand is 0 for a given shift, set the F demandijk variable to 0 for the highest seniority nurse.(18) If the demand is greater than or equal to 1 for a given shift, set the F demandijk variable to 1 for thehighest seniority nurse.1(19) Given a nurse who is not the highest seniority nurse, if the total number of shifts assigned to allnurses of higher seniority than the given nurse is equal to the demand for a given shift, then set the F demandijk variable to 0.(20) Given a nurse who is not the highest seniority, if the total number of shifts assigned to all nurses ofhigher seniority than the given nurse is less than the demand for a given shift, then set the F demandijk variableto 1.(21) Ensure that higher seniority nurses are being assigned their minimum shift requirement or hit anexception before lower seniority nurses.(22) If θ ik and M ik are both 0 for a given nurse and block, σ ik must also equal to 0 for that nurse in thatblock, indicating that the nurse has not hit their minimum shift requirement nor an exception.(23) If a nurse is assigned their minimum shift requirement in a given block, their θ ik variable must beset to 1 for that block.(24) If σ ik is set to 1 for a given nurse and block then the nurse can be assigned at most their minimumshift requirement, otherwise if σ ik is set to 0, the nurse should be assigned strictly less than their minimumshift requirement. (Note that if the second part of the right-hand-side is removed, the approximation becomesexact for the case where total demand is less than or equal to total minimum shift requirement). Exact Armstrong Constraint Set Descriptions. (25) For a given nurse, set δ ik as the difference between the shifts assigned to the nurse in a given blockminus their minimum shift requirement for that block.(26) If δ ik is less than 0, enforce θ ik to be 0.(27) If δ ik is greater than or equal to 0, enforce θ ik to be 1.(28) If θ ik and M ik are equal to 0 for a given nurse and block, α ik must also be equal to 0.(29) If α ik is equal to 0 for a given nurse and block, each nurse with less seniority than them should havea δ ik equal to the negative of their minimum shift requirement.(30) If α ik is equal to 0 for a given nurse and block, each nurse with more seniority than them should nothave an Armstrong delta which exceeds 0.(31) If both nurse i and i (cid:48) (where i ≤ i (cid:48) + 1) have met or exceeded their minimum shift requirement ( θ ik = 1, θ i (cid:48) k = 1) and nurse i can still be scheduled without hitting an exception ( M ik = 0) then set β ii (cid:48) k = 0.(32) If both nurse i and i (cid:48) (where i ≤ i (cid:48) + 1) have met or exceeded their minimum shift requirement ( θ ik = 1, θ i (cid:48) k = 1) and nurse i (cid:48) can still be scheduled without hitting an exception ( M i (cid:48) k = 0) then set γ ii (cid:48) k = 0.(33) If γ ii (cid:48) k is equal to 0, then δ ik should be at most one greater than δ i (cid:48) k .(34) If β ii (cid:48) k is equal to 0, then δ ik should be greater than δ i (cid:48) k .(35) If δ ik is less than or equal to 0, enforce π ik to be 0.(36) If δ ik is greater than 0, enforce π ik to be 1.(37) If π ik is 1, enforce a ijk to be 0.(38) If X ijk is 0, enforce a ijk to be 0.(39) If X ijk is 1 and π ik is 0, enforce a ijk to be 1.(40) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if θ i (cid:48) k is 1, enforce b ii (cid:48) jk to be 0.2(41) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if a ijk is 0, enforce b ii (cid:48) jk to be 0.(42) If a ijk is 1 and θ i (cid:48) k is 0, enforce b ii (cid:48) jk to be 1.(43) For nurse i and shift j in block k, if the sum of all b i (cid:48) ijk variables for all nurses i (cid:48) who are more seniorto nurse i is equal to the demand for that shift, set F Demand − ijk to 0.(44) For nurse i and shift j in block k, if the sum of all b i (cid:48) ijk variables for all nurses i (cid:48) who are more seniorto nurse i is less than the demand for that shift, set F Demand − ijk to 1.(45) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if δ ik is greater than δ i (cid:48) k + 1 set l i (cid:48) ik to 0.(46) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if δ ik is less than or equal to δ i (cid:48) k + 1 set l i (cid:48) ik to 1.(47) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if l ii (cid:48) k is 0, enforce h ii (cid:48) jk to be 0.(48) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if X ijk is 0, enforce h ii (cid:48) jk to be 0.(49) If X ijk is 1 and l ii (cid:48) k is 1, enforce h ii (cid:48) jk to be 1.(50) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if h ii (cid:48) jk is 0, enforce p ii (cid:48) jk to be 0.(51) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if θ i (cid:48) k is 0, enforce p ii (cid:48) jk to be 0.(52) If θ i (cid:48) k is 1 and h ii (cid:48) jk is 1, enforce h ii (cid:48) jk to be 1.(53) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if δ i (cid:48) k is greater than δ ik set t i (cid:48) ik to 0.(54) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if δ i (cid:48) k is less than or equal to δ ik set t i (cid:48) ik to 1.(55) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if t ii (cid:48) k is 0, enforce u ii (cid:48) jk to be 0.(56) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if X i (cid:48) jk is 0, enforce u ii (cid:48) jk to be 0.(57) If X i (cid:48) jk is 1 and t ii (cid:48) k is 1, enforce u ii (cid:48) jk to be 1.(58) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if u ii (cid:48) jk is 0, enforce v ii (cid:48) jk to be 0.(59) For nurses i and i (cid:48) (where i ≤ i (cid:48) + 1), if θ ik is 0, enforce v ii (cid:48) jk to be 0.(60) If θ ik is 1 and u ii (cid:48) jk is 1, enforce v ii (cid:48) jk to be 1.(61) For an nurse i and shift j in block k , if the sum of all n i (cid:48) ijk variables for all nurses i (cid:48) who are moresenior to nurse i plus the sum of all v i (cid:48) ijk variables for all nurses i (cid:48) who are less senior to nurse i is equal tothe demand for that shift, set F Demand + ijk to 0.(62) For an nurse i and shift j in block k , if the sum of all n i (cid:48) ijk variables for all nurses i (cid:48) who are moresenior to nurse i plus the sum of all v i (cid:48) ijk variables for all nurses i (cid:48) who are less senior to nurse i is less thanthe demand for that shift, set F Demand + ijk to 1.(63) For a nurse i and shift j in block k , if F Demand − ijk is 0 and θ ik is 0, set F Demandijk to 0.(64) For a nurse i and shift j in block k , if F Demand + ijk is 0 and θ ik is 1, set F Demandijk to 0.(65) For a nurse i and shift j in block k , if F Demand + ijk is 1 and θ ik is 1, set F Demandijk to 1.(66) For a nurse i and shift j in block k , if F Demand − ijk is 1 and θ ik is 0, set F Demandijk to 1.
A.4. IP Descriptions
The approximate and exact models both use a similar two-stage approach to solve the problem each witha different set of constraints. The main decision variables for both IPs are the nurse schedules ( X ijk ) andunfilled demand ( S jk ). They include a large set of binary indicator variables to represent certain logicalconditions in a linear fashion (via the so-called big-M constraints). In the first phase of both models theoutputted schedule is insignificant, as the main objective of this phase is to determine the minimum amount3of unfilled demand that be scheduled while meeting all of the general scheduling constraints and ArmstrongSeniority constraints. The general scheduling constraints are enforced in both IPs using the F ijk exceptionvariables. These variables help to ensure that nurse availability is respected ( F availableijk ), no overtime isincurred ( F maxoutijk ), back-to-back shifts are not assigned ( F backtobackijk ), nurses do not exceed a certain numberof weekend shifts ( F weekendijk ), and nurse demand is never exceeded ( F demandijk ). If any one or more of theseexception variables is activated (set to 0) for a given shift j in a block k and employee i , the employee cannotbe assigned the shift, which is indicated by the F ijk variable being set to 0. If employee i is unable to getmore shifts in block k than what is assigned in a solution, M ik variable is activated (set to 1).There are two sets of Armstrong Seniority constraints, the first set is the approximate Armstrong constraintset which enforces an approximation of the Armstrong rule and must be utilized in tandem with the heuristicalgorithm in order to ensure that the Armstrong seniority requirements are met. The second set is the exactArmstrong constraint set which is an exact formulation of the Armstrong seniority requirements. In thesecond phase of both approaches, the objective is to maximize the overall shift preferences of the nurseswhile meeting the maximum demand level that can be met found in the first phase, while satisfying thegeneral scheduling and Armstrong Seniority constraints. Detailed constraint descriptions can be found insection A.3.The approximate Armstrong constraint set is utilized in the IP formulation for the implemented approach.The main logic of this constraint set is to prioritize seniority while assigning each nurse as many shifts aspossible up to their minimum shift requirement, but no more than their minimum shift requirement. Eachnurse can only be assigned their minimum shift requirement if the nurse directly senior to them has beenassigned their minimum shift requirement or if they cannot be scheduled for any additional shifts withoutbreaking a general scheduling rule. This is accomplished by this σ ik variables; specifically if nurse i has nothit their minimum shift requirement in block k nor an exception, σ ik is set to 0, which in turns sets σ · k variables for all the lower seniority nurses, thus blocks them to receive any shifts at all. This constraintset is an approximation for two reasons: (1) It does not allow nurses to be assigned more shifts than theirminimum shift requirement and (2) it allows a nurse of lower seniority to be assigned up to one less thantheir minimum shift requirement even if the nurse(s) senior to them have not been assigned their minimumshift requirement. Due to these factors, the resulting schedule may not always abide by the Armstrongscheduling rules, therefore the heuristic algorithm is used to ensure a feasible schedule. Note that if thesecond part of the right-hand side of constraint (24) is removed, this approximation becomes exact for thecase in which total demand is less than or equal to total minimum shift requirements. However, it mightlead to a computationally challenging model (which is indeed observed in our numerical experiments).The exact Armstrong constraint set is implemented in the Exact IP model. This set ensures the Armstrongseniority requirements are met and an optimal feasible solution is provided for any combination of availabilityand demand provided. The main logic of this constraint set revolves around the Armstrong delta ( δ ik )variables and a large set of layered binary indicator variables which together are used to activate the F Demandijk variable for a given employee, block, and shift. Put simply, the F Demandijk variable indicates whether or not anemployee is available to be scheduled for a shift based upon whether or not the demand is filled according to4the Armstrong scheduling rules. The F Demandijk variable is activated by the F Demand − ijk and F Demand + ijk variables.The F Demand − ijk variable is used to indicate whether an employee is available to be scheduled for a shift if theyhave been assigned less than their minimum shift requirement and is activated based upon the number ofshifts assigned to employees of higher seniority who are also available for the shift. The F Demand + ijk variableis used to indicate whether an employee is available to be scheduled for a shift if they have been assignedexactly or more than their minimum shift requirement and is activated based upon the number of shiftsassigned to employees of higher and lower seniority who are also available for the shift. The F Demandijk variables(along with the other F ijk exception variables) are used to activate the F ijk variables, which are then used toactivate the M ik variables. The M ik variable indicates if an employee has hit an exception and is unable tobe scheduled for any additional shifts in a given block without breaking a general scheduling or Armstrongseniority requirement. The entire F Demandijk logic is needed due to the introduction of the minimum shiftrequirements and the Armstrong seniority rules. This variable helps keeping track of whether a shift canbe assigned to a nurse based upon the set of all other assigned shifts in the schedule. More specifically, ifemployee i is eligible to receive shift j of block k considering all the exceptions other than the demand,but has not received the shift, then the other employees who are eligible to fill that shift are taken intoconsideration. If the nurse has not hit their minimum shift requirement for the block, then only their seniorsare eligible to fill the shift. On the other hand, if the nurse i has δ ik ≥
0, then a more senior nurse i (cid:48) is eligibleto fill the shift if δ i (cid:48) k ≤ δ ik + 1, whereas a less senior nurse i (cid:48) is eligible if δ i (cid:48) k ≤ δ ik . The F Demandijk variable iscorrectly activated based on the status of those eligible nurses.
Appendix B: Heuristic Algorithm
The heuristic, provided in Algorithm 1, takes the schedule outputted by the IP model as an input. It begins byattempting to assign each unfilled shift to the most senior eligible nurse, if any, and updates the assignments,as well as the eligibility and exception variables (Steps 2-8). Once all of the unfilled demand that is ableto be filled is assigned, the shift reassignment phase of the heuristic begins. In this phase of the algorithm(Steps 9-30), the schedule is gradually modified in order to satisfy the Armstrong requirements. This phaseconsists of a check and reassign routine which loops over all the shifts and for each shift considers all nursepairs with one nurse assigned and the other not assigned to the shift, but eligible to be assigned. The routinechecks to see whether the nurse who is currently assigned the shift is the more senior or less senior nurse. Ifthe shift is assigned to the more senior nurse, it checks whether the less senior nurse should be reassignedthe shift. The less senior nurse will be reassigned the shift if either (1) the less senior nurse has nonnegativeArmstrong delta, and the more senior nurse has at least two more shifts than the less senior nurse, or (2) themore senior nurse has a positive Armstrong delta and the less senior nurse has a negative Armstrong delta. Ifthe shift is assigned to the less senior nurse, it checks whether the more senior nurse should be reassigned theshift. The more senior nurse will be reassigned the shift if (1) both nurses have a positive Armstrong deltaand the less senior nurse has an Armstrong delta greater than the more senior nurse; (2) the less senior nursehas a positive Armstrong delta and the more senior nurse has an Armstrong delta of zero; or (3) the moresenior nurse has a negative Armstrong delta. If any of these scenarios occur then one of the Armstrong rulesis violated and the shift is reassigned to the other nurse. Once this procedure is executed for all assigned5shifts, a single iteration is complete. The procedure is then repeated for a number of times set by the user(Iteration Limit). The outputs of the heuristic include the final schedule ( X ijk variables), unfilled demand( S jk variables), and all exception status ( F ijk variables). Algorithm 1
Heuristic Algorithm Inputs:
Schedule, Exception Variables, Unfilled Demand, Demand, Iteration Limit2: for each block k ∈ K do for each shift j ∈ J do for each nurse i = 1 , . . . , n do if Not all shifts have been assigned and the nurse is able to be scheduled without breaking a generalscheduling rule ( S jk > F ijk = 1) then X ijk = 1 (Assign the shift to the nurse)7: S jk = S jk −
18: Update δ ik and F ijk variables9: Set Swaps = 110: while Swaps > do
11: Set Swaps = 012: for each block k ∈ K do
13: Update δ ik variables14: for each shift j ∈ J do if D jk > then for each nurse i (cid:48) = 1 , . . . , n − do for each nurse i (cid:48)(cid:48) = i (cid:48) + 1 , . . . , n do if X i (cid:48) jk = 1 & F i (cid:48)(cid:48) jk = 1 then if δ i (cid:48) k > δ i (cid:48)(cid:48) k ≥ then if δ i (cid:48) k - δ i (cid:48)(cid:48) k > then
21: Set X i (cid:48) jk = 0, X i (cid:48)(cid:48) jk = 1, Swaps = Swaps + 122: else if δ i (cid:48) k > δ i (cid:48)(cid:48) k < then
23: Set X i (cid:48) jk = 0, X i (cid:48)(cid:48) jk = 1, Swaps = Swaps + 124: if X i (cid:48)(cid:48) jk = 1 & F i (cid:48) jk = 1 then if δ i (cid:48)(cid:48) k > δ i (cid:48) k > then if δ i (cid:48)(cid:48) k - δ i (cid:48) k > then
27: Set X i (cid:48)(cid:48) jk = 0, X i (cid:48) jk = 1, Swaps = Swaps + 128: else if ( δ i (cid:48)(cid:48) k > δ i (cid:48) k = 0) OR ( δ i (cid:48) k < then
29: Set X i (cid:48)(cid:48) jk = 0, X i (cid:48) jk = 1, Swaps = Swaps + 130: Update δ ik and F ijk variables31: Outputs:
Schedule, Unfilled Demand, Exception Variables
The heuristic stopping criteria is based upon how many swaps occur within one iteration of the algorithm.If no swaps occur, the algorithm stops since all general scheduling and Armstrong scheduling criteria weremet for all shifts checked within that iteration. The check and reassign routine is guaranteed to terminate6after a finite number of iterations as an individual shift (one unit of demand) cannot be reassigned back toa given nurse once it has been taken away from them. In our experiments, the algorithm terminated after atmost three iterations and returned a feasible schedule. Below we provide a formal argument for the aboveclaim as well as the feasibility of the output schedule.
The algorithm terminates after a finite number of iterations.
If a shift is re-assigned to an employeeof lower seniority according to lines 18-21, both the δ i (cid:48) k and δ i (cid:48)(cid:48) k variables must be greater than 0 after thereassignment, with the δ i (cid:48)(cid:48) k variable no greater than δ i (cid:48) k . If a shift is reassigned to an employee of lowerseniority according to lines 22-23, the δ i (cid:48) k variable must be greater than or equal to zero and the δ i (cid:48)(cid:48) k variablemust less than or equal to zero after the reassignment. In both cases, this shift can not be reassigned back toan employee of higher seniority via lines 25-27 or lines 28-29 as the following conditions must be false: δ i (cid:48)(cid:48) k > δ i (cid:48) k > δ i (cid:48)(cid:48) k - δ i (cid:48) k > δ i (cid:48)(cid:48) k > δ i (cid:48) k = 0, and δ i (cid:48) k <
0. If a shift is reassigned to an employeeof higher seniority according to lines 25-27, the δ i (cid:48) k variable must be greater than or equal to two and the δ i (cid:48)(cid:48) k variable must be greater than or equal to one after the reassignment, with the δ i (cid:48) k variable at most onemore than δ i (cid:48)(cid:48) k . If a shift is reassigned to an employee of higher seniority according to lines 28-29, the δ i (cid:48) k variable must be less than or equal to one and the δ i (cid:48)(cid:48) k variable must be greater than or equal to zero afterthe reassignment. This shift can not be reassigned back to an employee of lower seniority via lines 18-21 orlines 22-23 as the following conditions must be false: δ i (cid:48) k > δ i (cid:48)(cid:48) k ≥ δ i (cid:48) k - δ i (cid:48)(cid:48) k >
1, and δ i (cid:48) k > δ i (cid:48)(cid:48) k <
0. It can be shown that these conditions hold not only for individual reassignments but also fora chain of reassignments. Therefore, there is only a finite number of feasible reassignments that can occur.This guarantees that the heuristic terminates after a finite number of iterations.
The output schedule is feasible.
The outputted schedule is feasible if it abides by the general schedulingrequirements and as long as no individual scheduled shift can be reassigned within the same shift to a moreor less senior nurse without breaking an Armstrong seniority rule. Therefore, the implemented check andreassign routine guarantees feasibility as it will reassign all shifts that do not abide by any of the Armstrongseniority requirements. More specifically, Rule 1A is enforced by the reassignment made in lines 28-29 (thelatter portion of the OR statement); Rule 1B is enforced by the checks made in lines 22-23; and Rule 2 isenforced by the checks made in lines 19-21, 25-27, and 28-29 (the first portion of the OR statement). Allfeasible individual reassignments must be completed by the algorithm before it can terminate. The algorithmcompletes shift reassignments within a shift and never between shifts, and is indifferent to the differentpreference scores and amount of unfilled demand in a candidate schedule. This means while the outputtedschedule is guaranteed to abide by the Armstrong seniority rules, it is not guaranteed to be optimal withrespect to the number of unfilled demand remaining or the preferences of the nurses. Appendix C: Schedule Output D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t Part Time Demand
Unfilled Demand
Average Preference D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t Part Time Demand
Unfilled Demand
Average Preference D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t D a y E v e n i n g N i g h t Part Time Demand
Unfilled Demand
Average Preference