# A Two-Stage Method of Dimensioning and Scheduling Service Providers under Patient Demand Uncertainty

Authors: Hajar Shirneshan; Ahmad Sadegheih; Hasan Hoseini Nasab; Mohammad Mehdi Lotfi
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

Many researchers have studied the problem of dimensioning service providers and making shift schedules and have proposed various methods to solve it. Considering the importance and complexity of health care, this research is conducted through the integrated dimensioning and scheduling of service providers under patient demand uncertainty. In the first stage, a robust approach is adopted to determine the minimum number of required service providers. In the second stage, a monthly schedule is devised for service providers, and a two-stage stochastic program is used to solve the problem. To this end, an improved sample average approximation method considers different contracts and skills to determine a near-optimal schedule by minimizing the service providers’ regular working hours, overtime, and penalties for idle hours. In the first stage, considering the highest level of conservatism, equal to 7.6, a 19.38% cost increase is created compared to the nominal problem. In the second stage, by applying different clustering methods in the SAA algorithm and comparing them, the k-means++ algorithm obtains a good upper and lower bound and achieves a near-optimal solution in the shortest time. This research deals with the Iranian Health Control Center as a case study. The proposed method can yield the appropriate number of service providers based on monthly workloads and make the least undesirable schedules for service providers. Hence, managers can overcome patient issues’ uncertainty by assigning various service providers to each scheduling period.


---

## Body

## 1. Introduction

Due to the increase in chronic diseases such as cancer, diabetes, and COVID-19, the costs of healthcare systems are rising dramatically [1]. Alternatively, the population is aging, and more health services are needed with the baby boom generation entering middle age. In 2029, the last group of baby boomers will retire, resulting in a 73% increase in Americans aged 65 and older. Also, by 2050, one out of six people in the world will be over 65, while in 2019, it was one person out of eleven [2]. The statistics issued by the World Health Organization indicate that personnel planning will be a priority in the field of health in the next decade. Due to the high cost of staffing, which accounts for about 40% of the total costs, medical centers have to reduce their expenditures. Healthcare organizations face the question of how to organize the size and structure of their workforce to manage upcoming workloads more cost-effectively. This issue is especially the case when current and future demands deviate from each other. Cancer patients are among those who have this uncertain demand.The dimensioning of service providers is no longer an easy task to service with only one type of service provider. It gets even more challenging with the heterogeneity of the workforce due to different types of skills or contracts [3]. Considering service providers’ size and structure (e.g., skill sets and contract types), dimensioning aims to determine the adequate number needed in different categories. As another crucial task in service provider planning, scheduling involves getting the right service provider to the right shift on the right day. The nurse rostering problem (NRP), or nurse scheduling problem (NSP), aims to schedule and assign available service providers to hospital shifts under various constraints over a period [4]. It is easy to recognize that dimensioning decisions impact the scheduling quality directly. Hence, it is reasonable not to look at dimensioning and scheduling decisions as two consecutive tasks but to employ an integrated planning approach. As a result, dimensioning and scheduling service providers is a critical issue for health care centers. In the literature, there are few contributions addressing integrated dimensioning and scheduling compared to the literature on dimensioning or scheduling problems. Since health care centers have access to a limited number of service providers with certain contract and skill types, the proper dimensioning and planning of personnel gains importance. According to previous research, most researchers in this field have concentrated on staff dimensioning or scheduling issues with a specific number of service providers. However, due to the uncertainty of patient issues (such as the varied number of patients, different levels of patients’ severity, and unpredictable patients’ situations) or service provider issues (e.g., absence, pregnancy, and fatigue), health care centers require different numbers of service providers for certain planning periods (Tuna et al. [5]; Wang et al. [6]). Healthcare center managers should forecast and determine the future service providers’ size based on uncertainty (Tuna et al. [5]) to ensure that they are flexible in assigning extra service providers to other departments or teams or requesting extra service providers from them, as necessary. Thus, a health care center manager should negotiate the size of the service providers before making a schedule. For example, in the Iranian health control center, due to the uncertainty in the conditions of cancer patients, determining the appropriate number of service providers is critical. Cancer patients experience sudden changes such as metastasis and lymphedema, which lead to uncertainty in their conditions. In the Iranian health control center, the contracts signed by service providers with different skills are set in three modes, namely, full-time, part-time, and hourly. The service cost increases by 20% to 40% per hour as a contract is changed from full-time to part-time or hourly. Therefore, planning for the proper assignment of service providers can significantly save system costs. As is the case, most health care centers use manual planning, and the Iranian health control center is no exception [7]. The present study focuses on providing specialized services to cancer patients in the event of demand uncertainty to address the issue of planning the service providers in this center.Motivated by the previous research, this study proposes a method to evaluate the required service providers with different skills and contracts and make the corresponding schedule in an uncertain environment. So, the managers have the flexibility to reassign their service providers to other healthcare centers or get help from them to prepare care. This research integrates dimensioning and scheduling problems with patient demand uncertainty. Academic methods are lacking for dealing with such practical car providers’ dimensioning and scheduling problems. This lack of methodology serves as the motivation for this research. To the best of our knowledge, B. Vanhoucke and M. Vanhoucke [8], Wright and Mahar [9], Chen et al. [10], and Respicio et al. [11] are the only researchers that have combined the dimensioning and scheduling issues of service providers to form an integrated service provider dimensioning and scheduling problem (ISPDSP). This new ISPDSP involves two decisions: (1) determining the size of the service providers at the beginning of each period and (2) creating a schedule based on that information. The present study aims to create a two-phase method that integrates a robust approach and two-stage stochastic programming to solve the ISPDSP. The presented method will help managers to determine the required number of service providers based on the conservatism level, which is determined according to the working conditions of the health center. Suppose the patients’ conditions at the health center are such that the smallest delay in the service leads to the deterioration of the patient’s condition. In that case, the level of conservatism is considered at its highest value. Next, based on a two-stage stochastic programming model, the shift planning of each service provider is determined.


## 2. Literature Review

Medical staff planning has been a topic of research since the 1950s. Ernst et al. [12] indicated that it is difficult to create a schedule that meets the needs of employees. The task of medical staff planning is often difficult due to staffing requirements as well as government and hospital regulations. Different subjects, such as the number and conditions of the patients, the medical staff’s skills, preferences, and experiences, and government regulations should be considered by planners [12]. More studies on this issue have been published over the last two decades because of the significance of medical staff scheduling in healthcare.Many articles have been reviewed about medical staff scheduling. Cheang et al. [13], Ernst et al. [12], Viana [14], Van den Bergh et al. [15], and Defraeye and Van Nieuwenhuyse [16] categorized medical staff scheduling problems based on their characteristics, solution methods, and future research trends. Klinz et al. [17] used two mathematical models to minimize the number of work shifts and nurses’ general unhappiness. Topaloglu and Selim [18] proposed a multiobjective fuzzy goal programming model for NSPs. The model satisfies the hospital management objectives and makes an equitable schedule for nurses. They provided different fuzzy solution approaches to solve the problem. They studied the fulfilling demand coverage for the hospital’s objective and satisfaction for nurses’ objectives, which contains desired shift types, requested days off, work patterns, and total workload. Different types of membership functions, such as trapezoidal and triangular, were considered. Also, a sensitivity analysis is performed to provide decision-makers with a more confident solution set. Landa-Silva and Le [19] faced real-world uncertainties through a multiobjective approach to achieve high-quality nondominated schedules. They solved the model with a simple evolutionary algorithm. Ohki [20] established a cooperative genetic algorithm to reoptimize nurse schedules. Zhang et al. [21] presented a hybrid swarm-based optimization algorithm that combined a variable neighborhood search and a genetic algorithm to face highly constrained nurse scheduling problems in hospital environments. Maenhout and Vanhoucke [8] studied the nurse allocation issue and used the column-generation method to deal with it. Santos et al. [22] introduced cutting in integer programming to solve the problem involved innovatively. Ingels and Maenhout [23] introduced reserve duties and surveyed their impact on medium-term personnel shift rosters. They evaluate the delivered robustness by imitating the workforce management process in a three-step method. The unexpected events were simulated after designing the personnel roster. Finally, an optimization model determined the required adjustments to balance the supply and demand. Dohn and Mason [24] defined a generalized staff scheduling problem as containing a master problem and a subproblem. The master problem specified the roster lines of the staff to satisfy the demand constraints, and the subproblem generated a feasible roster line. Those researchers applied the branch-and-price concept and column-generation to solve the master problem and subproblems. Bagheri et al. [25] introduced a stochastic mathematical model for an NSP in the heart surgery department at Razavi Hospital to minimize the regular and overtime assignment costs. They assumed that patients’ demands and length of stay would be uncertain. So, they used the sample average approximation method to solve the problem. Punnakitikashem et al. [26] used a stochastic integer MP model to minimize the overload of nurses. Staffing cost is considered through a hard budget constraint in the model. They used the Benders’ decomposition and Lagrangian relaxation methods to achieve nondominated solutions. Northeast Texas Hospital is considered for implementing the introduced model as a case study. Chen et al. [10] studied an integrated problem of medical staff allocation and staff scheduling in uncertain environments. They used a two-stage algorithm based on goal programming and determined the smallest possible medical staff required to make the best schedule for them. Ang et al. [27] introduced a goal programming model for NSPs and developed a decision support system. They examined the workload distribution, shift equity, and staff satisfaction. They also pursued minimizing the nurse-patient ratio (NPR) and calculated it based on the number of patients allocated to each nurse. Hamid et al. [28] proposed a multiobjective mathematical model for nurse scheduling, which took the decision-making styles of nurses into account. The objectives addressed in that study were minimization of the average index of the incompatibility in the decision-making styles of the nurses assigned to the same shift days, maximization of the overall satisfaction of nurses with their shifts, and minimization of the total cost of staffing. Moreover, three meta-heuristics were developed to solve the problem, including multiobjective tabu search, the nondominated sorting genetic algorithm, and the multiobjective Keshtel algorithm. Pham and Dao [29] proposed a method by grouping nurses into clusters. Then, a hybrid metaheuristic algorithm consisting of the grey wolf optimizer (GWO) and particle swarm optimization (PSO) prepared the scheduling of each cluster. The results from the hybrid algorithm were compared to those from the standard PSO, GWO, and a linear programming formulation to evaluate the algorithm’s effectiveness. Hassani and Behnamian [30] developed a sustainable approach with a robust scenario-based optimization method. They proposed the differential evolution (DE) algorithm to solve the problem and compared its performance to the genetic algorithm. The results show that the DE algorithm has good performance. Kheiri et al. [31] studied the multistage nurse rostering formulation. They proposed a sequence-based selection hyper-heuristic using a statistical Markov model and an algorithm for building feasible initial solutions. Empirical results and analysis show that the suggested approach has significant potential for difficult problem instances.Many researchers have considered uncertainty regarding the patient, medical staff, or operational issues. Still, few have studied uncertainty regarding staff size when examining medical staff scheduling problems. Wang et al. [6] focused on a two-phase study of nurse scheduling. They employed forecasting technology during the first phase to predict the number of nurses required for the next four weeks. They used a two-cohort staggering strategy to schedule the required nurses for each shift on each day during the second phase. Tuna et al. [5] determined the required number of nurses in an outpatient chemotherapy unit for five consecutive weeks. They used historical data about the six kinds of patients and the average treatment time for each kind on a daily horizon. The results demonstrated that, based on the uncertainty in the patients’ number and treatment time, the required number of nurses varied from day to day for the next five-week planning period, ranging from 6 to 32. Uno [32] dealt with a staff scheduling problem by calculating the size of the medical staff needed for home care. They determined the total required services for each period and used a mathematical model to calculate the lower and upper bounds of the helpers for each period. Table 1 presents a brief classification of the models reviewed in the literature.Table 1
A brief classification of the models reviewed in the literature.
AuthorYearService provider dimensioningShift schedulingObjectiveUncertaintySolution approachKlinz et al. [17]2006—✓Minimize the total number of work shifts and the general unhappiness of all nurses—HeuristicTopaloglu and Selim [18]2010—✓Minimize deviations from nurse preferences and hospital regulationsFuzzyExactLanda-silva and Le [19]2008—✓Minimize deviations from nurses’ satisfaction and work regulations—Meta-heuristicOhki [20]2012—✓Minimize the penalty function to evaluate shift schedules—Meta-heuristicEl Adoly et al. [33]2011—✓Maximize the quality of objectives concerning the importance of constraints—Meta-heuristicMaenhout and Vanhoucke [8]2013✓✓Minimize the penalty associated with different types of nurses—ExactSantos et al. [22]2016—✓Minimize the penalty of assignment—HeuristicIngels and Maenhout [23]2015—✓Minimize the allocation penalty and change the nurse schedule—Exact and simulationDohn and Mason [24]2013—✓Minimize penalties from under-and over-coverage and minimize the total cost of all roster lines—Column generationBranch and priceBagheri et al. [25]2016—✓Minimize the normal and overtime hours of nursesStochasticSample averageApproximationPunnakitikashem et al. [26]2013—✓Minimize the excess workload on nurses and the cost of staffingStochasticBenders and LagrangianChen et al. [10]2016✓✓First stage: Minimize the number of nurses. Second stage: Minimize the penalty of the soft constraints of nurses’ preferences—ExactAng et al. [27]2018—✓Minimize the maximum and average deviations from target nurse-patient ratios—ExactHamid et al. [28]2020—✓Minimize the sum of incompatibility among nurses and the total cost of staffing and maximize the satisfaction of nurses with their assigned shifts—Meta-heuristicPham and Dao [29]2021—✓Minimize the total cost of assigning nurses to different shifts (morning, evening, night, and day-off)—Hybrid metaheuristicHassani and Behnamian [30]2021—✓Minimizing the total cost of allocating shifts to nurses, reserve nurses required, overtime and underemployed costs of a particular type of shift, cost of mismatching the nurse preferences with the rosterRobust scenario-based optimizationMeta-heuristicKheiri et al. [31]2021—✓Minimizing violation of eight soft constraints—Hyper-heuristic with statistical Markov modelThis study2022✓✓First stage: minimize the number of service providers. Second stage: minimizes regular work hours, overtime hours, and the cost of idle hoursStochasticFirst stage: exactSecond stage: improved sample average approximationBased on these studies, the number of service providers changes from one period to another. Hence, this research employed a conservative service provider size to make a monthly schedule by considering the patient demand uncertainty. In real-world shift scheduling, a different source of uncertainties needs to be addressed to provide a reliable schedule. Therefore, this study presents a two-stage stochastic programming model that considers the uncertainty in patients’ demands, types of contracts, and service providers’ skills. In the following, the improved sample average approximation (I-SAA) method is employed to solve the model, and the parameters of the solution method are adjusted (Figure1).Figure 1
The solution procedures of the two-stage method.The rest of this article is as follows. The proposed optimization model and its structure are presented in Section3. Section 4 introduced the solution approach with detailed descriptions of the original SAA and I-SAA methods. Section 5 presents numerical experiments. Finally, the concluding remarks are made in Section 6.


