## 5 Resolution Methods
### Resolution of the Model Using HGS
#### 5.1.1 Mathematical Foundation of Hunger Games Search (HGS)  
The hunger games search algorithm (HGSA) has been designed to balance both exploitation and exploration mechanisms to effectively navigate the search space and identify optimal solutions (see the Algorithm 1). The following formulas are suggested to express the behaviors of this approach mathematically; they also mimic animal behavior when foraging for food (see Equation (1)):  
\[\vec{X}_{1}(t+1)= \begin{cases}\vec{X}(t)\cdot(1+\text{randn}(1)),&r_{1}<l\\ \vec{W}_{1}\cdot\vec{X}_{b}+R\cdot\vec{W}_{2}\cdot\left[\vec{X}_{b}-\vec{X}(t) \right],&r_{1}>l\text{ and }r_{2}>E\\ \vec{W}_{1}\cdot\vec{X}_{b}-R\cdot\vec{W}_{2}\cdot\left[\vec{X}_{b}-\vec{X}(t) \right],&r_{1}>l\text{ and }r_{2}<E\end{cases}  \tag{1}\]  
where:  
* \(\vec{R}\) represents the range of \([-a,a]\) for the search space;
* \(r_{1}\) and \(r_{2}\) represent random numbers uniformly distributed within the range \([0,1]\);
* \(\text{randn}(1)\) represents a random number drawn from a normal distribution;
* \(t\) indicates the current iteration of the algorithm;
* \(\vec{W}_{1}\) and \(\vec{W}_{2}\) represent the hunger weights used in the algorithm;
* \(\vec{X}_{b}\) represents the location information of a random individual among all optimal individuals found so far;
* \(\vec{X}(t)\) represents the location of each individual at iteration \(t\). The value of \(l\) (related to the algorithm's parameters) has been discussed in the parameter setting experiment. ```
Initialize  the parameters \(N,T,l,D,S_{\text{Hungry}}\). Initialize the positions of Individuals \(X_{i}\)\((i=1,2,\dots,N)\). while(\(t\leq T\))do  Calculate the fitness of all Individuals. Update \(BF,WF,X_{b},BI\). Calculate the \(\text{hungry}(i)\) for each individual \(i\) as: \[\text{hungry}(i)= \begin{cases}0,&\text{if AllFitness}(i)==BF\\ \text{hungry}(i)+H,&\text{if AllFitness}(i)\
eq BF\end{cases} \]  Calculate the \(W_{1}(i)\) for each individual \(i\) as: \[W_{1}(i)= \begin{cases}\text{hungry}(i)\cdot\frac{N}{S_{\text{Hungry}}}\cdot r_{4},&\text{if }r_{3}<l\\ 1,&\text{if }r_{3}\geq l\end{cases} \]  Calculate the \(W_{2}(i)\) for each individual \(i\) as: \[W_{2}(i)=(1-\exp(-|\text{hungry}(i)-S_{\text{Hungry}}|))\cdot r_{5}\cdot 2\] for each Individual \(i\)do  Calculate \(E\). Update \(R\). Update positions. endfor \(t=t+1\) endwhile  Return \(BF\), \(X_{b}\)
```  
**Algorithm 1** Pseudo-code 1 of Hunger Games Search (HGS)  
The formula for \(E\) is as follows (see Equation (2)):\[E=\text{sech}(|F(i)-BF|) \tag{2}\]  
where:  
* \(i\in\{1,2,\dots,n\}\)
* \(F(i)\) represents the fitness value of each individual;
* \(BF\) represents the best fitness obtained in the current iteration process;
* \(\text{sech represents a hyperbolic function }\left(\text{sech}(x)=\frac{2}{e^{x}+e^{-x}}\right)\). The formula for \(\vec{R}\) is as follows (see Equation (3)):  
\[\vec{R}=2\times a\times\text{rand}-a \tag{3}\]  
where:  
* rand represents a random number in the range \([0,1]\);
* Max_iter represents the maximum number of iterations. The characteristics of individuals in the search for food can be simulated mathematically. The formula for \(\vec{W}_{1}\) is represented as follows:  
\[\vec{W}_{1}(i)= \begin{cases}\text{hungry}(i)\cdot\frac{N}{S_{\text{hungry}}} \cdot r_{4},&r_{3}<l\\ 1,&r_{3}>l\end{cases}  \tag{4}\]  
The formula for \(\vec{W}_{2}\) is represented as follows::  
\[\vec{W}_{2}(i)=\left(1-\exp\left(-|\text{hungry}(i)-S_{\text{Hungry}}|\right) \right)\cdot r_{5}\cdot 2 \tag{5}\]  
where:  
* hungry represents the hunger of each individual;
* \(N\) represents the number of individuals;
* \(S_{\text{Hungry}}\) represents the sum of the hunger sensations of all individuals, i.e., \(\sum(\text{hungry})\);
* \(r_{3},r_{4}\) and \(r_{5}\) represent random numbers in the range \([0,1]\). The formula for the function \(\text{hungry}(i)\) is represented as follows:  
\[\text{hungry}(i)= \begin{cases}0,&\text{AllFitness}(i)=BF\\ \text{hungry}(i)+H,&\text{AllFitness}(i)\
eq BF\end{cases}