Generates Levy flight random steps for optimization algorithms. Levy flight is characterized by a heavy-tailed power-law distribution and is used to model the movement patterns of marine predators, allowing for occasional long jumps that help escape local optima.
levy(n, m, beta)Number of rows (typically the number of search agents).
Number of columns (typically the number of dimensions).
Power law exponent controlling the tail heaviness of the
distribution. Must satisfy 1 < beta < 2. Lower values produce
heavier tails (more frequent long jumps). The value 1.5 is commonly used.
A numeric matrix of dimension n x m containing Levy flight
step values. Each element represents a random step drawn from the Levy
distribution.
The Levy flight step is computed using Mantegna's algorithm:
$$L = u / |v|^{1/\beta}$$
where \(u \sim N(0, \sigma_u^2)\) and \(v \sim N(0, 1)\), with:
$$\sigma_u = \left( \frac{\Gamma(1+\beta) \cdot \sin(\pi \beta / 2)} {\Gamma((1+\beta)/2) \cdot \beta \cdot 2^{(\beta-1)/2}} \right)^{1/\beta}$$
Levy flights are used in MPA during Phase 2 (for half the population) and Phase 3 (for all agents) to balance exploration and exploitation.
Mantegna, R. N. (1994). Fast, accurate algorithm for numerical simulation of Levy stable stochastic processes. Physical Review E, 49(5), 4677.
Yang, X. S., & Deb, S. (2013). Multiobjective cuckoo search for design optimization. Computers & Operations Research, 40(6), 1616-1624.
[mpa()] for the main algorithm that uses Levy flights.