|
OptiPy
|
Implements the DE/rand-to-best/1 mutation strategy. More...
#include <RandBest1.h>
Public Member Functions | |
| RandBest1 (double lambda) | |
| Constructs a RandBest1 mutation strategy with specified interpolation. | |
| std::vector< double > | mutate (const std::vector< std::vector< double > > &population, size_t targetIndex, double F, const std::vector< double > &bestVector, MersenneTwister &mt, double lowerBound, double upperBound) override |
| Generates a mutant vector using DE/rand-to-best/1 strategy. | |
| Public Member Functions inherited from Mutation | |
| virtual | ~Mutation ()=default |
| Virtual destructor for safe polymorphic deletion. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Mutation | |
| std::vector< size_t > | getSubset (size_t populationSize, size_t subsetSize, size_t source, MersenneTwister &mt) |
| Selects a random subset of population indices, excluding a source index. | |
Implements the DE/rand-to-best/1 mutation strategy.
Strategy: DE/rand-to-best/1 (Rand-to-Best-1)
A hybrid mutation strategy that continuously interpolates between random exploration (Rand1) and best-directed search (Best1). This provides a principled way to balance exploration and exploitation, offering robustness without sacrificing convergence speed.
Formula:
\[ v_i(t) = x_i(t) + \lambda \cdot (x_{best}(t) - x_i(t)) + F \cdot (x_{r1}(t) - x_{r2}(t)) \]
Where:
Decomposition:
The formula can be viewed as three components:
Algorithm:
Characteristics:
Exploration (λ-dependent):
Exploitation (λ-dependent):
Robustness:
Convergence Speed:
Population Size Requirements:
Parameter Recommendations:
Comparison with Other Strategies:
| Strategy | Base | Differences | λ | Exploration | Convergence | Balance |
|---|---|---|---|---|---|---|
| Rand1 | Rand | 1 | 0 | Very High | Very Slow | Robust |
| Best1 | Best | 1 | 1 | Very Low | Very Fast | Local |
| Rand2 | Rand | 2 | 0 | Extreme | Slow | Robust |
| Best2 | Best | 2 | 1 | Moderate | Moderate | Good |
| RandBest1 | Hybrid | 1 | λ | Variable | Variable | Tunable |
Use Cases:
Avoid When:
Adaptive Usage (jDE-style):
RandBest1 works excellently with parameter adaptation:
This creates a self-tuning approach that balances exploration early and exploitation late in the optimization run.
Mathematical Interpretation:
The interpolation parameter λ can be understood as:
Implementation Details:
The implementation combines three search components:
Complexity:
Time: O(dimension) Space: O(dimension) for the mutant vector
Example Usage:
Typical Performance Profile (with λ=0.8):
Historical Context:
DE/rand-to-best/1 was introduced to provide a principled middle ground between exploration-focused and exploitation-focused strategies. It's been widely adopted in adaptive DE variants and is considered one of the most practical default strategies for unknown problems.
|
inlineexplicit |
Constructs a RandBest1 mutation strategy with specified interpolation.
Parameter Selection Guidance:
| [in] | lambda | Interpolation parameter in range [0, 1]. 0 = Rand1 (exploration), 1 = Best1 (exploitation). Typical values: 0.5-0.8. Default often 0.8. |
Example:
|
inlineoverridevirtual |
Generates a mutant vector using DE/rand-to-best/1 strategy.
Applies the formula: mutant = current + λ*(best - current) + F*(r1 - r2) where r1 and r2 are randomly selected, and λ controls exploration-exploitation.
| [in] | population | Current population of solutions |
| [in] | targetIndex | Index of the target individual |
| [in] | F | Differential weight; typical range 0.5-1.2 |
| [in] | bestVector | The best solution found so far |
| [in,out] | mt | Random number generator for selection |
| [in] | lowerBound | Lower domain bound |
| [in] | upperBound | Upper domain bound |
Implements Mutation.