Bullfrog Optimization Algorithm(BOA)
Version 1.0.0 (5.57 KB) by
praveen kumar
This program implements BOA a new bio inspired evolutionary algorithm based on bullfrog
Enhanced E-BOA Algorithm Steps
Input:
- N — Population size
- MaxIter — Maximum iterations
- nVar — Number of variables (dimensions)
- VarMin, VarMax — Variable bounds
- fobj — Objective function
- params — Algorithm parameters (elite ratio, mutation probability, use of Levy flights, etc.)
Output:
- BestSol — Best solution found
- BestFit — Best fitness value
- ConvergenceCurve — Fitness progression over iterations
- Stats — Algorithm statistics (diversity, stagnation count, restarts, function evaluations)
Step 1: Initialization
- Initialize population X randomly within bounds [VarMin, VarMax].
- If opposition-based initialization is enabled, initialize half of the population using opposition-based strategy:Xi=VarMin+VarMax−XiX_i = VarMin + VarMax - X_iXi=VarMin+VarMax−Xi
- Evaluate fitness Fitness(i) = fobj(X(i,:)) for all individuals.
- Set PersonalBest(i,:) = X(i,:) and PersonalBestFit(i) = Fitness(i).
- Identify BestSol and BestFit from the initial population.
- Initialize velocity, stagnation counters, and statistics.
Step 2: Main Optimization Loop (Iterations t = 1 to MaxIter)Step 2.1: Adaptive Parameter Update
- Step size:
s=smax−(smax−smin)⋅t/MaxIters = s_{max} - (s_{max} - s_{min}) \cdot t / MaxIters=smax−(smax−smin)⋅t/MaxIter
- Inertia weight for velocity:
w=0.9−0.5⋅t/MaxIterw = 0.9 - 0.5 \cdot t / MaxIterw=0.9−0.5⋅t/MaxIter
- Number of neighbors for social learning: decreases over time.
Step 2.2: Population Diversity Check
- Compute population diversity using pairwise distances.
- If diversity < diversity_threshold and iteration > MaxIter/4, restart part of the population while retaining elite individuals.
Step 2.3: Update Each Individual
For each individual i:
- Elite Solutions Perturbation:
- If i is elite, apply small Gaussian perturbation.
- Enhanced Ambush Hunting:
- Multi-step update toward BestSol:
Xi←Xi+hunt_factor⋅(BestSol−Xi)X_i \leftarrow X_i + hunt\_factor \cdot (BestSol - X_i)Xi←Xi+hunt_factor⋅(BestSol−Xi)
- With probability, apply Levy flight for long jumps.
- Social Learning with Neighbors:
- Select neighbors_idx based on fitness.
- Update position using one of three strategies:
- Direct learning: move toward neighbor
- Personal best learning: move toward neighbor’s personal best
- Hybrid learning: weighted combination
- Predator Avoidance:
- Move away from worst solutions to avoid local traps:
Xi←Xi+avoidance_strength⋅(Xi−Xworst)X_i \leftarrow X_i + avoidance\_strength \cdot (X_i - X_{worst})Xi←Xi+avoidance_strength⋅(Xi−Xworst)
- Velocity-based Update (PSO inspired):Velocity(i,:)=w⋅Velocity(i,:)+c1⋅(PersonalBest−Xi)+c2⋅(BestSol−Xi)Velocity(i,:) = w \cdot Velocity(i,:) + c1 \cdot (PersonalBest - X_i) + c2 \cdot (BestSol - X_i)Velocity(i,:)=w⋅Velocity(i,:)+c1⋅(PersonalBest−Xi)+c2⋅(BestSol−Xi)Xi←Xi+Velocity(i,:)X_i \leftarrow X_i + Velocity(i,:)Xi←Xi+Velocity(i,:)
- Gaussian Mutation:
- With probability mutation_prob, perturb solution using Gaussian noise.
- Crossover with Random Partner:
- Swap variables with another random individual with probability crossover_prob.
- Escape for Stagnant Solutions:
- If Stagnant(i) >= k_stagnant, apply one of:
- Random restart
- Opposition-based restart
- Elite-guided restart
- Boundary Control:
- Reflect variables that exceed bounds back into feasible range.
- Evaluate New Solution
- Update fitness and personal best.
- Update global best if improvement occurs.
- Update stagnation counters.
Step 2.4: Global Stagnation Tracking
- Track number of iterations without improvement in BestFit.
Step 3: Convergence Recording
- Save BestFit for current iteration in ConvergenceCurve(t)
- Save population diversity and other statistics.
Step 4: Termination
- Stop after MaxIter iterations.
- Return BestSol, BestFit, ConvergenceCurve, and Stats.
Cite As
praveen kumar (2026). Bullfrog Optimization Algorithm(BOA) (https://nl.mathworks.com/matlabcentral/fileexchange/182079-bullfrog-optimization-algorithm-boa), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2025b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
