# Automated Generation of Hybrid Metaheuristics Using Learning-to-Rank
## 3 Preliminaries
### Metaheuristic Algorithms  
#### 3.2.1 Whale Optimization Algorithm  
The Whale Optimization Algorithm [26] is modeled after the hunting strategies of humpback whales. During the exploration, the agents perform a global search to locate promising solutions, while the exploitation stage focuses on localized refinement. The agents exhibit three core hunting strategies: encircling prey, bubble-net attacking, and random search. The mathematical models for each behavior are described in detail below.  
(1) Encircling Prey  
The WOA assumes that the prey nearest to the optimum serves as the best candidate solution. After identifying the leading agent, the rest adjust their positions to approach this optimal candidate. The equation below is used to mathematically explain the encircling mechanism in the WOA.  
\[\vec{X}(t+1)=\vec{X}^{*}(t)-\vec{A}\cdot\vec{Dis} \tag{2}\]where \(\vec{Dias}=\left|\vec{C}\cdot\vec{X}^{*}(t)-\vec{X}(t)\right|\) represents the distance between the current individual and the best individual identified so far. Here, \(\vec{X}(t)\) and \(\vec{X}^{*}(t)\) indicate the position vectors of the current individual and the optimal solution at iteration \(t\), respectively. Note that in these equations, \"\(||\)\" denotes the absolute value applied element-wise to vectors. \"\(\cdot\)\" represents element-by-element multiplication [26]. \(\vec{A}\) and \(\vec{C}\) are coefficient vectors, computed using the following equations:  
\[\vec{A}=2\vec{a}\cdot\vec{r}-\vec{a},\quad\vec{C}=2\cdot\vec{r} \tag{3}\]  
where \(\vec{a}\) is linearly decreased from 2 to 0 over the course of iterations. \(\vec{r}\) is a random vector in the range \([0,1]\).  
The switching mechanism between exploration and exploitation in the WOA is controlled by the \(\vec{A}\), enabling the algorithm to balance global and local search effectively. When the absolute value of every component of \(\vec{A}\) is less than 1 (\(|\vec{A}|<1\)), i.e., \(|A_{i}|<1\) for all \(i=1,\ldots,D\), the agent moves toward the best-known solution (exploitation). Conversely, if any component satisfies \(|A_{i}|\geq 1\), the agent performs exploration by moving toward a randomly selected individual.  
(2) Bubble-Net Attacking  
In the exploitation phase (when \(|\vec{A}|<1\)), bubble-net attacking utilizes two strategies: shrinking encircling and spiral updating. The spiral updating mechanism is expressed using a formula like this:  
\[\vec{X}(t+1)=\vec{Dias}^{\prime}\cdot e^{bl}\cdot\cos(2\pi l)+\vec{X}^{*}(t) \tag{4}\]  
where \(\vec{Dias}^{\prime}=\left|\vec{X}^{*}(t)-\vec{X}(t)\right|\) represents the distance between the current whale and the best whale found so far, \(b\) is a constant, and \(l\) is a random number in the range \([-1,1]\). During the prey hunting phase, the shrinking encircling mechanism and the spiral updating position are performed simultaneously. The equation is as follows:  
\[\vec{X}(t+1)=\begin{cases}\vec{X}^{*}(t)-\vec{A}\cdot\vec{Dias},&\text{if $p<0.5$}\\ \vec{Dias}^{\prime}\cdot e^{bl}\cdot\cos(2\pi l)+\vec{X}^{*}(t),&\text{if $p \geq 0.5$}\end{cases} \tag{5}\]  
where \(p\) is a random number in the range \([0,1]\). These two mechanisms are selected with equal probability, and the value of \(p\) determines which mechanism is applied in each iteration.  
(3) Random Search  
In the WOA, a certain degree of exploration is necessary to enhance global search capability. When \(|\vec{A}|\geq 1\), the WOA randomly selects a whale from the population to update the position, as described by the following equation:  
\[\vec{X}(t+1)=\vec{X}_{\text{rand}}-\vec{A}\cdot\vec{Dias} \tag{6}\]  
where \(\vec{Dias}=\left|\vec{C}\cdot\vec{X}_{\text{rand}}-\vec{X}(t)\right|\) is the distance vector, and \(\vec{X}_{\text{rand}}\) represents the position vector of a whale randomly selected from the current population. As in the encircling mechanism, both the absolute value and multiplication operators are applied element-wise to vectors.