## 4 Proposed Solution
### Specific Heuristic Algorithm
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multicolumn{6}{c}{**Surgeries Data**} & \multicolumn{6}{c}{**Waiting List**} \\ \hline \(\mathcal{S}\) & **Types** & **Average Duration** & & & & & & \\ \hline \(\overline{S_{1}}\) & \(s_{1}\) & 90 & **Patient** & \(w_{1}\) & \(w_{2}\) & \(w_{3}\) & \(w_{4}\) & \(w_{5}\) & \(w_{6}\) \\ \cline{2-9}  & \(s_{2}\) & 110 & **Surgery type** & \(s_{1}\) & \(s_{2}\) & \(s_{1}\) & \(s_{3}\) & \(s_{1}\) & \(s_{4}\) \\ \hline \(\overline{S_{2}}\) & \(s_{3}\) & 125 & & & & & & \\ \hline \(\overline{S_{3}}\) & \(s_{4}\) & 135 & & & & & & & \\ \hline \end{tabular}
\end{table} 
Table 1: Surgery data and waiting list of patients used for explaining part 2 of the SHA. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Possible Scheduling Types** & **Real Scheduling** & \(\boldsymbol{r\) **(\%)** & \(\boldsymbol{Ap}\) & **H (Step 4)** & **H (Step 5)** \\ \hline \multirow{4}{*}{\(\overline{S_{1}}\)\(\overline{S_{1}}\)\(\overline{S_{2}}\)} & \(w_{1}w_{2}w_{4}\) & 77.38 & 2.33 & **0** & 10.71 \\ \cline{2-9}  & \(w_{1}w_{3}w_{4}\) & 72.61 & 2.66 & 5.62 & - \\ \cline{2-9}  & \(w_{2}w_{3}w_{4}\) & 77.38 & 3 & 1.74 & - \\ \hline \multirow{4}{*}{\(\overline{S_{1}}\)\(\overline{S_{2}}\)\(\overline{S_{3}}\)} & \(w_{1}w_{4}w_{6}\) & 83.33 & 3.66 & 4.76 & - \\ \cline{2-9}  & \(w_{2}w_{4}w_{6}\) & 88.09 & 4 & **0.88** & **4.34** \\ \cline{1-1} \cline{2-9}  & \(w_{3}w_{4}w_{6}\) & 83.33 & 4.33 & 6.50 & - \\ \cline{1-1} \cline{2-9}  & \(w_{4}w_{5}w_{6}\) & 83.33 & 5 & 8.24 & - \\ \hline \end{tabular}
\end{table} 
Table 2: Motivation example for explaining part 2 of the SHA. _Step 4: Evaluate the real scheduling and select the best one for each scheduling type._ First, the real scheduling not fulfilling the chance constraint (3) is removed and the check is similar to the one in Step 2. For the remaining real scheduling, the expected occupation rate \(r\) is computed by summing the average duration of all surgeries in the real scheduling divided by the time block duration \(l(b_{i})\) (multiplied by 100 if percentage). Furthermore, the average preference order \(Ap\) is computed by summing the preference order of all patients in the real scheduling divided by the number of patients in the real scheduling. The real scheduling with the minimum value of the following fitness function is chosen:  
\[H=(Ap-Min_{Ap})\cdot\beta+(Max_{r}-r), \tag{6}\]  
where \(Min_{Ap}\) is the minimum average preference order of all real scheduling; \(Max_{r}\) is the maximum occupation rate \(r\) of all real scheduling; and \(\beta\) is a balancing parameter between the two terms (one for preference order and one for occupation rate). For example, in Table 2, the computations of the occupation rates are given, preference order, and fitness function (fifth column) for the set of real scheduling considered before. In this example, a value of \(\beta=2.6\) is used and the time block duration are assumed to be \(l(b_{i})=420\) (min), corresponding to 7 h. In this step, the real scheduling \(w_{1}w_{2}w_{4}\) is chosen for the possible scheduling type \(\overline{S_{1}S_{1}S_{2}}\) and \(w_{2}w_{4}w_{6}\) is chosen for \(\overline{S_{1}S_{2}S_{3}}\). _Step 5: Evaluate the best real scheduling chosen in Step 4 (one for each scheduling type) and select the best one for the current time block \(b_{i}\)._ From the set of selected real scheduling in the previous step, the one with minimum value of the fitness function (6) is chosen. Notice that the value of the fitness function of a real scheduling in this step is, in general, different by the one computed in step 4. In particular, \(Min_{Ap}\) and \(Max_{r}\) have different values since are computed based only on the best real scheduling computed in step 4. The sixth column of Table 2 is showing the computation of the fitness function on the two selected real scheduling instances on the previous step. Hence, in this step, \(Min_{Ap}=2.33\) corresponding to \(w_{1}w_{2}w_{4}\) while \(Max_{r}=88.09\) corresponding to \(w_{2}w_{4}w_{6}\).