feat(algorithms): add Umda Univariate Marginal Distribution EDA for binary problems
Mühlenbein 1997 UMDA: simplest Estimation-of-Distribution Algorithm for `Vec<bool>` problems. Each generation: - Evaluate the current population - Select the top μ members by fitness - Estimate per-bit marginal probability p_i = (count of 1s at bit i in the μ-best) / μ - Sample population_size new individuals from the resulting product-of- Bernoullis distribution Single-objective only. Bit-wise probabilities are clamped to `[1 / (2 · μ), 1 - 1 / (2 · μ)]` to keep the population from collapsing to a deterministic single string before convergence is meaningful (standard Laplace-style smoothing for UMDA). Tests: solves OneMax (maximize Σ bits) on a 20-bit instance, deterministic reruns, panic on multi-objective.
This commit is contained in:
@@ -197,7 +197,7 @@ fn build_tour(
|
||||
for _ in 1..n {
|
||||
let current = *tour.last().unwrap();
|
||||
// Build a probability vector over the unvisited candidates.
|
||||
let mut probs: Vec<(usize, f64)> = (0..n)
|
||||
let probs: Vec<(usize, f64)> = (0..n)
|
||||
.filter(|&j| !visited[j])
|
||||
.map(|j| {
|
||||
let p = pheromone[current][j].max(0.0).powf(alpha) * eta[current][j].powf(beta);
|
||||
|
||||
Reference in New Issue
Block a user