# HyperDE: An Adaptive Hyper-Heuristic for Global Optimization
## 5 HyperDe Algorithm  
As stated in Section 1.1, the goal is to find the minimum value of a function \(f(x)\), with \(x\in\mathbb{R}^{n}\). The proposed hyper-heuristic, HyperDE, works like many other global optimization algorithms, by generating tentative solutions. The modality in which the solution space is explored gives the specific of a method. In the two-layer structure mentioned in Section 1.3, HyperDE adopts as a high-level algorithm a form of steady-state Genetic Algorithm (GA). The (hyper-)population in this context is composed of various instances of DE, each with different hyper-parameters. Therefore, HyperDE orchestrates the collaboration and execution in parallel of the DE agents, manipulating the hyper-parameters and generated solutions. The proposed method is an adaptive hyper-heuristic, where the genetic algorithm plays the role of an online learning mechanism, adjusting the hyper-parameters of the agent ensemble and adapting to the state of the problem while exploring the solution space. Thus, there is a learning process based on the performance shown in the past of each particular DE agent, exploring also the space of heuristics by the means of the standard GA operators: selection, crossover and mutation. Ergo, the optimization is accomplished on two levels, simultaneously, searching primarily the space of possible DE instances, but also the actual space of solutions to the given problem, as depicted in Figure 1.  
The algorithm manages the hyper-population of DE agents, named \(HP\), which is initialized with random values of the hyper-parameters F, CR, S. It also maintains a solution population \(SP\), also initialized at random. In order to evaluate the hyper-population \(HP\), the DE agents are executed in parallel for a number of n_window iterations. Each agent is responsible for the generation of n_quota solutions; in other words, each DE agent has n_quota individuals. Therefore, the entire hyper-population explores the problem space in a parallel manner, obtaining at the end a set of solutions. The history set of solutions for agent \(g\) is denoted \(H_{g}\). The history \(H_{g}\) consists of n_window sets of solutions, each corresponding to an iteration executed by agent \(g\). \(H_{g,i}\) represents the set of solutions obtained by agent \(g\) at the end of iteration \(i\), and has the size \(|H_{g,i}|=\) n_quota. In order to assign a fitness \(HF\) to each agent of \(HP\), the obtained histories of solutions are utilized in the procedure AgentsFitness (Algorithm 3). For each window iteration  
Figure 1: Structure of the proposed adaptive hyper-heuristic approach. \(i\), we compute the union \(O_{i}\) of the agents solutions set \(H_{g,i}\) in that particular iteration. The obtained union \(O_{i}\) is sorted in ascending/descending order, depending on whether the problem to solve is one of minimization or maximization. Afterwards, a count is performed for each agent, counting how many of its solutions are found in the first third of the sorted union set, the count being then divided with \(|O_{i}|/3\) for normalization. After the entire process, the average is computed over the entire window of iterations, thus obtaining the fitness value \(HF_{g}\) for each agent \(g\). ```
procedureAgentsFitness(\(HP\), \(H\), n_window) for each DE agent \(g\) in \(HP\)do \(HF_{g}\gets 0\) endfor for each iteration \(i=1:\)n_window do \(O_{i}\leftarrow\emptyset\) for each DE agent \(g\) in \(HP\)do \(O_{i}\gets O_{i}\cup H_{g,i}\) endfor  Sort in ascending/descending order by fitness the set \(O_{i}\) for each DE agent \(g\) in \(HP\)do \(C_{g,i}\leftarrow\) Number of solutions from \(H_{g,i}\) that are in the first third of set \(O_{i}\) \(HF_{g}\gets HF_{g}+\frac{C_{g,i}}{\text{n\_window}\cdot\frac{|O_{i}|}{3}}\) endfor endfor return\(HF\) endprocedure
```  
**Algorithm 3** Computation of the fitness function for all agents  
The above-described operations are used in Algorithm 4, which updates the solution population \(SP\) and computes the fitness \(HF\) by calling Algorithm 3.