Collection of benchmark test functions for evaluating optimization algorithms. These functions are commonly used in the literature to test the performance of metaheuristic optimization algorithms.
The following test functions are implemented:
Unimodal Functions:
F01 - Sphere function: Simple quadratic function with a single minimum at the origin. F01
F02 - Sum of absolute values and products: Combines sum and product of absolute values. F02
F03 - Sum of squared terms: Sum of squared cumulative sums. F03
F04 - Maximum absolute value: Returns the maximum absolute value in the vector. F04
F05 - Rosenbrock function: Classic test function with a banana-shaped valley. F05
F06 - Shifted sphere function: Sphere function shifted to (-0.5, -0.5, ...). F06
F07 - Quartic function with noise: Quartic terms with added random noise. F07
Multimodal Functions:
F08 - Schwefel function: Multimodal function with many local minima. F08
F09 - Rastrigin function: Many local minima arranged in a regular pattern. F09
F10 - Ackley function: Global minimum at origin with many local minima. F10
F11 - Griewank function: Many local minima regularly distributed. F11
F12 - Penalized function 1: Complex landscape with penalty terms. F12
F13 - Penalized function 2: Different penalty terms creating complex landscape. F13
F14 - Shekel's Foxholes: 25 minima of different depths. F14
F15 - Kowalik function: Multimodal function for testing optimization. F15
F16 - Six-Hump Camel Back: Six local minima, two global. F16
F17 - Branin function: Commonly used for testing optimization algorithms. F17
F18 - Goldstein-Price function: Four local minima. F18
F19 - Hartman 3D function: 3 dimensions with multiple local minima. F19
F20 - Hartman 6D function: 6 dimensions with multiple local minima. F20
F21 - Shekel 5 function: Based on Shekel's family with 5 terms. F21
F22 - Shekel 7 function: Based on Shekel's family with 7 terms. F22
F23 - Shekel 10 function: Based on Shekel's family with 10 terms. F23
Faramarzi, A., Heidarinejad, M., Mirjalili, S., & Gandomi, A. H. (2020). Marine Predators Algorithm: A Nature-inspired Metaheuristic. Expert Systems with Applications, 113377. DOI: 10.1016/j.eswa.2020.113377
F01 through F23 for individual function documentation.
get_function_details to retrieve function details programmatically.
# Get details for a specific function
details <- get_function_details("F01")
# Use a test function directly
F01(c(0, 0, 0)) # Returns 0 (global minimum)
#> [1] 0
# List all available test functions
available_functions <- c("F01", "F02", "F03", "F04", "F05", "F06", "F07", "F08", "F09", "F10",
"F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20",
"F21", "F22", "F23")