# Bounding the Likelihood of Exceeding Ward Capacity in Stochastic Surgery Scheduling
## 2 Model Development
### Ward Combination Optimization  
From historical data, for the different surgery types, it is possible to estimate the probability that a specific patient is in the ward on any given day. If one discretizes these probabilities (\(\rho_{k}\)) and counts (\(n_{k}\)) how many within each bin or class interval \(k\), then it is possible to approximate the number of patients in the ward by the sum of binomial distributions, or  
\[W(l)\sim\sum_{k\in\mathcal{K}}\mathrm{B}\big{(}n_{k}(l),\rho_{k}\big{)}, \quad\forall\;l\in\mathcal{L} \tag{5}\]  
where \(l\) is an index to a particular combination of patient numbers in each interval class, defined by  
\[l=\sum_{k\in\mathcal{K}^{\prime}}n_{k}|\mathcal{A}|^{|\mathcal{K}|-k+1} \tag{6}\]  
which is a base-\(|\mathcal{A}|\) encoding where \(\mathcal{A}=\{0,\ldots,M^{A}-1\}\) is a set of available staffed ward beds and \(\mathcal{K}^{\prime}\in\{2,\ldots,|\mathcal{K}|-1\}\). Indeed, the number of such combinations will grow exponentially in terms of the number of staffed ward beds and the number of class intervals. However, not all are feasible since those that exceed the number of available staffed ward beds with probability \(\Omega\) can be disregarded. That is, the feasibility of patients in ward combination \(l\) for a given number of available staffed ward beds \(a\) must satisfy  
\[\Pr[W(l)\geq a]\leq\Omega,\quad\forall l\in\mathcal{L},\;a\in\mathcal{A} \tag{7}\]  
Monte Carlo sampling can be used to verify each combination resulting in a binary parameter \(F_{l,a}\), denoting its feasibility. This parameter is utilized by a constraint in our model to bound the likelihood of exceeding the staffed ward beds. In Figure 1, one can see how a distribution for an arbitrary surgery type has been discretized to 5 levels, as illustrated by the dashed line. In this example, the discretization assumes that for the day of the surgery and the day after (0 and 1), the patient will be in the ward with probability \(\rho_{1}=1\). After the ninth day, the patient has left the ward and the probability is \(\rho_{5}=0\). We are only interested in the levels between the first and the last, which is, in this example, \(k\in\mathcal{K}^{\prime}=\{2,\ldots,5-1\}\). The number of patients in the first level (\(n_{1}\)) are used to calculate the number of available staffed ward beds \(a=M^{A}-n_{1}\), where \(M^{A}\) is the total number of staffed ward beds. Once all feasible ORDS and ward combinations have been generated, the scheduling problem is reduced to allocating ORDS to days and rooms subject to the feasibility of the resulting ward combination. Let us introduce a binary decision variable \(x_{d,p,r}\), taking the value 1 if an ORDS \(p\) is assigned on day \(d\in D\) and room \(r\in R\). There are, however, a number of restrictions on which ORDS can be assigned to any given day. These usually center around the availability of the operators and the patients. Additionally, the ORDS's feasibility depends on the OR's capacity for that day, \(C_{d,r}\). As a result, the reduced set \((d,p,r)\in DPR\subseteq D\times P\times R\) is generated taking the following restrictions into account:  
* The availability of the operators for a given day,
* The patients' availability and priority,
* ORDS feasibility for a given day and room, dependent on \(C_{d,r}\) and \(\Delta_{d,r}\). Patient priorities are implemented in practice as a strict number of days that patients can be on the waiting list. As each ORDS spans the whole day, only one ORDS can be assigned to a room and a day,  
\[\sum_{p\in P,r\in R:(d,p,r)\in DPR}x_{d,p,r}\leq 1,\quad\forall d\in D \tag{8}\]  
Similarly, any patient \(i\) can only be scheduled once,  
\[\sum_{(d,p,r)\in DPR:i\in I_{p}}x_{d,p,r}=1,\quad\forall i\in I \tag{9}\]  
where \(I_{p}\) is the set of patients included in ORDS \(p\). It is assumed that all patients must be scheduled, so the throughput is fixed.