How it Works
DE maintains a population of NP candidate vectors. Each generation, for each target vector x_i, three random vectors x_r1, x_r2, x_r3 are chosen. The mutant v = x_r1 + F·(x_r2 - x_r3). Binomial crossover creates trial u: each dimension taken from v with probability CR or from x_i otherwise. If f(u) <= f(x_i), u replaces x_i (greedy selection).
The contour plot shows the fitness landscape (darker=lower). Blue dots are the population; the red star marks the best solution. The convergence plot (bottom) shows best fitness per generation on a log scale.
Frequently Asked Questions
What is Differential Evolution (DE)?
Differential Evolution is a population-based stochastic optimization algorithm by Storn and Price (1997). It evolves candidate solutions using mutation (vector differences), crossover, and selection without requiring gradient information.
How does DE/rand/1/bin mutation work?
Three random vectors x_r1, x_r2, x_r3 are selected from the population. The mutant vector is v = x_r1 + F·(x_r2 - x_r3), where F ∈ [0,2] is the mutation scale factor controlling search step size.
What is the crossover operation in DE?
In binomial (bin) crossover, each dimension of the trial vector u is taken from the mutant v with probability CR, or from the target x otherwise. At least one dimension always comes from the mutant.
What are the F and CR parameters in DE?
F (mutation factor) controls mutation step size, typically F ∈ [0.4, 1.0]. CR (crossover rate) controls the fraction of parameters from the mutant, typically CR ∈ [0.1, 0.9]. Higher CR = more exploration.
What is the Rosenbrock function?
f(x,y) = (1-x)² + 100(y-x²)² has a narrow curved valley. Its global minimum is at (1,1) with f=0. The valley is easy to find but the minimum is hard to locate precisely.
What is the Rastrigin function?
The Rastrigin function is highly multimodal: f(x,y) = 20 + x²-10cos(2πx) + y²-10cos(2πy). Global minimum is at (0,0) with f=0. Tests global optimization ability.
What is the Ackley function?
The Ackley function has a nearly flat outer region with a deep global minimum at the origin. It challenges algorithms to avoid premature convergence to local optima in the flat region.
How does DE compare to other evolutionary algorithms?
DE typically outperforms genetic algorithms and particle swarm on continuous benchmarks. It is simpler than CMA-ES and scales well to ~100 dimensions. CMA-ES is often better for very high-dimensional smooth problems.
What is self-adaptive DE (SaDE)?
SaDE automatically adjusts F and CR during optimization based on their success rates, eliminating the need for manual tuning. Successful parameter values are recorded and used to generate new parameter values.
When should I use Differential Evolution?
Use DE for black-box, non-differentiable, multimodal, or noisy optimization with continuous variables, typically 5–50 dimensions. Good for parameter fitting and engineering design. Gradient methods are better when derivatives are available.