## 2 Materials and Methods
### Robust Optimization with a Genetic Algorithm Optimizer  
In this study, given an n-dimensional decision variable vector of dwell times \(\mathrm{x}=\{\mathrm{x}_{1},\ldots,\mathrm{x}_{n}\}\) in the solution space \(\mathcal{X}\), the decision variable vector \(\mathrm{x}\) was called a chromosome. Normally, the first generation of a chromosome is created randomly and called the initial population [51; 52; 53]. Randomly generated initial values were used when solving the problem in this work. To find a vector \(\mathrm{x}^{*}\) that maximized or minimized a given set of k objectives functions \(\mathrm{F}(\mathrm{x}^{*})=\{\mathrm{f}_{1}(\mathrm{x}^{*}),\ldots,\mathrm{f} _{k}(\mathrm{x}^{*})\}\), we generated fitness functions to minimize the given objective functions and constraints for our purpose.  
\[\begin{array}{c}\underset{x\in\mathcal{X}}{\text{minimize}}\;\frac{1}{N_{ TARGET}}\sum\limits_{i\in\mathcal{V}}(D_{i}-D_{TARGET})^{2}+\;\frac{1}{N_{OAR}}\;\sum\limits_{i\in \mathcal{V}}H(D_{i}-D_{OAR})(D_{i}-D_{OAR})^{2}\;+\ldots\\ b\times\textit{median}\Big{\{}\Big{|}DVH_{\mathrm{s}}-\widetilde{\lambda} \Big{|}\Big{\}}\end{array} \tag{4}\]  
where \((1/N_{TARGET})\sum_{i\in\mathcal{V}}(D_{i}-D_{TARGET})^{2}\) and \((1/N_{OAR})\sum_{i\in\mathcal{V}}H(D_{i}-D_{OAR})(D_{i}-D_{OAR})^{2}\) were objective functions for all contoured organs and \(\mathcal{V}\) was the set of all voxels inside each contoured structure. The \(D_{TARGET}\) and \(D_{OAR}\) were the prescription dose of the target volume and the dose constraints of OARs, and \(b\times\textit{median}\Big{\{}\Big{|}DVH_{\mathrm{s}}-\widetilde{\lambda} \Big{|}\Big{\}}\) was a robustness function of the bandwidth at the critical dose-volume points on the DVH of the target volume and OAR under uncertainty. The constant \(b\) was a scalar factor linked to the assumption of normality of the data and the disregard of abnormality induced by out liers. Then, we needed to set \(b=1.4826\), as previously mentioned above. The following constraints of the problem were given.  
\[\begin{array}{c}\textit{subject to }D_{i}=\sum\limits_{j\in\mathcal{T}}d_{ij}x_{j} \hskip 28.452756 pt\forall_{s}\in\mathcal{S}(x)\\ x_{j}\geq 0\\ \mathrm{H}(D_{i}-D_{OAR})=\begin{cases}1,&D_{i}>D_{OAR}\\ 0,&D_{i}\leq D_{OAR}\end{cases}\\ DVH_{TARGET}(x)\geq D_{TARGET}\\ DVH_{OAR}(x)\leq D_{OAR}\\ \widetilde{\lambda}=\textit{median}\{DVH_{S}(D_{i})\}\ \forall_{s}\in\mathcal{S}(x)\end{array} \tag{5}\]  
where \(\mathrm{H}(D_{i}-D_{OAR})\) was the step function defined as \(\mathrm{H}(D_{i}-D_{OAR})\) = 1 if \(D_{i}>D_{OAR}\); otherwise, \(\mathrm{H}(D_{i}-D_{OAR})\) = 0 if \(D_{i}\leq D_{OAR}\). \(\mathcal{T}\) was the set of all dwell positions. The DVH of the target volume and OAR were controlled by each organ's prescription dose in accordance with the EMBRACE protocol guidelines as dose constraints, respectively.  
The overall objective functions were optimized by the genetic algorithm in a multi-criteria optimization setting. This robust optimization was performed by calculating the delivered dose to the target and OAR in all worst-case scenarios and searching for the best alternative (a given fitness function) through chromosome evolution in each generation (Figure 2). We performed the multicriteria robust optimization problem with dose delivery uncertainty to maximize the fraction of the target volume receiving at least the prescribed dose and to minimize the maximum dose to the OAR [48].