# Bounding the Likelihood of Exceeding Ward Capacity in Stochastic Surgery Scheduling
## 2 Model Development
### Ward Combination Optimization
There can be only one ward combination realized each day  
\[\sum_{l\in\mathcal{L}}y_{d,l}=1,\quad\forall\ d\in D \tag{15}\]In order to discover which ward combination resulted from the scheduled ORDS, a base-\(|\mathcal{A}|\) decoder is constructed in the form of the following constraint:  
\[\sum_{l\in\mathcal{L}}ly_{d,l}=\sum_{k\in\mathcal{K}^{\prime}}n_{d,k}|\mathcal{ A}|^{|\mathcal{K}|-k+1},\quad\forall\;d\in D \tag{16}\]  
This constraint may be thought of as searching for a specific row in a table. The right-hand side decodes the combinations of \(n_{d,k}\) into a specific row number, which corresponds to the settings of ward combination \(l\). To make the connection from a certain ward combination to the available staffed ward beds each day, a binary variable \(z_{d,a}\) is introduced, taking the value 1 if on the day \(d\in D\) there are \(a\in\mathcal{A}\) staffed ward beds available; otherwise, it is 0. This variable is linked to the actual number of available staffed ward beds using the following constraint:  
\[\sum_{a\in\mathcal{A}}az_{d,a}=a_{d},\quad\forall\;d\in D \tag{17}\]  
where \(z_{d,a}\) can only take one value each day  
\[\sum_{a\in\mathcal{A}}z_{d,a}=1,\quad\forall\;d\in D \tag{18}\]  
Now, one can force the selection of a feasible ward combinations as follows:  
\[y_{d,l}\leq\sum_{a\in\mathcal{A}}\Gamma_{l,a}z_{d,a},\quad\forall d\in D,\quad l \in\mathcal{L} \tag{19}\]  
where \(F_{l,a}\) is a binary parameter value taking the value 1 if a ward combination \(l\) is feasible with respect to the risk of ward overflow specified by \(\Omega\); otherwise, it is 0 for a given number of available staffed ward beds \(a\in\mathcal{A}\). As explained at the start of this section, the parameter \(F_{l,a}\) is calculated by Monte Carlo sampling prior to the start of the optimization. The purpose of constraints (14) to (19) is to guide the ORDS assignments so that each day's resulting ward combination is feasible. Having specified the constraints that hedge against the risk of ward overflow, we now turn to the objective function. The problem considered in this paper is to schedule a given set of patients (fixed throughput) over the period \(D\) so that both overtime and the likelihood of exceeding the limited number of staffed ward beds are minimized. As we have already set bounds to the likelihood of exceeding the limited number of staffed ward beds with the parameter \(\Omega\), the focus in the objective function is on minimizing the OR overtime and the amount of overtime. Let us introduce the binary variable \(u_{d,r}\), taking the value 1 if \(\delta_{p}>\delta^{\prime}\) and otherwise taking the value of 0, as forced by the following constraint:  
\[\sum_{(d,p,r)\in\mathcal{D}PR:\delta_{p}>\delta^{\prime}}x_{d,p,r}\leq u_{d,r} \tag{20}\]  
and similarly, the binary variable \(v_{d,r}\) taking the value 1 if \(\delta_{p}^{\Delta}>\delta^{\prime\prime}\) and otherwise taking the value of 0, as posed by the following constraint:  
\[\sum_{(d,p,r)\in\mathcal{D}PR:\delta_{p}^{\Delta}>\delta^{\Delta^{\prime}}}x_{ d,p,r}\leq v_{d,r} \tag{21}\]  
The former binary variable (\(u_{d,r}\)) determines the number of times that the probabilities of the selected ORDSs surpass the accepted risk (\(\delta^{\prime}\)) of entering regular overtime, while the latter (\(v_{d,r}\)) determines the number of times that the probabilities of the ORDSs surpass the accepted risk (\(\delta^{\Delta^{\prime}}\)) of entering extended overtime. The objective function minimizes the total number of times a selected ORDS results in overtime, but with more weight \(w\gg 1\) on the extended overtime. A further penalty is added for the degree of surpassing the accepted risk limits by minimizing the squared probabilities \(\delta_{p}\) and \(\delta_{p}^{\Delta}\), again with more weight on extended overtime, resulting in the following objective function:  
\[\min\quad\sum_{d\in D_{J}\in R}\big{(}u_{d,r}+wv_{d,r}\big{)} \tag{22}\] \[+\sum_{(d,p,r)\in DPR}\big{(}[\delta_{p}]^{2}+w[\delta_{p}^{\Delta }]^{2}\big{)}x_{d,p,r} \tag{23}\]