HHO: Harris Hawks Optimization

View source: R/HHO_opt.R

HHOR Documentation

Harris Hawks Optimization

Description

An algorithm built by Heidari et al. (2019) that inspired by the movement of Harris Hawks on cooperative hunting behaviour to optimized real-valued objective function in continous search space in a population-based manner.

Usage

HHO(N, Max_iter, lb, ub, dim, fobj)

Arguments

N

An integer indicate population size.

Max_iter

An integer indicate maximum number of iterations.

lb

A numeric vector that show lower bounds of the search space. One value per dimension.

ub

A numeric vector that show upper bounds of the search space. One value per dimension.

dim

An integer show the number of dimension (parameters) of the problem to optimize. It indicate the number of parameters to be optimized.

fobj

An objective function used to be minimized. It is return single numeric value that show evaluation matrix result in every iteration. It used to calculate the best fitness in every iteration.

Details

There are two phase of Harris Hawks hunting, namely exploration and exploitation that will be modelized to find optimization result. The movement used in this algorithms such as: exploration phase; transition between exploitation and exploration phase; and exploitation phase that has 4 different strategies based on E and r (soft besiege, hard besiege, soft besiege with progressive rapid, and hard besiege with progressive rapid).

The algorithm performs until maximum iteration reached or convergence condition when the difference in objective values for ten consecutive times is less than 10^-5.

Value

A list containing:

best_fitness

The best (minimum) fitness value found.

best_position

The parameter vector (position) corresponding to the best fitness.

jml_iter

The number of iterations executed.

param

Matrix of best parameters found across every iterations (dim × iter).

param_list

Vector of best fitness values at each iteration.

Note

The input vectors 'lb' and 'ub' must have the same length as the number of dimensions 'dim'.

This optimization function used inside svrHybrid function.

References

Heidari, A. A., Mirjalili, S., Faris, H., Aljarah, I., Mafarja, M., & Chen, H. (2019). Harris hawks optimization: Algorithm and applications. Future generation computer systems, 97, 849-872. https://doi.org/10.1016/j.future.2019.02.028

Examples

{
sphere_fn <- function(x) sum(x^2) # simple function for objective function

# HHO optimization
set.seed(123)
result <- HHO(N = 20, Max_iter = 50, lb = c(-5,-5,-5), ub = c(5,5,5), dim = 3, fobj = sphere_fn)

# View best fitness and position found
result$best_fitness
result$best_position
}


metaSVR documentation built on Aug. 21, 2025, 5:58 p.m.