# Hybrid Genetic and Spotted Hyena Optimizer for Flow Shop Scheduling Problem
## 4 Methodology  
The Spotted Hyena Optimizer (SHO) is a metaheuristic, bio-inspired optimization algorithm developed by [PERSON] et al. The algorithm is based on the social behaviors of spotted hyenas, which are the largest among the three other hyena species (striped, brown and aardwolf). Spotted hyenas are skillful hunters that typically live and hunt in groups, relying on networks with over 100 members. The SHO algorithm comprises four main steps that emulate the encircling, hunting, attacking and searching behaviors of spotted hyenas (as shown in Figure 1[10]).  
* Encircling prey:  
The best solution is considered the target prey, and other search agents update their positions based on the obtained best solution. The mathematical model for this behavior is given by:  
\[Dh=|B\cdot Pp(x)-P(x)|, \tag{6}\]  
\[P(x+1)= Pp(x)-E\cdot Dh\, \tag{7}\]
* Hunting: The hunting strategy of the SHO is defined as follows:  
\[Dh=|B\cdot Ph-Pk|, \tag{8}\]  
\[Pk=Ph-E\cdot Dh\, \tag{9}\]  
Figure 1: Spotted Hyena Hunting Behavior [10].  
\[Ch=Pk+Pk+1+\ldots+Pk+N\, \tag{10}\]
* Attacking prey: The mathematical formulation for attacking prey is given by: \[P(x+1)=\frac{ch}{N}\,\] (11)
* Searching for prey: The search for a suitable solution involves evaluating the E and B vectors. The SHO algorithm can solve various high-dimensional problems with low computational efforts and avoid local optimum issues.  
In this study, we will focus on using the encircling behavior to solve the flow shop scheduling problem, and the pseudo-code of the SHO algorithm is provided in Algorithm 1.  
```
1:procedureSHO
2:Input: Spotted hyenas population \(Pi\) (\(i\) = 1, 2,..., \(n\))
3:Output: The optimal search agent
4: Initialize parameters \(h\), \(B\), \(E\), and \(N\)
5: Evaluate the fitness of each search agent
6:\(Ph\leftarrow\) Identify the best search agent
7:\(Ch\leftarrow\) Form a group or cluster of all distant optimal solutions
8:while\(x<MaxIteration\)do
9:for each search agent do
10: Update the current agent's position using Equation (10)
11:endfor
12: Update \(h\), \(B\), \(E\), and \(N\)
13: Ensure search agents stay within the given search space and adjust if necessary
14: Compute the fitness of each search agent
15: Update \(Ph\) if a better solution is found compared to the previous optimal solution
16: Modify group \(Ch\) based on \(Ph\)
17:\(x\gets x+1\)
18:endwhile
19:return \(Ph\)
20:endprocedure
```  
**Algorithm 1** Spotted Hyena Optimizer (SHO)  
Alterations to mathematical operators for flow shop problems:  
The mathematical operators are redefined to accommodate the flow shop problem as follows:  
* \(Dh=|B\cdot P\_\text{prey}\left(x\right)-P(x)|\): The subtraction operation between two rat positions is adapted to a list of swaps to be performed on a job sequence \(P(t)\) to obtain the best sequence list \(\text{Pbest}(t)\).
* \(E\cdot Dlt\): This operation, involving a real number between [0, 1] and a list of swaps, is redefined to manipulate and decrease the number of swaps generated by the previous equation.
* \(P\_\text{prey}\left(x\right)-E\cdot Dlt\): This operation determines the final number of potential swaps to be applied to a job sequence.
* An illustrative example of these modifications is provided below:
* \(P\_\text{prey}\left(x\right)\):
* \(P(x)\):
* \(Dh=|P\_\text{prey}\left(x\right)-P(x)|\): List of swaps to be performed on a sequence of jobs \(P(x)\) to obtain the first sequence list
* \(P\_\text{prey}\left(x\right)=[\) [[5,J1],[J3,J2]]
* \(E=0.5\)