## 3. Problem Definition and Modeling

### 3.1. Service Providers Dimensioning Problem (SPDP)

The robust approach is suitable for dealing with uncertainty, which was first proposed by Soyster in the early 1970s [34]. In an uncertain environment, a range of possible values for key parameters can be related to the objective function or constraints. This range of values is specified as the lower and upper bounds for the main parameters, and robust optimization evaluates them. Then, a conservative level is selected as the predetermined value of each parameter, and the corresponding problem is formulated. Soyster [34] proposed a very conservative approach; therefore, the answer obtained is so far from the answer of the nominal model. Ben-Tal and Nemirovski [35] considered an ellipsoidal uncertainty set and presented a conic quadratic program that cannot be directly used for discrete models. Sim [36] presented a different approach for controlling the level of conservatism, which leads to a linear programming model. This formulation, called “budget of uncertainty,” allows a model’s uncertainty to be adjusted based on the decision maker’s risk adversity through an uncertainty budget and causes a small increase in computational efforts compared to deterministic approaches. So, the present study employed Bertsimas’ approach to formulate deterministic MILPs into robust optimization counterparts. Therefore, mathematical programming can obtain optimal solutions to the corresponding problem. The most conservative response obtained from solving this model determines the number of service providers required, as presented in Section 3.2. Table 2 presents the notations of SPDP.Table 2
Notations of SPDP.
SetsSSet of skills (nurse, general practitioner, and specialist)MSet of monthsNSet of contractsParametersdimDemand for skilli per month mcajmContract capacityj per month maimNumber of the service providers available with skilli per month mbjmNumber of the service providers available with contractj per month mcijmCost of skilled service provideri with contract jΓimConservatism levelVariablexijmNumber of the service providers required for skilli with contract j per month mBased on the problem uncertainties, the patients’ demands and the contract duration for each skill vary from period to period. The parametersdim and cajm, independent of each other, have an unknown distribution but are symmetric in a range, possibly with an average equal to their nominal values. So, dim and cajm take dim−d^im,dim+d^im and cajm−ca^jm,cajm+ca^jm, where d^im and ca^jm represent the deviation from the nominal coefficients dim and cajm, respectively. To formulate the robust counterpart of the problem, Γim,i∈S,m∈M values are defined for uncertain constraints. Thus, the goal is to find the optimal solution in situations with Γim,iϵ1,2,…,S,m∈1,2,…,M. The details of how this formulation can be derived are presented in reference [37]. It is also shown that the resulting robust problem is solvable within a polynomial time. The robust model can be defined as follows:(1)min∑i=1S∑j=1N∑m=1Mcijmxijm∑j=1Ncajmxijm−zimΓim+∑pijmj∈Ji+pim0≥dim∀i,∀m,(2)zim+pijm≥ca^jmxijm∀j∈Ji,∀i,∀m,(3)zim+pim0≥d^im∀i,∀m,(4)∑j=1nxijm≤aim∀i,∀m,(5)∑i=1mxijm≤bjm∀j,∀m,(6)∑j=1nxijm≥1∀i,∀m,(7)zim,pim0≥0∀i,∀m,(8)pijm≥0∀i,∀j,∀m,(9)xijmϵ0,1∀i,∀j,∀m.The objective function minimizes the cost of the required service providers. Constraints (1), (2), and (3) guarantee the meeting of the demands for each month and each skill under robust optimization. Constraint (4) limits the number of service providers per skill. Constraint (5) limits the number of service providers per contract. Constraint (6) indicates that at least one service provider of each skill must be assigned each month. After the number of the required service providers is determined, nurse scheduling is addressed in Section 3.2.


### 3.2. Stochastic Service Providers’ Scheduling Problem (SSPSP)

