Implements exponential (continuous block) crossover strategy.
Strategy: Exponential Crossover
Inherits parameters from the mutant in contiguous blocks rather than independent selections. Creates a structured, sequential inheritance pattern that can be beneficial for problems with spatial correlations.
Algorithm:
- Select one random starting index jrand
- Starting from jrand, inherit parameters sequentially
- Continue inheriting while: random() < CR AND haven't inherited all dimensions
- Wrap around dimensions using modulo (circular)
- Return via in-place modification of target
Pseudocode:
jrand = random_index(0, dimension-1)
left = 0
do:
idx = (jrand + left) % dimension
target[idx] = mutant[idx]
left++
while (random() < CR AND left < dimension)
Characteristics:
Block Inheritance: Parameters inherited sequentially
- Creates contiguous blocks of inherited parameters
- Preserves spatial structure from mutant
- Can exploit ordered problem structure
Circular Wrapping: Wraps around at dimension boundaries
- Uses modulo arithmetic for wraparound
- Treats problem as circular/periodic
- Fair treatment of all dimensions
Continuous Probability: CR controls block length distribution
- Block length follows geometric distribution with parameter CR
- Expected block length ≈ 1 / (1 - CR)
- Higher CR → longer blocks → fewer transitions
- Lower CR → shorter blocks → more transitions
Exploration: Moderate, depends on CR and block structure
- CR = 0.3: Very short blocks, many transitions
- CR = 0.5: Medium blocks, balanced structure
- CR = 0.9: Long blocks, few transitions
Block Length Distribution:
The probability of inheriting exactly k parameters follows: P(k) = (1 - CR)^(k-1) × CR
Examples:
- CR = 0.5: P(block of 1) = 0.5, P(block of 2) = 0.25, P(block of 3) = 0.125, ...
- CR = 0.8: P(block of 1) = 0.2, P(block of 2) = 0.16, P(block of 3) = 0.128, ...
Advantages:
- Structure Preservation: Maintains spatial correlations
- Problem-Specific: Good for ordered/sequential parameters
- Linked Inheritance: Related parameters inherited together
- Lower Disruption: Fewer independent changes
- Variable Block Sizes: Geometric distribution provides variation
Disadvantages:
- Bias: Block starting position creates preference
- Less General: May perform worse on unstructured problems
- Order-Dependent: Sensitive to parameter ordering
- Complex Behavior: Block structure less intuitive than binomial
- Slower Selection: Loop continues until CR condition fails
When to Use:
- Problems with spatial/sequential parameter structure
- Linked parameters that should co-evolve
- Gene grouping problems (epistasis)
- Problems where parameter order is meaningful
- When binomial crossover causes disruptive mixing
- Neural network weight optimization
- Sensor/coordinate problems (x, y, z groupings)
- Avoiding mutation-like disruption from independent selection
Avoid When:
- Problem is unstructured (use binomial)
- Parameters are independent (use binomial)
- Parameter ordering is arbitrary
- Need maximum generality (use binomial)
- Problem structure is unknown
Parameter Recommendations:
Crossover Rate (CR):
- CR = 0.1-0.3: Very short blocks, high disruption
- CR = 0.5-0.7: Medium blocks, balanced structure
- CR = 0.8-0.95: Long blocks, less disruption
- Adaptive CR: Can adapt block length over optimization
- Problem-Dependent: Choose based on parameter correlations
Synergy with Mutations:
- With Rand1: Use medium-high CR (0.7-0.9) for structured exploration
- With Best1: Use lower CR (0.3-0.7) to maintain structure around best
- With RandBest1: Use medium CR (0.6-0.85) for balanced structure
- With Rand2/Best2: Use lower CR due to high mutation variation
Implementation Details:
The implementation uses:
- mt.genrand_int32() % target.size() for random starting index
- (jrand + left) % target.size() for circular indexing
- mt.genrand_real1() < cr for continuation probability
- In-place modification of target
- Do-while loop for block inheritance
Complexity:
Time: O(inherited_count) where inherited_count is variable (0 to dimension) Expected: O(CR × dimension) Space: O(1) - modifies target in-place
Example Usage:
auto crossover = std::make_unique<ExpCrossover>();
std::vector<double> target = population[5];
std::vector<double> mutant = mutation->mutate(...);
crossover->crossover(target, mutant, 0.8, rng);
void crossover(std::vector< double > &target, const std::vector< double > &mutant, double cr, MersenneTwister &mt) override
Performs exponential crossover between target and mutant vectors.
Definition ExpCrossover.h:229
Example Inheritance Patterns:
With 8-dimensional problem, CR=0.7, jrand=2:
- Iteration 1: idx=2, inherit (random < 0.7), left=1
- Iteration 2: idx=3, inherit (random < 0.7), left=2
- Iteration 3: idx=4, inherit (random < 0.7), left=3
- Iteration 4: idx=5, DON'T inherit (random ≥ 0.7), stop Result: target[2:5] from mutant, rest retained
Typical Performance Profile:
- Rosenbrock function: Good (structure-aware)
- Rastrigin function: Moderate (less general)
- Sphere function: Good (simple landscape)
- Schwefel function: Moderate (deceptive)
- Ordered Parameter Problem: Excellent (best choice)
- General CEC Benchmark: Moderate (less robust than binomial)
Historical Context:
Exponential crossover was introduced in the original DE paper by Storn and Price (1997) as an alternative to binomial crossover. While less commonly used than binomial, it provides value for problems with inherent parameter structure.
Comparison with Binomial Crossover:
| Aspect | Binomial | Exponential |
| Selection | Independent each parameter | Contiguous block |
| Spatial Bias | None | Weak (sequential) |
| Exploration | Uniform | Structured |
| Block Length | Poisson-like (each parameter) | Geometric (contiguous) |
| Implementation | O(dimension) loop | O(inherited count) loop |
| Default | Yes (most common) | No (specialized) |
| Robustness | Excellent (general) | Good (specialized) |
| Best For | General purpose | Ordered/structured problems |
Tuning Guide:
If standard binomial isn't working well:
- Check if parameters have spatial/sequential meaning
- If yes, try exponential with CR = 0.5-0.8
- Adjust CR based on expected block size
- Monitor if blocks help or hurt fitness progress
- Consider adaptive CR that evolves block sizes
- See also
- Crossover for interface documentation
-
BinCrossover for independent/uniform alternative