The proposed mathematical model assigns service providers to shifts, and the number of required overtime and idle hours in possible conditions is determined. The required duration of each skill per shift and per day (desmd) is considered stochastic. Service providers are categorized into nurses, general practitioners, and specialists depending on their skills. Contracts are also available in full-time, part-time, and hourly types, 8, 4, and 2 hours per shift, respectively. Table 3 presents the notations used in the model.Table 3
Notations of SSPSP.
SetsSSet of skills (xx: nurse,xy: general practitioner, and xz: specialist)WSet of weeksDSet of daysMSet of shiftsNSet of contracts (full time, part-time, and hourly)ξSet of scenarios (ξ=1,2,…,BIxxSet of nursesIxySet of general practitionersIxzSet of specialistsParametersaaij1, if nursei is under contract jabij1, if general practitioneri is under contract jacij1, if specialisti is under contract jhjNumber of hours of service by contractj per shifthhjNumber of contract hoursj per monthdesmdNumber of the hours required of skills per shift m per day dcajCost of a nurse with contractj per hourcbjCost of a general practitioner with contractj per hourccjCost of a specialist with contractj per hourc1iAdditional service cost per hour for skilli (i = xx, xy, xz)c2iPenalty cost per hour for working less than the contract for service providers with skilli (i = xx, xy, xz)e1sMinimum number of shifts for a full-time service provider with skillse2sMaximum number of shifts for a full-time service provider with skillsn1Minimum number of weekends off that a service provider should take in the periodn2Maximum number of night shifts for each service providergi1, if dayi is weekendVariablesxximdOne if nursei is assigned to shift m on day d; otherwise, 0xyimdOne if general practitioneri is assigned to shift m on day d; otherwise, 0xzimdOne if specialisti is assigned to shift m on day d; otherwise, 0wxidOne ifd is a working day for nurse i; otherwise, 0wyidOne ifd is a working day for general practitioner i; otherwise, 0wzidOne ifd is a working day for specialist i; otherwise, 0pimdξNumber of the additional hours required for skilli on shift m on day dqimdξNumber of the idle hours for skilli on shift m on day dThe stochastic demand model for the service providers’ scheduling problem can be formulated as follows:(10)MinZ=∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+∑ξϵB∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ,(11)∑m=1Mxximd≤1,i=1,…,Ixx,d=1,..,D,(12)∑m=1Mxyimd≤1,i=1,…,Ixy,d=1,..,D,(13)∑m=1Mxzimd≤1,i=1,…,Ixz,d=1,..,D,(14)xxi3d+xxijd+1≤1i=1,…,Ixx,d=1,..,D−1j=1,…,M,(15)xyi3d+xyijd+1≤1i=1,…,Ixy,d=1,..,D−1j=1,…,M,(16)xzi3d+xzijd+1≤1i=1,…,Ixz,d=1,..,D−1j=1,…,M,(17)∑d=1D∑m=1M1−xximdgd≥n1i=1,…,Ixx,(18)∑d=1D∑m=1M1−xyimdgd≥n1i=1,…,Ixy,(19)∑d=1D∑m=1M1−xzimdgd≥n1i=1,…,Ixz,(20)∑d=1Dxxi3d≤n2,i=1,…,Ixx,(21)∑d=1Dxyi3d≤n2,i=1,…,Ixy,(22)∑d=1Dxzi3d≤n2,i=1,…,Ixz,(23)wxid=∑m=1Mxximd,i=1,…,Ixx,d=1,..,D,(24)wyid=∑m=1Mxyimd,i=1,…,Ixy,d=1,..,D,(25)wzid=∑m=1Mxzimd,i=1,…,Ixz,d=1,..,D,(26)wxid+∑t=1n3wxid+t≤n3i=1,…,Ixx,d=1,..,D−n3+1,(27)wyid+∑t=1n3wyid+t≤n3i=1,…,Ixy,d=1,..,D−n3+1,(28)wzid+∑t=1n3wzid+t≤n3i=1,…,Ixz,d=1,..,D−n3+1,(29)∑d=1D∑m=1Maaijxximd≥e1xxj=1,i=1,…,Ixx,(30)∑d=1D∑m=1Mabijxyimd≥e1xyj=1,i=1,…,Ixy,(31)∑d=1D∑m=1Mabijxzimd≥e1xzj=1,i=1,…,Ixz,(32)∑d=1D∑m=1Maaijxximd≤e2xxj=1,i=1,…,Ixx,(33)∑d=1D∑m=1Mabijxyimd≤e2xyj=1,i=1,…,Ixy,(34)∑d=1D∑m=1Mabijxzimd≤e2xzj=1,i=1,…,Ixz,(35)pxxmdξ≥dexxmdξ−∑j=1N∑i=1Ixxhjaaijxximdm=1,2,3,d=1,…,D,(36)pxymdξ≥dexymdξ−∑j=1N∑i=1Ixyhjabijxyimdm=1,2,3,d=1,…,D,(37)pxzmdξ≥dexzmdξ−∑j=1N∑i=1Ixzhjabijxzimdm=1,2,3,d=1,…,D,(38)qxxmdξ≥∑j=1N∑i=1Ixxhjaaijxximd−dexxmdξm=1,2,3,d=1,…,D,(39)qxymdξ≥∑j=1N∑i=1Ixyhjaaijxyimd−dexymdξm=1,2,3,d=1,…,D,(40)qxzmdξ≥∑j=1N∑i=1Ixzhjaaijxzimd−dexzmdξm=1,2,d=1,…,D,(41)xximdϵ0,1m=1,2,3,d=1,…,D,i=1,…,Ixx,(42)xyimdϵ0,1m=1,2,3,d=1,…,D,i=1,…,Ixy,(43)xzimdϵ0,1m=1,2,3,d=1,…,D,i=1,…,Ixz,(44)pimdξ,qimdξ≥0i∈S,ξ∈B,The objective function minimizes regular work hours, overtime hours, and the cost of idle hours. In this regard,ϕξ is the probability of scenario ξ=1,2,…,B and ∑ξϵBϕξ=1. Constraints (11)–(13) ensure that each nurse, general practitioner, and specialist is assigned a maximum of one shift per day. Constraints (14)–(16) state that if a service provider is assigned to a night shift, he or she should not work the following day. Constraints (17)–(19) specify that each service provider be assigned at least n1 weekend. Constraints (20)–(22) determine the maximum number of night shifts per service provider. Constraints (23)–(26) indicate that a service provider cannot work for more than n3 consecutive days. Constraints (27)–(29) state that each service provider with a full-time contract must work at least one e1i shifts during the planning period. Constraints (30)–(32) limit the maximum number of shifts per full-time service provider (e2i ) in the planning period. Constraints (32)–(34) determine overtime hours for nurses, general practitioners, and specialists per shift in each scenario, respectively. Constraints (35)–(37) specify extra hours for nurses, general practitioners, and specialists per shift in each scenario, respectively. Eventually, constraints (38)–(40) define the model’s variables. This research assumes that the required hours of practicing skills on shift m per day (desmd) has a uniform distribution in the interval (a, b). An exact solution can be obtained for small-sized problems, but as the size of the problem increases, the solution time increases too. This study solves the SSPSP with an improved sample average approximation algorithm. A recourse action model is applied to formulate the model of solving the problem with that algorithm. Section 3.3 delineates the basic properties of the new formulation [36].


### 3.3. Stochastic Integer Programming with a Recourse Model

Stochastic programming models have appeared as extensions of optimization problems with random parameters. Consider the optimization problem below[36]:(45)mincx,s.t.Ax=b,Tx=h,x∈X,x≥0.In this model,x is the vector of decision variables, Ax=b are deterministic constraints, and Tx=h are uncertain constraints that the parameters T and h depend on information and become available only after a decision is made on x. A class of stochastic programming models, known as recourse models, is obtained by allowing additional or recourse decisions after realizing the random variables T and h. So, recourse models are dynamic; the stages model the time discretely based on the available data. If all the uncertainty is dissolved, a recourse model captures it with two stages, namely, “present” and “future.” Given a first-stage decision x, for every possible q,T,h realized as q,T,h, the infeasibilities h−Tx are compensated at minimal costs with second-stage decisions as an optimal solution of the second-stage problem. This specifies the minimal recourse costs as a function of the first-stage decision x, and the realization of ξ is denoted by υx,ξ. Its expectation, Qx=Eξυx,ξ, yields the expected recourse costs associated with the first-stage decision x. Thus, the two-stage recourse model is as follows:(46)mincx+Qx,s.t.Ax=b,x∈X,where the objective function cx+Qx indicates the total expected costs of decision x [36]. The SSPSP’s first stage decisions include assigning service providers to work shifts. The decisions of the second stage are determined based on the stochastic demand of the patients. The following recourse model defines the stochastic model for the service providers’ scheduling problem:(47)MinZ=∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+EQx,ξ.Constraints (11)–(34):In this model,EQx,ξ shows the recourse action function, and(48)Qx,ξ=min∑ξϵB∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ.Constraints (35)–(40):Theξ∈B vector contains numerous scenarios. So, to obtain EQx,ξ, lots of similar integer linear programs (ILPs) [38] must be solved, which is a difficult calculation task. Since it is hard to provide an exact solution to the SSPSP, the next section proposes an approximation.


## 3.1. Service Providers Dimensioning Problem (SPDP)

The robust approach is suitable for dealing with uncertainty, which was first proposed by Soyster in the early 1970s [34]. In an uncertain environment, a range of possible values for key parameters can be related to the objective function or constraints. This range of values is specified as the lower and upper bounds for the main parameters, and robust optimization evaluates them. Then, a conservative level is selected as the predetermined value of each parameter, and the corresponding problem is formulated. Soyster [34] proposed a very conservative approach; therefore, the answer obtained is so far from the answer of the nominal model. Ben-Tal and Nemirovski [35] considered an ellipsoidal uncertainty set and presented a conic quadratic program that cannot be directly used for discrete models. Sim [36] presented a different approach for controlling the level of conservatism, which leads to a linear programming model. This formulation, called “budget of uncertainty,” allows a model’s uncertainty to be adjusted based on the decision maker’s risk adversity through an uncertainty budget and causes a small increase in computational efforts compared to deterministic approaches. So, the present study employed Bertsimas’ approach to formulate deterministic MILPs into robust optimization counterparts. Therefore, mathematical programming can obtain optimal solutions to the corresponding problem. The most conservative response obtained from solving this model determines the number of service providers required, as presented in Section 3.2. Table 2 presents the notations of SPDP.Table 2
Notations of SPDP.
SetsSSet of skills (nurse, general practitioner, and specialist)MSet of monthsNSet of contractsParametersdimDemand for skilli per month mcajmContract capacityj per month maimNumber of the service providers available with skilli per month mbjmNumber of the service providers available with contractj per month mcijmCost of skilled service provideri with contract jΓimConservatism levelVariablexijmNumber of the service providers required for skilli with contract j per month mBased on the problem uncertainties, the patients’ demands and the contract duration for each skill vary from period to period. The parametersdim and cajm, independent of each other, have an unknown distribution but are symmetric in a range, possibly with an average equal to their nominal values. So, dim and cajm take dim−d^im,dim+d^im and cajm−ca^jm,cajm+ca^jm, where d^im and ca^jm represent the deviation from the nominal coefficients dim and cajm, respectively. To formulate the robust counterpart of the problem, Γim,i∈S,m∈M values are defined for uncertain constraints. Thus, the goal is to find the optimal solution in situations with Γim,iϵ1,2,…,S,m∈1,2,…,M. The details of how this formulation can be derived are presented in reference [37]. It is also shown that the resulting robust problem is solvable within a polynomial time. The robust model can be defined as follows:(1)min∑i=1S∑j=1N∑m=1Mcijmxijm∑j=1Ncajmxijm−zimΓim+∑pijmj∈Ji+pim0≥dim∀i,∀m,(2)zim+pijm≥ca^jmxijm∀j∈Ji,∀i,∀m,(3)zim+pim0≥d^im∀i,∀m,(4)∑j=1nxijm≤aim∀i,∀m,(5)∑i=1mxijm≤bjm∀j,∀m,(6)∑j=1nxijm≥1∀i,∀m,(7)zim,pim0≥0∀i,∀m,(8)pijm≥0∀i,∀j,∀m,(9)xijmϵ0,1∀i,∀j,∀m.The objective function minimizes the cost of the required service providers. Constraints (1), (2), and (3) guarantee the meeting of the demands for each month and each skill under robust optimization. Constraint (4) limits the number of service providers per skill. Constraint (5) limits the number of service providers per contract. Constraint (6) indicates that at least one service provider of each skill must be assigned each month. After the number of the required service providers is determined, nurse scheduling is addressed in Section 3.2.


## 3.2. Stochastic Service Providers’ Scheduling Problem (SSPSP)

The proposed mathematical model assigns service providers to shifts, and the number of required overtime and idle hours in possible conditions is determined. The required duration of each skill per shift and per day (desmd) is considered stochastic. Service providers are categorized into nurses, general practitioners, and specialists depending on their skills. Contracts are also available in full-time, part-time, and hourly types, 8, 4, and 2 hours per shift, respectively. Table 3 presents the notations used in the model.Table 3
Notations of SSPSP.
SetsSSet of skills (xx: nurse,xy: general practitioner, and xz: specialist)WSet of weeksDSet of daysMSet of shiftsNSet of contracts (full time, part-time, and hourly)ξSet of scenarios (ξ=1,2,…,BIxxSet of nursesIxySet of general practitionersIxzSet of specialistsParametersaaij1, if nursei is under contract jabij1, if general practitioneri is under contract jacij1, if specialisti is under contract jhjNumber of hours of service by contractj per shifthhjNumber of contract hoursj per monthdesmdNumber of the hours required of skills per shift m per day dcajCost of a nurse with contractj per hourcbjCost of a general practitioner with contractj per hourccjCost of a specialist with contractj per hourc1iAdditional service cost per hour for skilli (i = xx, xy, xz)c2iPenalty cost per hour for working less than the contract for service providers with skilli (i = xx, xy, xz)e1sMinimum number of shifts for a full-time service provider with skillse2sMaximum number of shifts for a full-time service provider with skillsn1Minimum number of weekends off that a service provider should take in the periodn2Maximum number of night shifts for each service providergi1, if dayi is weekendVariablesxximdOne if nursei is assigned to shift m on day d; otherwise, 0xyimdOne if general practitioneri is assigned to shift m on day d; otherwise, 0xzimdOne if specialisti is assigned to shift m on day d; otherwise, 0wxidOne ifd is a working day for nurse i; otherwise, 0wyidOne ifd is a working day for general practitioner i; otherwise, 0wzidOne ifd is a working day for specialist i; otherwise, 0pimdξNumber of the additional hours required for skilli on shift m on day dqimdξNumber of the idle hours for skilli on shift m on day dThe stochastic demand model for the service providers’ scheduling problem can be formulated as follows:(10)MinZ=∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+∑ξϵB∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ,(11)∑m=1Mxximd≤1,i=1,…,Ixx,d=1,..,D,(12)∑m=1Mxyimd≤1,i=1,…,Ixy,d=1,..,D,(13)∑m=1Mxzimd≤1,i=1,…,Ixz,d=1,..,D,(14)xxi3d+xxijd+1≤1i=1,…,Ixx,d=1,..,D−1j=1,…,M,(15)xyi3d+xyijd+1≤1i=1,…,Ixy,d=1,..,D−1j=1,…,M,(16)xzi3d+xzijd+1≤1i=1,…,Ixz,d=1,..,D−1j=1,…,M,(17)∑d=1D∑m=1M1−xximdgd≥n1i=1,…,Ixx,(18)∑d=1D∑m=1M1−xyimdgd≥n1i=1,…,Ixy,(19)∑d=1D∑m=1M1−xzimdgd≥n1i=1,…,Ixz,(20)∑d=1Dxxi3d≤n2,i=1,…,Ixx,(21)∑d=1Dxyi3d≤n2,i=1,…,Ixy,(22)∑d=1Dxzi3d≤n2,i=1,…,Ixz,(23)wxid=∑m=1Mxximd,i=1,…,Ixx,d=1,..,D,(24)wyid=∑m=1Mxyimd,i=1,…,Ixy,d=1,..,D,(25)wzid=∑m=1Mxzimd,i=1,…,Ixz,d=1,..,D,(26)wxid+∑t=1n3wxid+t≤n3i=1,…,Ixx,d=1,..,D−n3+1,(27)wyid+∑t=1n3wyid+t≤n3i=1,…,Ixy,d=1,..,D−n3+1,(28)wzid+∑t=1n3wzid+t≤n3i=1,…,Ixz,d=1,..,D−n3+1,(29)∑d=1D∑m=1Maaijxximd≥e1xxj=1,i=1,…,Ixx,(30)∑d=1D∑m=1Mabijxyimd≥e1xyj=1,i=1,…,Ixy,(31)∑d=1D∑m=1Mabijxzimd≥e1xzj=1,i=1,…,Ixz,(32)∑d=1D∑m=1Maaijxximd≤e2xxj=1,i=1,…,Ixx,(33)∑d=1D∑m=1Mabijxyimd≤e2xyj=1,i=1,…,Ixy,(34)∑d=1D∑m=1Mabijxzimd≤e2xzj=1,i=1,…,Ixz,(35)pxxmdξ≥dexxmdξ−∑j=1N∑i=1Ixxhjaaijxximdm=1,2,3,d=1,…,D,(36)pxymdξ≥dexymdξ−∑j=1N∑i=1Ixyhjabijxyimdm=1,2,3,d=1,…,D,(37)pxzmdξ≥dexzmdξ−∑j=1N∑i=1Ixzhjabijxzimdm=1,2,3,d=1,…,D,(38)qxxmdξ≥∑j=1N∑i=1Ixxhjaaijxximd−dexxmdξm=1,2,3,d=1,…,D,(39)qxymdξ≥∑j=1N∑i=1Ixyhjaaijxyimd−dexymdξm=1,2,3,d=1,…,D,(40)qxzmdξ≥∑j=1N∑i=1Ixzhjaaijxzimd−dexzmdξm=1,2,d=1,…,D,(41)xximdϵ0,1m=1,2,3,d=1,…,D,i=1,…,Ixx,(42)xyimdϵ0,1m=1,2,3,d=1,…,D,i=1,…,Ixy,(43)xzimdϵ0,1m=1,2,3,d=1,…,D,i=1,…,Ixz,(44)pimdξ,qimdξ≥0i∈S,ξ∈B,The objective function minimizes regular work hours, overtime hours, and the cost of idle hours. In this regard,ϕξ is the probability of scenario ξ=1,2,…,B and ∑ξϵBϕξ=1. Constraints (11)–(13) ensure that each nurse, general practitioner, and specialist is assigned a maximum of one shift per day. Constraints (14)–(16) state that if a service provider is assigned to a night shift, he or she should not work the following day. Constraints (17)–(19) specify that each service provider be assigned at least n1 weekend. Constraints (20)–(22) determine the maximum number of night shifts per service provider. Constraints (23)–(26) indicate that a service provider cannot work for more than n3 consecutive days. Constraints (27)–(29) state that each service provider with a full-time contract must work at least one e1i shifts during the planning period. Constraints (30)–(32) limit the maximum number of shifts per full-time service provider (e2i ) in the planning period. Constraints (32)–(34) determine overtime hours for nurses, general practitioners, and specialists per shift in each scenario, respectively. Constraints (35)–(37) specify extra hours for nurses, general practitioners, and specialists per shift in each scenario, respectively. Eventually, constraints (38)–(40) define the model’s variables. This research assumes that the required hours of practicing skills on shift m per day (desmd) has a uniform distribution in the interval (a, b). An exact solution can be obtained for small-sized problems, but as the size of the problem increases, the solution time increases too. This study solves the SSPSP with an improved sample average approximation algorithm. A recourse action model is applied to formulate the model of solving the problem with that algorithm. Section 3.3 delineates the basic properties of the new formulation [36].


## 3.3. Stochastic Integer Programming with a Recourse Model

Stochastic programming models have appeared as extensions of optimization problems with random parameters. Consider the optimization problem below[36]:(45)mincx,s.t.Ax=b,Tx=h,x∈X,x≥0.In this model,x is the vector of decision variables, Ax=b are deterministic constraints, and Tx=h are uncertain constraints that the parameters T and h depend on information and become available only after a decision is made on x. A class of stochastic programming models, known as recourse models, is obtained by allowing additional or recourse decisions after realizing the random variables T and h. So, recourse models are dynamic; the stages model the time discretely based on the available data. If all the uncertainty is dissolved, a recourse model captures it with two stages, namely, “present” and “future.” Given a first-stage decision x, for every possible q,T,h realized as q,T,h, the infeasibilities h−Tx are compensated at minimal costs with second-stage decisions as an optimal solution of the second-stage problem. This specifies the minimal recourse costs as a function of the first-stage decision x, and the realization of ξ is denoted by υx,ξ. Its expectation, Qx=Eξυx,ξ, yields the expected recourse costs associated with the first-stage decision x. Thus, the two-stage recourse model is as follows:(46)mincx+Qx,s.t.Ax=b,x∈X,where the objective function cx+Qx indicates the total expected costs of decision x [36]. The SSPSP’s first stage decisions include assigning service providers to work shifts. The decisions of the second stage are determined based on the stochastic demand of the patients. The following recourse model defines the stochastic model for the service providers’ scheduling problem:(47)MinZ=∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+EQx,ξ.Constraints (11)–(34):In this model,EQx,ξ shows the recourse action function, and(48)Qx,ξ=min∑ξϵB∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ.Constraints (35)–(40):Theξ∈B vector contains numerous scenarios. So, to obtain EQx,ξ, lots of similar integer linear programs (ILPs) [38] must be solved, which is a difficult calculation task. Since it is hard to provide an exact solution to the SSPSP, the next section proposes an approximation.


## 4. Solution Approach

This research expands on a two-stage method to solve an ISPDSP. The Bertsimas approach (see Section3.1) describes an SPDP based on the patients’ demand uncertainty in the first step. Step two is calculating the minimum number of service providers required under budget uncertainty. In the third step, that minimum number serves as a basis to determine the final number of the service providers and to construct an SSPSP based on this number. The objective function of the SSPSP is to minimize the regular working hours, overtime hours, and penalty for idle hours costs. In the last step, the original SAA and I-SAA methods are employed to solve the SSPSP. This yields a near-optimal schedule for service providers. Solving the model can help managers determine appropriate service providers and make the corresponding schedules in uncertain environments.


### 4.1. The Sample Average Approximation (SAA)

There are several solution methods, such as the SAA to solve stochastic models. The SAA method solves stochastic programming problems based on the Monte Carlo simulation method. It generates a random sample and approximates the expected value function with the corresponding sample average function. The stop criterion determines how long the algorithm will last. Over the years, various authors have employed the idea of sample average approximation to solve stochastic programs. For example, it was employed to solve stochastic knapsack problems [39], stochastic routing problems [40], supply chain problems [41], and investment problems [42]. Due to the high applicability of the SAA method, it has been selected to solve the model in this study. The method is delineated below.LetM, N, and N′ be the number of replications, the number of scenarios in the sample problem, and the sample size used to estimate CTx^+EQX^,ξ for a given feasible solution x^, respectively. So, the SAA method can be described as follows [40]:(1)
Form = 1,..., M, repeat the following steps:(a)
Generate N random sampleξ1, ξ2 ,…, ξN.(b)
Solve the problem by the SAA method and letX^Nm be the solution vector and Z^Nm the optimal objective value.(c)
Generate independent random sampleξ1, ξ2 ,…, ξN′. Evaluate g^N′X^Nm and Sg^N′X^Nm2 as follows:(49)g^N′X^Nm=∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+1N′∑n=1N′∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ.(50)Sg^N′X^Nm2=1N′N′−1∑n=1N′∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ−g^N′X¯,(2)
EvaluateZ¯NM and SZ¯NM2.(51)Z¯NM=1M∑m=1MZ^Nm,SZ¯NM2=1M−1M∑m=1MZ^Nm−Z¯NM2,The confidence interval for the optimality gap can be calculated as follows:(52)g^N′X^Nm−Z¯NM+ZαSg^N′X¯2+SZ¯NM20.5,Here isZα=Φ−11−α, where ΦZ is the cumulative distribution of the standard normal distribution.(3)
For each solutionX^Nm, m = 1,...,M, estimate the optimality gap by g^N′X^Nm−Z¯NM, along with an estimated variance of Sg^N′X^Nm2+SZ¯NM2. Choose one of the M candidate solutions based on the least estimated objective value.In the algorithm,Z¯NM and g^N′X^Nm are the lower bound (LB) and the upper bound (UB) of the optimal value, respectively [43]. The parameter Z¯NM shows an unbiased estimator of the optimal objective function EZ^N. Here,Z¯NM=EZ^N and EZ^N≤Z∗. Moreover, g^N′X^Nm presents an unbiased estimator of the objective value EZ^N, but Eg^N′X^Nm≥Z∗. An increase in the value of N causes an increase in the accuracy of the response as well as an exponential rise in the solution time [40]. Thus, by selecting sample size N, there is a trade-off between the computational complexity and the qualities obtained through solving the problem. The next section introduces clustering as one of the proposed methods to reduce the number of scenarios.


### 4.2. Clustering Techniques in Sample Average Approximation

In real-world situations with large problems, the SAA algorithm performs well, but the computation time is long and the method is inefficient. So far, just a few studies have been conducted on scenario clustering to solve optimization problems. Those who have tried to resolve this issue use clustering algorithms to group similar scenarios and generate samples. Crainic et al. [44] grouped progressive hedging algorithm scenarios by a machine learning method and applied the approach to a stochastic network design problem. They used clustering techniques inside a partial Benders decomposition algorithm to reduce the number of feasibility and optimality cuts generated by the algorithm. Emelogu et al. [45] employed clustering techniques to improve the SAA algorithm. They update the sample sizes dynamically and make high-quality solutions within a reasonable time. Sim [36] focused on clustering algorithms to categorize scenarios before selecting a random sample for the SAA algorithm. They extracted the data from a facility location problem. Clustering is the unsupervised classification that divides data into groups of similar objects [46]. Each group is called a cluster that contains similar data. Clustering algorithms are divided into three main categories: (1) partitional clustering; (2) hierarchical clustering; and (3) density-based clustering. Partitional clustering methods are divided into two subcategories, namely, centroid and medoid. The centroid algorithm specifies each cluster based on the gravity center of instances. Each cluster consists of the instances closest to the gravity center in the medoid algorithm. In this method, the numbers of the clusters are determined in advance. The hierarchical clustering method builds a tree of clusters known as a dendrogram that organizes clusters from the top-down. The density-based clustering algorithm determines the number of clusters automatically. This method divides data based on different criteria, such as connectivity, boundary, and region. Since in this research, clustering is done for different scenarios of patients’ demand and the number of clusters is determined in advance, partitional clustering methods (e.g., K-means, K-means++, PAM, and EM-GMM) have been used for clustering the scenarios for the SAA algorithm. Then, a lower bound for the problem is obtained through the clustered scenarios. Figure 2(a) shows all the possible scenarios generated by a stochastic program in a solution space. The original SAA takes a few scenarios as samples (N) from all the possible ones and calculates the objective function iteratively until M solutions are obtained. However, I-SAA groups the scenarios in the form of a cluster where each scenario highly represents that cluster (Figure 2(b)). The number of the scenarios (Nk) for the I-SAA algorithm is the reduced form of each cluster (Figure 2(c)) [45].Figure 2
Representation of scenario aggregation performed in the I-SSA.The implementation of the I-SAA method is summed up as follows:(1)
Form = 1, ..., M, repeat the steps below:(a)
GenerateNL random sample ξ1, ξ2,…, ξNL(NL≫N).(b)
Use one of the clustering techniques described in Section and clusterNL samples to yield Nk scenario.(c)
Solve the problem by the I-SAA method and letX^Nkm be the solution vector and Z^Nkm the optimal objective value.(d)
Generate an independent random sampleξ1, ξ2 ,…, ξN′(N′≫NL). Evaluate g^N′X^Nkm and Sg^N′X^Nkm2.(2)
EvaluateZ¯NkM and SZ¯NkM2.(53)Z¯NkM=1M∑m=1MZ^Nkm,SZ¯NkM2=1M−1M∑m=1MZ^Nkm−Z¯NkM2.(3)
Estimate the optimality gapg^N′X^Nkm−Z¯NkM for each solution X^Nkm and the estimated variance of Sg^N′X^Nkm2+SZ¯NkM2, m = 1, ..., M. Choose one of the M candidate solutions based on the least estimated objective value.Sections4.2.1 to 4.2.4 describe these clustering methods used in the original SAA algorithm.


#### 4.2.1. K-Means

Lloyd [47] proposed the K-means algorithm in 1957. Sometimes referred to as the Lloyd’s algorithm, K-means is an easy, simple, efficient, and the most popular unsupervised learning algorithm used to classify a given dataset into a certain number of clusters in such a way that each dataset belongs to one cluster with the same properties. It has two phases. The first phase chooses the initial k centers at random. The second phase assigns each point in the dataset to the cluster consisting of the nearest center and determines each cluster’s center value. Depending upon the new values of the centers, the second phase repeats until those values converge to the same value. Some of the important features of the K-means algorithm are being a common, fast, and well-known algorithm. It reaches convergence quickly because of its simplicity. Algorithm 1 demonstrates the steps of the K-means clustering algorithm.Algorithm 1: K-means Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek cluster centers(centroids) from X(4)
Repeat(5)
Expectation: assign each point to its closest centroid.(6)
Maximization: the mean of all points belonging to each cluster specifies the new centroidUntil the centroid positions converge to a constant value


#### 4.2.2. K-Means++

Although the K-means clustering algorithm is fast and simple in practice, recent works have mainly focused on improving the initialization procedure. Finding a better way to initialize the clusters, changes Lloyd’s iteration’s performance, and improve quality and convergence properties. Ostrovsky et al. [48] found that a simple procedure of selecting a good starting point could provide a good theoretical guarantee for the quality of the solution. They named this method the K-means++ clustering algorithm. The superiority of the K-means++ to the K-means clustering algorithm is implementing a better initialization approach to select the first k centers. In contrast to the K-means algorithm, the K-means++ algorithm only selects one cluster randomly. The remaining (k-1) centers are chosen systematically with a probability that is proportional to their contribution to the overall error. According to various datasets, the K-means++ algorithm makes considerable improvements compared to the K-means clustering algorithm, randomly selecting the centers. The steps involved in K-means++ clustering algorithm are illustrated in Algorithm 2.Algorithm 2: K-means++ Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initialize1 cluster centers(centroids) from X(4)
Selectk-1 cluster centers(centroids) systematically with a probability that is proportional to their contribution to the overall error from X(5)
Repeat(6)
Expectation: assign each point to its closest centroid.(7)
Maximization: the mean of all points belonging to each cluster specifies the new centroidUntil the centroid positions converge to a constant value


#### 4.2.3. Expectation-Maximization Using Gaussian Mixture Models (EM-GMM)

The Gaussian mixture models (GMMs) consider the Gaussian distribution of clusters so that a cluster can be described by its mean and standard deviation [49]. GMMs are more flexible than K-means because they assume that clusters are Gaussian, while the K-means algorithm considers them circular. The parameters of the Gaussian distribution for each cluster are applied to optimize the EM (expectation-maximization) algorithm. The E-step in the EM algorithm focuses on probability estimation and parameter initialization. Then, the M-step maximizes the parameters through the probability estimates calculated in the E-step. The steps for the EM-GMM algorithm are outlined in Algorithm 3.Algorithm 3: EM-GMM Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek cluster centers (centroids) from X(4)
Set the Gaussian parameters(5)
Repeat(6)
Expectation: assign each point with a probability to a cluster(7)
Maximization: calculate the center of cluster(centroid) kUntil the centroid positions converge to a constant value


#### 4.2.4. Partitioning around Medoids (PAM)

The K-medoids algorithm is a modified version of the K-means algorithm. The K-medoids and K-means algorithms partition the dataset into groups and explore to minimize squared errors, which calculate the distance between the point designated as the center of that cluster and the points labeled to be in a cluster. The K-medoids algorithm chooses data points as centers, in contrast to the K-means algorithm. One of the best-known versions of K-medoids is PAM. It is a kind of iterative optimization that combines relocating the points between perspective clusters with renominating them as potential medoids [50]. A medoid can be specified as the object of a cluster whose average dissimilarity to all the objects in the cluster is minimal (i.e., it is the most centrally located point in a given dataset). The PAM algorithm operates in several steps. At first, the algorithm randomly selects k of the n data points as the medoids. Then, it associates each data point with the closest medoid by considering a distance method (e.g., Euclidean distance, Manhattan distance, and Minkowski distance). After that, the algorithm swaps each medoid and nonmedoid data point and computes the total cost of the configuration. Next, the lowest cost option is selected. Finally, the algorithm repeats until there is no change in the medoid. Algorithm 4 shows the steps of the PAM algorithm.Algorithm 4: PAM Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek medoids from X(4)
Repeat(5)
Expectation: assign each point to its closest medoid.(6)
Maximization: specify the new medoid for cluster k.Until the medoids have no change


## 4.1. The Sample Average Approximation (SAA)

There are several solution methods, such as the SAA to solve stochastic models. The SAA method solves stochastic programming problems based on the Monte Carlo simulation method. It generates a random sample and approximates the expected value function with the corresponding sample average function. The stop criterion determines how long the algorithm will last. Over the years, various authors have employed the idea of sample average approximation to solve stochastic programs. For example, it was employed to solve stochastic knapsack problems [39], stochastic routing problems [40], supply chain problems [41], and investment problems [42]. Due to the high applicability of the SAA method, it has been selected to solve the model in this study. The method is delineated below.LetM, N, and N′ be the number of replications, the number of scenarios in the sample problem, and the sample size used to estimate CTx^+EQX^,ξ for a given feasible solution x^, respectively. So, the SAA method can be described as follows [40]:(1)
Form = 1,..., M, repeat the following steps:(a)
Generate N random sampleξ1, ξ2 ,…, ξN.(b)
Solve the problem by the SAA method and letX^Nm be the solution vector and Z^Nm the optimal objective value.(c)
Generate independent random sampleξ1, ξ2 ,…, ξN′. Evaluate g^N′X^Nm and Sg^N′X^Nm2 as follows:(49)g^N′X^Nm=∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+1N′∑n=1N′∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ.(50)Sg^N′X^Nm2=1N′N′−1∑n=1N′∑d=1D∑m=1M∑i=1Ixx∑j=1Nhjcajaaijxximd+∑d=1D∑m=1M∑i=1Ixy∑j=1Nhjcbjabijxyimd+∑d=1D∑m=1M∑i=1Ixz∑j=1Nhjccjacijxzimd+∑d=1D∑m=1M∑iϵSϕξc1ipimdξ+c2iqimdξ−g^N′X¯,(2)
EvaluateZ¯NM and SZ¯NM2.(51)Z¯NM=1M∑m=1MZ^Nm,SZ¯NM2=1M−1M∑m=1MZ^Nm−Z¯NM2,The confidence interval for the optimality gap can be calculated as follows:(52)g^N′X^Nm−Z¯NM+ZαSg^N′X¯2+SZ¯NM20.5,Here isZα=Φ−11−α, where ΦZ is the cumulative distribution of the standard normal distribution.(3)
For each solutionX^Nm, m = 1,...,M, estimate the optimality gap by g^N′X^Nm−Z¯NM, along with an estimated variance of Sg^N′X^Nm2+SZ¯NM2. Choose one of the M candidate solutions based on the least estimated objective value.In the algorithm,Z¯NM and g^N′X^Nm are the lower bound (LB) and the upper bound (UB) of the optimal value, respectively [43]. The parameter Z¯NM shows an unbiased estimator of the optimal objective function EZ^N. Here,Z¯NM=EZ^N and EZ^N≤Z∗. Moreover, g^N′X^Nm presents an unbiased estimator of the objective value EZ^N, but Eg^N′X^Nm≥Z∗. An increase in the value of N causes an increase in the accuracy of the response as well as an exponential rise in the solution time [40]. Thus, by selecting sample size N, there is a trade-off between the computational complexity and the qualities obtained through solving the problem. The next section introduces clustering as one of the proposed methods to reduce the number of scenarios.


## 4.2. Clustering Techniques in Sample Average Approximation

In real-world situations with large problems, the SAA algorithm performs well, but the computation time is long and the method is inefficient. So far, just a few studies have been conducted on scenario clustering to solve optimization problems. Those who have tried to resolve this issue use clustering algorithms to group similar scenarios and generate samples. Crainic et al. [44] grouped progressive hedging algorithm scenarios by a machine learning method and applied the approach to a stochastic network design problem. They used clustering techniques inside a partial Benders decomposition algorithm to reduce the number of feasibility and optimality cuts generated by the algorithm. Emelogu et al. [45] employed clustering techniques to improve the SAA algorithm. They update the sample sizes dynamically and make high-quality solutions within a reasonable time. Sim [36] focused on clustering algorithms to categorize scenarios before selecting a random sample for the SAA algorithm. They extracted the data from a facility location problem. Clustering is the unsupervised classification that divides data into groups of similar objects [46]. Each group is called a cluster that contains similar data. Clustering algorithms are divided into three main categories: (1) partitional clustering; (2) hierarchical clustering; and (3) density-based clustering. Partitional clustering methods are divided into two subcategories, namely, centroid and medoid. The centroid algorithm specifies each cluster based on the gravity center of instances. Each cluster consists of the instances closest to the gravity center in the medoid algorithm. In this method, the numbers of the clusters are determined in advance. The hierarchical clustering method builds a tree of clusters known as a dendrogram that organizes clusters from the top-down. The density-based clustering algorithm determines the number of clusters automatically. This method divides data based on different criteria, such as connectivity, boundary, and region. Since in this research, clustering is done for different scenarios of patients’ demand and the number of clusters is determined in advance, partitional clustering methods (e.g., K-means, K-means++, PAM, and EM-GMM) have been used for clustering the scenarios for the SAA algorithm. Then, a lower bound for the problem is obtained through the clustered scenarios. Figure 2(a) shows all the possible scenarios generated by a stochastic program in a solution space. The original SAA takes a few scenarios as samples (N) from all the possible ones and calculates the objective function iteratively until M solutions are obtained. However, I-SAA groups the scenarios in the form of a cluster where each scenario highly represents that cluster (Figure 2(b)). The number of the scenarios (Nk) for the I-SAA algorithm is the reduced form of each cluster (Figure 2(c)) [45].Figure 2
Representation of scenario aggregation performed in the I-SSA.The implementation of the I-SAA method is summed up as follows:(1)
Form = 1, ..., M, repeat the steps below:(a)
GenerateNL random sample ξ1, ξ2,…, ξNL(NL≫N).(b)
Use one of the clustering techniques described in Section and clusterNL samples to yield Nk scenario.(c)
Solve the problem by the I-SAA method and letX^Nkm be the solution vector and Z^Nkm the optimal objective value.(d)
Generate an independent random sampleξ1, ξ2 ,…, ξN′(N′≫NL). Evaluate g^N′X^Nkm and Sg^N′X^Nkm2.(2)
EvaluateZ¯NkM and SZ¯NkM2.(53)Z¯NkM=1M∑m=1MZ^Nkm,SZ¯NkM2=1M−1M∑m=1MZ^Nkm−Z¯NkM2.(3)
Estimate the optimality gapg^N′X^Nkm−Z¯NkM for each solution X^Nkm and the estimated variance of Sg^N′X^Nkm2+SZ¯NkM2, m = 1, ..., M. Choose one of the M candidate solutions based on the least estimated objective value.Sections4.2.1 to 4.2.4 describe these clustering methods used in the original SAA algorithm.


### 4.2.1. K-Means

Lloyd [47] proposed the K-means algorithm in 1957. Sometimes referred to as the Lloyd’s algorithm, K-means is an easy, simple, efficient, and the most popular unsupervised learning algorithm used to classify a given dataset into a certain number of clusters in such a way that each dataset belongs to one cluster with the same properties. It has two phases. The first phase chooses the initial k centers at random. The second phase assigns each point in the dataset to the cluster consisting of the nearest center and determines each cluster’s center value. Depending upon the new values of the centers, the second phase repeats until those values converge to the same value. Some of the important features of the K-means algorithm are being a common, fast, and well-known algorithm. It reaches convergence quickly because of its simplicity. Algorithm 1 demonstrates the steps of the K-means clustering algorithm.Algorithm 1: K-means Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek cluster centers(centroids) from X(4)
Repeat(5)
Expectation: assign each point to its closest centroid.(6)
Maximization: the mean of all points belonging to each cluster specifies the new centroidUntil the centroid positions converge to a constant value


### 4.2.2. K-Means++

Although the K-means clustering algorithm is fast and simple in practice, recent works have mainly focused on improving the initialization procedure. Finding a better way to initialize the clusters, changes Lloyd’s iteration’s performance, and improve quality and convergence properties. Ostrovsky et al. [48] found that a simple procedure of selecting a good starting point could provide a good theoretical guarantee for the quality of the solution. They named this method the K-means++ clustering algorithm. The superiority of the K-means++ to the K-means clustering algorithm is implementing a better initialization approach to select the first k centers. In contrast to the K-means algorithm, the K-means++ algorithm only selects one cluster randomly. The remaining (k-1) centers are chosen systematically with a probability that is proportional to their contribution to the overall error. According to various datasets, the K-means++ algorithm makes considerable improvements compared to the K-means clustering algorithm, randomly selecting the centers. The steps involved in K-means++ clustering algorithm are illustrated in Algorithm 2.Algorithm 2: K-means++ Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initialize1 cluster centers(centroids) from X(4)
Selectk-1 cluster centers(centroids) systematically with a probability that is proportional to their contribution to the overall error from X(5)
Repeat(6)
Expectation: assign each point to its closest centroid.(7)
Maximization: the mean of all points belonging to each cluster specifies the new centroidUntil the centroid positions converge to a constant value


### 4.2.3. Expectation-Maximization Using Gaussian Mixture Models (EM-GMM)

The Gaussian mixture models (GMMs) consider the Gaussian distribution of clusters so that a cluster can be described by its mean and standard deviation [49]. GMMs are more flexible than K-means because they assume that clusters are Gaussian, while the K-means algorithm considers them circular. The parameters of the Gaussian distribution for each cluster are applied to optimize the EM (expectation-maximization) algorithm. The E-step in the EM algorithm focuses on probability estimation and parameter initialization. Then, the M-step maximizes the parameters through the probability estimates calculated in the E-step. The steps for the EM-GMM algorithm are outlined in Algorithm 3.Algorithm 3: EM-GMM Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek cluster centers (centroids) from X(4)
Set the Gaussian parameters(5)
Repeat(6)
Expectation: assign each point with a probability to a cluster(7)
Maximization: calculate the center of cluster(centroid) kUntil the centroid positions converge to a constant value


### 4.2.4. Partitioning around Medoids (PAM)

The K-medoids algorithm is a modified version of the K-means algorithm. The K-medoids and K-means algorithms partition the dataset into groups and explore to minimize squared errors, which calculate the distance between the point designated as the center of that cluster and the points labeled to be in a cluster. The K-medoids algorithm chooses data points as centers, in contrast to the K-means algorithm. One of the best-known versions of K-medoids is PAM. It is a kind of iterative optimization that combines relocating the points between perspective clusters with renominating them as potential medoids [50]. A medoid can be specified as the object of a cluster whose average dissimilarity to all the objects in the cluster is minimal (i.e., it is the most centrally located point in a given dataset). The PAM algorithm operates in several steps. At first, the algorithm randomly selects k of the n data points as the medoids. Then, it associates each data point with the closest medoid by considering a distance method (e.g., Euclidean distance, Manhattan distance, and Minkowski distance). After that, the algorithm swaps each medoid and nonmedoid data point and computes the total cost of the configuration. Next, the lowest cost option is selected. Finally, the algorithm repeats until there is no change in the medoid. Algorithm 4 shows the steps of the PAM algorithm.Algorithm 4: PAM Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek medoids from X(4)
Repeat(5)
Expectation: assign each point to its closest medoid.(6)
Maximization: specify the new medoid for cluster k.Until the medoids have no change


## 4.2.1. K-Means

Lloyd [47] proposed the K-means algorithm in 1957. Sometimes referred to as the Lloyd’s algorithm, K-means is an easy, simple, efficient, and the most popular unsupervised learning algorithm used to classify a given dataset into a certain number of clusters in such a way that each dataset belongs to one cluster with the same properties. It has two phases. The first phase chooses the initial k centers at random. The second phase assigns each point in the dataset to the cluster consisting of the nearest center and determines each cluster’s center value. Depending upon the new values of the centers, the second phase repeats until those values converge to the same value. Some of the important features of the K-means algorithm are being a common, fast, and well-known algorithm. It reaches convergence quickly because of its simplicity. Algorithm 1 demonstrates the steps of the K-means clustering algorithm.Algorithm 1: K-means Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek cluster centers(centroids) from X(4)
Repeat(5)
Expectation: assign each point to its closest centroid.(6)
Maximization: the mean of all points belonging to each cluster specifies the new centroidUntil the centroid positions converge to a constant value


## 4.2.2. K-Means++

Although the K-means clustering algorithm is fast and simple in practice, recent works have mainly focused on improving the initialization procedure. Finding a better way to initialize the clusters, changes Lloyd’s iteration’s performance, and improve quality and convergence properties. Ostrovsky et al. [48] found that a simple procedure of selecting a good starting point could provide a good theoretical guarantee for the quality of the solution. They named this method the K-means++ clustering algorithm. The superiority of the K-means++ to the K-means clustering algorithm is implementing a better initialization approach to select the first k centers. In contrast to the K-means algorithm, the K-means++ algorithm only selects one cluster randomly. The remaining (k-1) centers are chosen systematically with a probability that is proportional to their contribution to the overall error. According to various datasets, the K-means++ algorithm makes considerable improvements compared to the K-means clustering algorithm, randomly selecting the centers. The steps involved in K-means++ clustering algorithm are illustrated in Algorithm 2.Algorithm 2: K-means++ Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initialize1 cluster centers(centroids) from X(4)
Selectk-1 cluster centers(centroids) systematically with a probability that is proportional to their contribution to the overall error from X(5)
Repeat(6)
Expectation: assign each point to its closest centroid.(7)
Maximization: the mean of all points belonging to each cluster specifies the new centroidUntil the centroid positions converge to a constant value


## 4.2.3. Expectation-Maximization Using Gaussian Mixture Models (EM-GMM)

The Gaussian mixture models (GMMs) consider the Gaussian distribution of clusters so that a cluster can be described by its mean and standard deviation [49]. GMMs are more flexible than K-means because they assume that clusters are Gaussian, while the K-means algorithm considers them circular. The parameters of the Gaussian distribution for each cluster are applied to optimize the EM (expectation-maximization) algorithm. The E-step in the EM algorithm focuses on probability estimation and parameter initialization. Then, the M-step maximizes the parameters through the probability estimates calculated in the E-step. The steps for the EM-GMM algorithm are outlined in Algorithm 3.Algorithm 3: EM-GMM Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek cluster centers (centroids) from X(4)
Set the Gaussian parameters(5)
Repeat(6)
Expectation: assign each point with a probability to a cluster(7)
Maximization: calculate the center of cluster(centroid) kUntil the centroid positions converge to a constant value


## 4.2.4. Partitioning around Medoids (PAM)

The K-medoids algorithm is a modified version of the K-means algorithm. The K-medoids and K-means algorithms partition the dataset into groups and explore to minimize squared errors, which calculate the distance between the point designated as the center of that cluster and the points labeled to be in a cluster. The K-medoids algorithm chooses data points as centers, in contrast to the K-means algorithm. One of the best-known versions of K-medoids is PAM. It is a kind of iterative optimization that combines relocating the points between perspective clusters with renominating them as potential medoids [50]. A medoid can be specified as the object of a cluster whose average dissimilarity to all the objects in the cluster is minimal (i.e., it is the most centrally located point in a given dataset). The PAM algorithm operates in several steps. At first, the algorithm randomly selects k of the n data points as the medoids. Then, it associates each data point with the closest medoid by considering a distance method (e.g., Euclidean distance, Manhattan distance, and Minkowski distance). After that, the algorithm swaps each medoid and nonmedoid data point and computes the total cost of the configuration. Next, the lowest cost option is selected. Finally, the algorithm repeats until there is no change in the medoid. Algorithm 4 shows the steps of the PAM algorithm.Algorithm 4: PAM Algorithm.
(1)
X : set of data points(2)
k: number of clusters(3)
Randomly initializek medoids from X(4)
Repeat(5)
Expectation: assign each point to its closest medoid.(6)
Maximization: specify the new medoid for cluster k.Until the medoids have no change


## 5. Numerical Experiments

### 5.1. Example Data

This section reports a case study planned at the Iranian Health Control Center, which provides palliative services to cancer patients. It currently serves about 370 patients. Before doing this research, planning was done manually by a care facilitator. Manual planning is very time-consuming, and it is not possible to take into account all the limitations. Therefore, the data are based on the Iranian Health Control Center, which can help with better planning in this center. Service providers with different skills, including nurses, general practitioners, and specialists, work in this center for 24 working days a month. Each day contains morning, afternoon, and night shifts. For the first model, the rate of the change indim and cajm is 5% of the nominal value. The corresponding data are obtained from the Iranian Health Control Center to evaluate the distribution of the demand for each skill per day and shift. The demand has a uniform distribution in the intervals of (24, 56), (12, 32), and (6, 14) per hour for nurses, general practitioners, and specialists on each shift, respectively. Table 4 shows the cost per hour as contracted for different skills. The additional cost for a nurse, general practitioner, and specialist is 90, 160, and 240 dollars per hour, respectively. The unemployment cost for each one is 50, 70, and 110 dollars per hour, respectively. There are also four holidays a month, and the working duration of full-time, part-time, and hourly contracts is 160, 80, and 40 hours, respectively. Each service provider can work for a maximum of five consecutive days.Table 4
The wage of each skill per hour ($).
NurseGeneral practitionerSpecialistFull-time5060110Part-time60110150Hourly70150200


### 5.2. Experimental Results

This section describes the experimental results obtained by implementing the proposed approach in the Iranian Health Control Center. The calculations conducted in this case are robust model calculations and two-stage stochastic programming model calculations. The proposed approach is implemented by the GUROBI 9.1(http://www.gurobi.com/) optimization solver on a Macbook pro with an 8-core CPU and an 8 GB RAM.In the first step, robust model calculations are performed with different values of the conservatism level (Γ). Figure 3 shows the variation in the conservatism level (Γ) versus the total cost. As can be seen, the total cost increases with an increase in Γ (i.e., when the size of the uncertainty set increases). The results obtained for the total cost and the robustness are presented in Table 5. The robustness value is proportional to the total cost, as determined by the robust optimization and the deterministic method. The total cost remains constant when the conservatism level (Γ) reaches 7.6. In the following, the probability of violating the constraints will be determined by simulation.Figure 3
The optimal value of the total cost as a function of Γ.Table 5
Price of robustness.
ΓOptimal valueRobustness value (%)ΓOptimal valueRobustness value (%)04483.2—2.75059.212.84800.14540.81.28483.15102.413.81160.34564.81.82013.2511214.02570.64694.44.71093.35131.214.45400.94718.45.24633.6513614.56101.14737.65.67453.75155.214.98931.24795.26.95933.95179.215.52461.64814.47.38764.6520816.16701.74838.47.92294.85212.816.27411.848969.20775.6528017.77301.949209.74305.7530418.308424977.611.02786.85313.618.52252.14982.411.13497.1532818.84372.25035.212.31267.6535219.3790Figure4 illustrates the simulation results for the probability of violating the constraints with 10,000 repetitions. More conservatism leads to increased costs, and the probability of constraint violation is close to zero.Figure 4
Simulation results for the probability of violation.Table6 presents the probability of constraint violation and a sample of the objective function value. As the protection level rises, the optimal value is marginally affected. For instance, with an increase of the objective function by 6.96%, the probability of constraint violation is just 0.26%.Table 6
Probability of violation.
ΓProbability of violationTotal costIncrease (%)ΓProbability of violationTotal costIncrease (%)00.99984483.2—2.705059.212.850.10.99274540.81.283.105102.413.810.30.99064564.81.823.20511214.030.60.47174694.44.713.305131.214.450.90.46874718.45.253.60513614.561.10.31154737.65.673.705155.214.991.20.26064795.26.963.905179.215.521.604814.47.394.60520816.171.704838.47.924.805212.816.271.8048969.215.60528017.771.9049209.745.70530418.31204977.611.036.805313.618.522.104982.411.137.10532818.842.205035.212.317.60535219.38As shown in Table6, an increase of Γ raises the total cost to some extent; when the value of Γ reaches 7.6, the total cost remains constant, but there is a rise of 19.38% in it compared to certain conditions. In addition, the robustness value, which represents the status of the objective function, is not high enough to protect against the constraint violation. The computational time for solving the problem is reasonable. Therefore, to solve the model in the next step, a case is considered, in which the cost does not change. With a Γ value of 7.6, the number of service providers is determined for each skill and contract, and the input of the mathematical model becomes known in the next step.In the second part, the two-stage stochastic programming model is solved based on the results obtained through solving the robust model, which is designed to determine the number of the required service providers. As mentioned in Section4.2, different methods have been used to cluster scenarios. Based on the initial experiments performed by the SAA method, N is 100. Besides, the Nk (number of clusters) of 20 achieved by clustering methods has yielded better results. Therefore, the model solution is based on these values. In the approach proposed in this study, N = 100, M = 10 and N′ = 20,000 for the original SAA algorithm presented in Section 4.1, and Nk=20, NL=1000, M = 10 and N′ = 20,000 for the I-SAA presented in Section 4.2. These results are reported in Tables 7 and 8. The columns Z^Nm and Z^Nkm specify the objective function’s optimal value considering the N and Nk scenarios, respectively. The time column indicates the solution time in seconds. The Gap column shows g^N′X^Nm−Z¯NM, and the Var column shows Sg^N′X^Nm2+SZ¯NM2 for the original SAA. Also, g^N′X^Nkm−Z¯NkM and Sg^N′X^Nkm2+SZ¯NkM2 represent the Gap and the Var for the I-SAA, respectively. The original SAA method has the lowest Gap and Var among all the methods. K-means++ has the lowest Gap of the clustering methods, which indicates the most convergence to the optimal solution. Also, the K-means++ method has the lowest mean Var, which denotes the lowest mean-variance of the optimality gap estimate. Next to the k-means++ algorithm, the K-means, PAM, and EM-GMM algorithms have the lowest mean values of Var, respectively.Table 7
Statistics for each algorithm (Z^Nm and time).
SAAI-SAAK-meansK-means++EM-GMMPAMMZ^NmTimeZ^NkmTimeZ^NkmTimeZ^NkmTimeZ^NkmTime1436132.54.49429985.51.464342691.57424964.51.42431521.51.642437549.74.37430258.51.4432845.51.52430353.51.484254281.5934368234.52429723.51.47434158.51.56427920.51.4425048.51.524436089.74.43428564.51.45434610.01.47426269.51.46428647.51.445435876.94.564244051.674342691.54252421.45423996.51.756435031.24.38424265.52.83430973.51.48422452.51.59424269.51.497435771.15.144275631.474350591.424305501.55427605.51.58435976.94.4430788.51.48431701.51.48430101.51.544221191.469434353.64.43429696.51.55432895.51.51432737.51.494296521.4810436355.14.5429849.51.53434522.51.534337581.614310321.46Table 8
Statistics for each algorithm (Gap and Var).
SAAI-SAAK-meansK-means++EM-GMMPAMMGapVarGapVarGapVarGapVarGapVar12075.2580444.8111133.32568383.37851.01418813.511926.14134476614691.07104008121961.3980396.8110551.23568258.78294.86418848.311051.47134489114744.03104004432176.3880457.3412884.33568204.26647.68419070.211613.63134491015398.69104016741982.2980502.2112282.48568329.26510.06418948.414072.82134476412930.52104026851903.7380389.5511255.07568203.68268.36418854.710050.89134513615007.42104021462088.280406.911495.52568620.86570.52418978.311123.61134511713632.48104025572025.1680484.9110706.765684394904.69445945.410271.39134492513020.84104021281989.4280422.112321.22568252.26783.6241899711594.9134490513331.85104031592135.1380453.5711168.33568115.26474.6419029.811593.65134498614044.611040176101887.8180461.310271.09568299.97872.85419019.811875.14134487113728.781040055Figure5 displays the boxplots of Z^Nm for the original SAA algorithm and Z^Nkm for the I-SAA. The original SAA algorithm is shown to have the smallest distribution. The K-means algorithm has a small distribution, but it has outliers farther from the mean. The original SAA algorithm has the largest Z^km of 435995.97 as well as the smallest standard deviation at 878.61. The K-mean++ is the next best algorithm in terms of both Z^km and standard deviation, with an average of 433530.4 and 1363.28. The EM-GMM and PAM algorithms have the largest standard deviations of 3220.57 and 3663.04, respectively.Figure 5
Boxplots of the optimal solution for each algorithm.In addition,g^N′X^Nm and g^N′X^Nkm are the upper bounds of the optimal solution. Figure 6 presents the boxplots of g^N′X^Nm for the SAA algorithm and g^N′X^Nkm for the I-SAA with different clustering algorithms. The lowest value of g^N′X^Nkm in the K-means++ method is 437820.84, and the maximum value is 442507.77, which is obtained through the EM-GMM method. There is a 1% change in the upper bound limit.Figure 6
Boxplots of the upper bound for each algorithm.The highest value of the upper bound is 442507.77, calculated with the EM-GMM, and the lowest value of the lower bound is 422119, obtained through the PAM method. There is a 5% change in the total cost. The results show that K-means++ and the original SAA have yielded the best responses. Figure7 illustrates the mean of the upper bound and lower bound of the original SAA and I-SAA with different clustering algorithms. The smallest gap between the mean of upper and lower bounds among the clustering algorithms is 1.5%, which is observed in the K-means++ algorithm. This value for the original SAA algorithm is 0.5%, which has a very small difference from the K-means++ algorithm.Figure 7
Mean of the upper bound and the lower bound for each algorithm.The objective of the SAA algorithm is to reduce computing time. The time taken by the original SAA and I-SAA to solve the SSPSP is also considered to compare the algorithms. Figure7 shows the boxplots of the durations for each algorithm to solve the SSPSP for every 10 trials. K-means++ has a better performance than the other algorithms. The K-means and PAM algorithms have the same means, but the K-means++ algorithm has a lower mean and variance. The original SAA algorithm has the slowest run time. The K-means, PAM, and original SAA algorithms have outliers. As Figure 8 suggests, the original SAA algorithm is the slowest, averaging 4.52 seconds. It is also 2.89 seconds slower than the next slowest algorithm, K-means.Figure 8
Boxplots of the solution time for each algorithm.The Mann–Whitney test is employed to compare all the solution time means pairwise to determine which ones are significantly different from the rest. The test has been performed on the mean of the solution times, and the results are provided in Table9. The first and second columns display the algorithm pairs compared. The third column shows the difference between the means. Lastly, the fourth column gives the p values for the likelihood of the cases. Considering the significance level of 0.05, there are four cases in which an algorithm in a pair has performed statistically better than the other. All the clustering algorithms are statistically faster than the original SAA algorithm.Table 9
Mann–Whitney test on the mean time to solve.
μ1μ2diffp valueOriginal SAAK-means++3.0180.00018Original SAAK-means2.8910.00018Original SAAPAM2.8910.00018Original SAAEM-GMM3.0230.00018K-means++K-means0.1270.64903K-means++PAM0.0290.96977K-means++EM-GMM0.0340.76193K-meansPAM0.0980.76184K-meansEM-GMM0.1320.87955PAMEM-GMM0.0340.49515Of all the cases, the K-mean++ algorithm shows the best results regarding the solution time and the optimal value. Thus, 431701.5, as the lowest value of the objective function, is selected as the best response. Tables10–12 show the shift scheduling of nurses, general practitioners, and specialists performed based on the best response obtained. As the tables suggest, morning (MO), afternoon (AF), and night (NI) shifts are specified for each service provider; otherwise, he or she will not be busy.Table 10
Nurses’ schedule.
DaysNurse number123456789101112131415161718192021222324Full-time1AFNIAFMOMO—NIAFNIAFMO—MOAFNIMOAF—NIAFNIAFAF—2AF—NIAFAFAFAF—AFNIAFNIMO—AFNIMONIMO—MOMONIAF3AFMOMO—AFNIAFNIAF—NIMONIAFAF—MOAFNIMOAF—NIAF4NIMOMONI—MOAFAFAFNI—MONI—MOAFNIMOMO—NIMOAFAF5—NIMOMOMOMO—NIMOAFMOMO—NIAFMONIAF—NIMONIMOMO6NIAFNIMOAF—NIMOMOMOAF——NIMONIMOMO—AFMOAFMONI7—NIAFNIMOMO—MONIMOMONI—MOMONIAFAF—NIAFMOAFMO8MOMO—MOMOAFNIAF—MOMONIAFNI—NIAFMOMOMO—NIMOMO9MOAFNIAF—MOMONIAFAF—AFAFNIAFMO—NIAFNIAF—NIMO10NIAFMONI—AFMOAFMONI—AFNIMONIAF—MOAFAFAFNI—AF11—AFAFAFAFNI—NIMOAFAFAF—AFNIMOMONI—AFMOAFAFNI12MONIAFAFNI—MOMONIMONI—AFAFMOAFNI—AFMONIAFMO—Part-time13—AFMO—NI——————NI—MO—————MO———NI14————NI——MONI————————NI——————15—NI———NI———NI—————————NIAF———16——————MOMO————MO——AF————————17————NI—————NI———NI——AFMO—————18——NI———AF————————NIAF—NI—————19————NIAFAF———————————AF——NI——20AFMO————MO——————NI——AF—NI—————21——NI——NI———NI——NI——————NI————22—————NI————NI————AFNI—MO—MONI——23————NI—NI——————MO—AF————NI—NI—24————NI———————MOMO—————MO————25——————NI———————MO————————NI26NI————NI————AF—MOAFNI——NI———MO—NI27———NI———————AF——NI———NI—NI———28———————————MO——AFMO———NI————29MO————AF——————AF———MOAFAFAF—MONI—30——AFNI————NI—NI—————NI—NI—————Table 11
General practitioners’ work schedule.
DaysGeneral practitioner123456789101112131415161718192021222324NumberFull-time1MOAFNIAF——NIMOMO—AFNIMOMO—NIAFAFAFMO—AFAFMOAF2AFMOMONIMO—MONIAFNI—NIAFMOMONI—AF—MONIAFAFAF3MOMOMOMONI—NIAFMOMOAF—MONIMOAFMO—NI—NIMONIMO4AFAFNIMOAF—AFNIAF—MOAFAFMO—MOAFMOAFNI—NIAFNI5NI—AFNIAFAFNI—MOAFAFAF—NIAFNIMONI—AFMOMOMOMOPart-time6—NI———NI—————MONI——MO——NI—MO———7—————MOAF——NI——NIAF—MONI—————NI—8—NI———MO——NI—NI—NIAFAF—NI—————NI—9—————AF————NI———NI—NI—AF—————10—NI—AF—MO—AF—NI——————NI—MO—————11NI—AF—NI——AF—MOMO——————MOAF—————12——AF—MOAF—MONI—MONI——————NIMO—NI——13—NI—AF—MO———————————NI—————NI14————MONIAF——MO—NI—AF—————NI————15————NI——MONI——MONIAFNI——NI—MO—NI——16NI———————NI—————AF——MOMOAFAF——NITable 12
Specialists’ work schedule.
DaysSpecialist number123456789101112131415161718192021222324Full-time1AFNIMO—NI—NIMONI—MO—AFAF—MOMONIAFNI—MOAFAF2MONIMOAF—NIAFNIMOAF—AF——NIMOAFAFNI——NIMOMO3NIMOAFNI—AFAFMO—NIAF——MONIAFNI—MOMOAF—NIMO4—AFAFMOMONI—AF—MO—NIMONIMONI—MONIAFMO—NIAF5—AFNI—AFMOMO—AF—NIMONI—AFAFMONIAF—NIAFAFNI


### 5.3. Managerial Implications

Long-term planning for service providers is one of the most important issues in healthcare organizations. Considering the uncertainties in the demand of patients, especially cancer patients, an appropriate approach to planning is the robust approach, which conservatively determines the number of service providers required. By planning at a strategic level, managers face fewer tactical shortcomings. At the tactical level, where decisions are made to schedule service providers’ shifts, managers’ power increases to decide on stochastic patients’ demands and service providers’ working conditions.In addition to the significant cost reduction resulting from more efficient shift scheduling, the daily use of shift schedules has important managerial implications for the workload of home care, hospital administrators, and service providers. It also frees those individuals to deal with other tasks requiring more direct patient interactions. By setting shift schedules, subjectivity can be excluded from the decisions, and it is possible to use training courses and update the service providers in their free time. Another advantage of this planning is that it provides a robust program against changes in patient demand. Continued use of this plan can be beneficial for patients; necessary predictions have already been made if a shortage of service providers ever occurs. Based on clustered scenarios, managers can also make better decisions in the future. More efficient plans can be made if cooperation between the Iranian Health Control Center and the university continues. Hospitals and other home care centers can use these plans with more required constraints.


## 5.1. Example Data

This section reports a case study planned at the Iranian Health Control Center, which provides palliative services to cancer patients. It currently serves about 370 patients. Before doing this research, planning was done manually by a care facilitator. Manual planning is very time-consuming, and it is not possible to take into account all the limitations. Therefore, the data are based on the Iranian Health Control Center, which can help with better planning in this center. Service providers with different skills, including nurses, general practitioners, and specialists, work in this center for 24 working days a month. Each day contains morning, afternoon, and night shifts. For the first model, the rate of the change indim and cajm is 5% of the nominal value. The corresponding data are obtained from the Iranian Health Control Center to evaluate the distribution of the demand for each skill per day and shift. The demand has a uniform distribution in the intervals of (24, 56), (12, 32), and (6, 14) per hour for nurses, general practitioners, and specialists on each shift, respectively. Table 4 shows the cost per hour as contracted for different skills. The additional cost for a nurse, general practitioner, and specialist is 90, 160, and 240 dollars per hour, respectively. The unemployment cost for each one is 50, 70, and 110 dollars per hour, respectively. There are also four holidays a month, and the working duration of full-time, part-time, and hourly contracts is 160, 80, and 40 hours, respectively. Each service provider can work for a maximum of five consecutive days.Table 4
The wage of each skill per hour ($).
NurseGeneral practitionerSpecialistFull-time5060110Part-time60110150Hourly70150200


## 5.2. Experimental Results

This section describes the experimental results obtained by implementing the proposed approach in the Iranian Health Control Center. The calculations conducted in this case are robust model calculations and two-stage stochastic programming model calculations. The proposed approach is implemented by the GUROBI 9.1(http://www.gurobi.com/) optimization solver on a Macbook pro with an 8-core CPU and an 8 GB RAM.In the first step, robust model calculations are performed with different values of the conservatism level (Γ). Figure 3 shows the variation in the conservatism level (Γ) versus the total cost. As can be seen, the total cost increases with an increase in Γ (i.e., when the size of the uncertainty set increases). The results obtained for the total cost and the robustness are presented in Table 5. The robustness value is proportional to the total cost, as determined by the robust optimization and the deterministic method. The total cost remains constant when the conservatism level (Γ) reaches 7.6. In the following, the probability of violating the constraints will be determined by simulation.Figure 3
The optimal value of the total cost as a function of Γ.Table 5
Price of robustness.
ΓOptimal valueRobustness value (%)ΓOptimal valueRobustness value (%)04483.2—2.75059.212.84800.14540.81.28483.15102.413.81160.34564.81.82013.2511214.02570.64694.44.71093.35131.214.45400.94718.45.24633.6513614.56101.14737.65.67453.75155.214.98931.24795.26.95933.95179.215.52461.64814.47.38764.6520816.16701.74838.47.92294.85212.816.27411.848969.20775.6528017.77301.949209.74305.7530418.308424977.611.02786.85313.618.52252.14982.411.13497.1532818.84372.25035.212.31267.6535219.3790Figure4 illustrates the simulation results for the probability of violating the constraints with 10,000 repetitions. More conservatism leads to increased costs, and the probability of constraint violation is close to zero.Figure 4
Simulation results for the probability of violation.Table6 presents the probability of constraint violation and a sample of the objective function value. As the protection level rises, the optimal value is marginally affected. For instance, with an increase of the objective function by 6.96%, the probability of constraint violation is just 0.26%.Table 6
Probability of violation.
ΓProbability of violationTotal costIncrease (%)ΓProbability of violationTotal costIncrease (%)00.99984483.2—2.705059.212.850.10.99274540.81.283.105102.413.810.30.99064564.81.823.20511214.030.60.47174694.44.713.305131.214.450.90.46874718.45.253.60513614.561.10.31154737.65.673.705155.214.991.20.26064795.26.963.905179.215.521.604814.47.394.60520816.171.704838.47.924.805212.816.271.8048969.215.60528017.771.9049209.745.70530418.31204977.611.036.805313.618.522.104982.411.137.10532818.842.205035.212.317.60535219.38As shown in Table6, an increase of Γ raises the total cost to some extent; when the value of Γ reaches 7.6, the total cost remains constant, but there is a rise of 19.38% in it compared to certain conditions. In addition, the robustness value, which represents the status of the objective function, is not high enough to protect against the constraint violation. The computational time for solving the problem is reasonable. Therefore, to solve the model in the next step, a case is considered, in which the cost does not change. With a Γ value of 7.6, the number of service providers is determined for each skill and contract, and the input of the mathematical model becomes known in the next step.In the second part, the two-stage stochastic programming model is solved based on the results obtained through solving the robust model, which is designed to determine the number of the required service providers. As mentioned in Section4.2, different methods have been used to cluster scenarios. Based on the initial experiments performed by the SAA method, N is 100. Besides, the Nk (number of clusters) of 20 achieved by clustering methods has yielded better results. Therefore, the model solution is based on these values. In the approach proposed in this study, N = 100, M = 10 and N′ = 20,000 for the original SAA algorithm presented in Section 4.1, and Nk=20, NL=1000, M = 10 and N′ = 20,000 for the I-SAA presented in Section 4.2. These results are reported in Tables 7 and 8. The columns Z^Nm and Z^Nkm specify the objective function’s optimal value considering the N and Nk scenarios, respectively. The time column indicates the solution time in seconds. The Gap column shows g^N′X^Nm−Z¯NM, and the Var column shows Sg^N′X^Nm2+SZ¯NM2 for the original SAA. Also, g^N′X^Nkm−Z¯NkM and Sg^N′X^Nkm2+SZ¯NkM2 represent the Gap and the Var for the I-SAA, respectively. The original SAA method has the lowest Gap and Var among all the methods. K-means++ has the lowest Gap of the clustering methods, which indicates the most convergence to the optimal solution. Also, the K-means++ method has the lowest mean Var, which denotes the lowest mean-variance of the optimality gap estimate. Next to the k-means++ algorithm, the K-means, PAM, and EM-GMM algorithms have the lowest mean values of Var, respectively.Table 7
Statistics for each algorithm (Z^Nm and time).
SAAI-SAAK-meansK-means++EM-GMMPAMMZ^NmTimeZ^NkmTimeZ^NkmTimeZ^NkmTimeZ^NkmTime1436132.54.49429985.51.464342691.57424964.51.42431521.51.642437549.74.37430258.51.4432845.51.52430353.51.484254281.5934368234.52429723.51.47434158.51.56427920.51.4425048.51.524436089.74.43428564.51.45434610.01.47426269.51.46428647.51.445435876.94.564244051.674342691.54252421.45423996.51.756435031.24.38424265.52.83430973.51.48422452.51.59424269.51.497435771.15.144275631.474350591.424305501.55427605.51.58435976.94.4430788.51.48431701.51.48430101.51.544221191.469434353.64.43429696.51.55432895.51.51432737.51.494296521.4810436355.14.5429849.51.53434522.51.534337581.614310321.46Table 8
Statistics for each algorithm (Gap and Var).
SAAI-SAAK-meansK-means++EM-GMMPAMMGapVarGapVarGapVarGapVarGapVar12075.2580444.8111133.32568383.37851.01418813.511926.14134476614691.07104008121961.3980396.8110551.23568258.78294.86418848.311051.47134489114744.03104004432176.3880457.3412884.33568204.26647.68419070.211613.63134491015398.69104016741982.2980502.2112282.48568329.26510.06418948.414072.82134476412930.52104026851903.7380389.5511255.07568203.68268.36418854.710050.89134513615007.42104021462088.280406.911495.52568620.86570.52418978.311123.61134511713632.48104025572025.1680484.9110706.765684394904.69445945.410271.39134492513020.84104021281989.4280422.112321.22568252.26783.6241899711594.9134490513331.85104031592135.1380453.5711168.33568115.26474.6419029.811593.65134498614044.611040176101887.8180461.310271.09568299.97872.85419019.811875.14134487113728.781040055Figure5 displays the boxplots of Z^Nm for the original SAA algorithm and Z^Nkm for the I-SAA. The original SAA algorithm is shown to have the smallest distribution. The K-means algorithm has a small distribution, but it has outliers farther from the mean. The original SAA algorithm has the largest Z^km of 435995.97 as well as the smallest standard deviation at 878.61. The K-mean++ is the next best algorithm in terms of both Z^km and standard deviation, with an average of 433530.4 and 1363.28. The EM-GMM and PAM algorithms have the largest standard deviations of 3220.57 and 3663.04, respectively.Figure 5
Boxplots of the optimal solution for each algorithm.In addition,g^N′X^Nm and g^N′X^Nkm are the upper bounds of the optimal solution. Figure 6 presents the boxplots of g^N′X^Nm for the SAA algorithm and g^N′X^Nkm for the I-SAA with different clustering algorithms. The lowest value of g^N′X^Nkm in the K-means++ method is 437820.84, and the maximum value is 442507.77, which is obtained through the EM-GMM method. There is a 1% change in the upper bound limit.Figure 6
Boxplots of the upper bound for each algorithm.The highest value of the upper bound is 442507.77, calculated with the EM-GMM, and the lowest value of the lower bound is 422119, obtained through the PAM method. There is a 5% change in the total cost. The results show that K-means++ and the original SAA have yielded the best responses. Figure7 illustrates the mean of the upper bound and lower bound of the original SAA and I-SAA with different clustering algorithms. The smallest gap between the mean of upper and lower bounds among the clustering algorithms is 1.5%, which is observed in the K-means++ algorithm. This value for the original SAA algorithm is 0.5%, which has a very small difference from the K-means++ algorithm.Figure 7
Mean of the upper bound and the lower bound for each algorithm.The objective of the SAA algorithm is to reduce computing time. The time taken by the original SAA and I-SAA to solve the SSPSP is also considered to compare the algorithms. Figure7 shows the boxplots of the durations for each algorithm to solve the SSPSP for every 10 trials. K-means++ has a better performance than the other algorithms. The K-means and PAM algorithms have the same means, but the K-means++ algorithm has a lower mean and variance. The original SAA algorithm has the slowest run time. The K-means, PAM, and original SAA algorithms have outliers. As Figure 8 suggests, the original SAA algorithm is the slowest, averaging 4.52 seconds. It is also 2.89 seconds slower than the next slowest algorithm, K-means.Figure 8
Boxplots of the solution time for each algorithm.The Mann–Whitney test is employed to compare all the solution time means pairwise to determine which ones are significantly different from the rest. The test has been performed on the mean of the solution times, and the results are provided in Table9. The first and second columns display the algorithm pairs compared. The third column shows the difference between the means. Lastly, the fourth column gives the p values for the likelihood of the cases. Considering the significance level of 0.05, there are four cases in which an algorithm in a pair has performed statistically better than the other. All the clustering algorithms are statistically faster than the original SAA algorithm.Table 9
Mann–Whitney test on the mean time to solve.
μ1μ2diffp valueOriginal SAAK-means++3.0180.00018Original SAAK-means2.8910.00018Original SAAPAM2.8910.00018Original SAAEM-GMM3.0230.00018K-means++K-means0.1270.64903K-means++PAM0.0290.96977K-means++EM-GMM0.0340.76193K-meansPAM0.0980.76184K-meansEM-GMM0.1320.87955PAMEM-GMM0.0340.49515Of all the cases, the K-mean++ algorithm shows the best results regarding the solution time and the optimal value. Thus, 431701.5, as the lowest value of the objective function, is selected as the best response. Tables10–12 show the shift scheduling of nurses, general practitioners, and specialists performed based on the best response obtained. As the tables suggest, morning (MO), afternoon (AF), and night (NI) shifts are specified for each service provider; otherwise, he or she will not be busy.Table 10
Nurses’ schedule.
DaysNurse number123456789101112131415161718192021222324Full-time1AFNIAFMOMO—NIAFNIAFMO—MOAFNIMOAF—NIAFNIAFAF—2AF—NIAFAFAFAF—AFNIAFNIMO—AFNIMONIMO—MOMONIAF3AFMOMO—AFNIAFNIAF—NIMONIAFAF—MOAFNIMOAF—NIAF4NIMOMONI—MOAFAFAFNI—MONI—MOAFNIMOMO—NIMOAFAF5—NIMOMOMOMO—NIMOAFMOMO—NIAFMONIAF—NIMONIMOMO6NIAFNIMOAF—NIMOMOMOAF——NIMONIMOMO—AFMOAFMONI7—NIAFNIMOMO—MONIMOMONI—MOMONIAFAF—NIAFMOAFMO8MOMO—MOMOAFNIAF—MOMONIAFNI—NIAFMOMOMO—NIMOMO9MOAFNIAF—MOMONIAFAF—AFAFNIAFMO—NIAFNIAF—NIMO10NIAFMONI—AFMOAFMONI—AFNIMONIAF—MOAFAFAFNI—AF11—AFAFAFAFNI—NIMOAFAFAF—AFNIMOMONI—AFMOAFAFNI12MONIAFAFNI—MOMONIMONI—AFAFMOAFNI—AFMONIAFMO—Part-time13—AFMO—NI——————NI—MO—————MO———NI14————NI——MONI————————NI——————15—NI———NI———NI—————————NIAF———16——————MOMO————MO——AF————————17————NI—————NI———NI——AFMO—————18——NI———AF————————NIAF—NI—————19————NIAFAF———————————AF——NI——20AFMO————MO——————NI——AF—NI—————21——NI——NI———NI——NI——————NI————22—————NI————NI————AFNI—MO—MONI——23————NI—NI——————MO—AF————NI—NI—24————NI———————MOMO—————MO————25——————NI———————MO————————NI26NI————NI————AF—MOAFNI——NI———MO—NI27———NI———————AF——NI———NI—NI———28———————————MO——AFMO———NI————29MO————AF——————AF———MOAFAFAF—MONI—30——AFNI————NI—NI—————NI—NI—————Table 11
General practitioners’ work schedule.
DaysGeneral practitioner123456789101112131415161718192021222324NumberFull-time1MOAFNIAF——NIMOMO—AFNIMOMO—NIAFAFAFMO—AFAFMOAF2AFMOMONIMO—MONIAFNI—NIAFMOMONI—AF—MONIAFAFAF3MOMOMOMONI—NIAFMOMOAF—MONIMOAFMO—NI—NIMONIMO4AFAFNIMOAF—AFNIAF—MOAFAFMO—MOAFMOAFNI—NIAFNI5NI—AFNIAFAFNI—MOAFAFAF—NIAFNIMONI—AFMOMOMOMOPart-time6—NI———NI—————MONI——MO——NI—MO———7—————MOAF——NI——NIAF—MONI—————NI—8—NI———MO——NI—NI—NIAFAF—NI—————NI—9—————AF————NI———NI—NI—AF—————10—NI—AF—MO—AF—NI——————NI—MO—————11NI—AF—NI——AF—MOMO——————MOAF—————12——AF—MOAF—MONI—MONI——————NIMO—NI——13—NI—AF—MO———————————NI—————NI14————MONIAF——MO—NI—AF—————NI————15————NI——MONI——MONIAFNI——NI—MO—NI——16NI———————NI—————AF——MOMOAFAF——NITable 12
Specialists’ work schedule.
DaysSpecialist number123456789101112131415161718192021222324Full-time1AFNIMO—NI—NIMONI—MO—AFAF—MOMONIAFNI—MOAFAF2MONIMOAF—NIAFNIMOAF—AF——NIMOAFAFNI——NIMOMO3NIMOAFNI—AFAFMO—NIAF——MONIAFNI—MOMOAF—NIMO4—AFAFMOMONI—AF—MO—NIMONIMONI—MONIAFMO—NIAF5—AFNI—AFMOMO—AF—NIMONI—AFAFMONIAF—NIAFAFNI


## 5.3. Managerial Implications

Long-term planning for service providers is one of the most important issues in healthcare organizations. Considering the uncertainties in the demand of patients, especially cancer patients, an appropriate approach to planning is the robust approach, which conservatively determines the number of service providers required. By planning at a strategic level, managers face fewer tactical shortcomings. At the tactical level, where decisions are made to schedule service providers’ shifts, managers’ power increases to decide on stochastic patients’ demands and service providers’ working conditions.In addition to the significant cost reduction resulting from more efficient shift scheduling, the daily use of shift schedules has important managerial implications for the workload of home care, hospital administrators, and service providers. It also frees those individuals to deal with other tasks requiring more direct patient interactions. By setting shift schedules, subjectivity can be excluded from the decisions, and it is possible to use training courses and update the service providers in their free time. Another advantage of this planning is that it provides a robust program against changes in patient demand. Continued use of this plan can be beneficial for patients; necessary predictions have already been made if a shortage of service providers ever occurs. Based on clustered scenarios, managers can also make better decisions in the future. More efficient plans can be made if cooperation between the Iranian Health Control Center and the university continues. Hospitals and other home care centers can use these plans with more required constraints.


## 6. Conclusion

The major contribution of this research is to help healthcare managers specify the minimum number of service providers required. Since service providers’ daily and monthly workloads fluctuate, the approach proposed by Bertsimas and Sim [37] has been employed to determine the minimum number of those individuals and solve the proposed SPDP. Based on the most conservative responses obtained in the first step of the research, the number of service providers with different skills and contracts is determined for shift scheduling. Real-world situations in this field often involve different sources of uncertainty, such as patient demand. Among those with this demand for uncertainty, one may refer to cancer patients who experience unpredictable conditions during their illness. Thus, a two-stage stochastic programming model has been presented for shift scheduling, and the SAA and I-SAA methods are used to solve the SSPSP. In the first stage, considering the conservatism level of 7.6, the costs increase by 19.38%, which is shown by the simulation that the probability of constraint violation is zero. In the second stage, this research applies different clustering methods (e.g., K-means, K-means++, PAM, and EM-GMM) to the original SAA method and shows that the K-means++ method obtains a good upper and lower bound of the total cost and achieves a near-optimal solution in the shortest time. Also, the highest value of the upper bound is 442507.77, calculated with the EM-GMM method, and the lowest value of the lower bound is 422119, obtained through the PAM method. It shows just a 5% change in the total costs. Therefore, this research makes the shift program of service providers according to the uncertain patients’ demands. A computer-generated provider’s schedule is better than a manually generated one to fulfill the task. Apart from the faster scheduling than the manual approach, an important advantage of the proposed approach is that it eliminates subjectivities; no one is involved in providing schedules in the proposed approach, and the level of the available resources is the only factor affecting the final schedule.Finally, this study presents managerial implications for healthcare authorities who have to solve the problems of dimensioning and scheduling service providers in an uncertain environment.There are several recommendations for future research in providers’ dimensioning and scheduling. The specific skills needed by individual patients can be considered as a basis for assigning relevant service providers. Moreover, the human factors involved in care provision seem interesting topics to study. Other methods can also be tried to solve stochastic programming models. Different robust optimization methods can be applied to providers’ dimensioning problems. Disruptive situations can be considered in a model with rescheduling procedures to deal with them. Finally, models may be developed in other areas, such as fire stations and emergency centers, where shift planning is needed.



---

*Source: 4377142-2022-10-05.xml*