Bullfrog Optimization Algorithm(BOA)

This program implements BOA a new bio inspired evolutionary algorithm based on bullfrog
17 Downloads
Updated 21 Sep 2025

View License

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
  1. Initialize population X randomly within bounds [VarMin, VarMax].
  2. If opposition-based initialization is enabled, initialize half of the population using opposition-based strategy:Xi=VarMin+VarMaxXiX_i = VarMin + VarMax - X_iXi=VarMin+VarMaxXi
  3. Evaluate fitness Fitness(i) = fobj(X(i,:)) for all individuals.
  4. Set PersonalBest(i,:) = X(i,:) and PersonalBestFit(i) = Fitness(i).
  5. Identify BestSol and BestFit from the initial population.
  6. 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(smaxsmin)t/MaxIters = s_{max} - (s_{max} - s_{min}) \cdot t / MaxIters=smax(smaxsmin)t/MaxIter
  • Inertia weight for velocity:
w=0.90.5t/MaxIterw = 0.9 - 0.5 \cdot t / MaxIterw=0.90.5t/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:
  1. Elite Solutions Perturbation:
  • If i is elite, apply small Gaussian perturbation.
  1. Enhanced Ambush Hunting:
  • Multi-step update toward BestSol:
XiXi+hunt_factor(BestSolXi)X_i \leftarrow X_i + hunt\_factor \cdot (BestSol - X_i)XiXi+hunt_factor(BestSolXi)
  • With probability, apply Levy flight for long jumps.
  1. 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
  1. Predator Avoidance:
  • Move away from worst solutions to avoid local traps:
XiXi+avoidance_strength(XiXworst)X_i \leftarrow X_i + avoidance\_strength \cdot (X_i - X_{worst})XiXi+avoidance_strength(XiXworst)
  1. Velocity-based Update (PSO inspired):Velocity(i,:)=wVelocity(i,:)+c1(PersonalBestXi)+c2(BestSolXi)Velocity(i,:) = w \cdot Velocity(i,:) + c1 \cdot (PersonalBest - X_i) + c2 \cdot (BestSol - X_i)Velocity(i,:)=wVelocity(i,:)+c1(PersonalBestXi)+c2(BestSolXi)XiXi+Velocity(i,:)X_i \leftarrow X_i + Velocity(i,:)XiXi+Velocity(i,:)
  2. Gaussian Mutation:
  • With probability mutation_prob, perturb solution using Gaussian noise.
  1. Crossover with Random Partner:
  • Swap variables with another random individual with probability crossover_prob.
  1. Escape for Stagnant Solutions:
  • If Stagnant(i) >= k_stagnant, apply one of:
  • Random restart
  • Opposition-based restart
  • Elite-guided restart
  1. Boundary Control:
  • Reflect variables that exceed bounds back into feasible range.
  1. 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 Linux
Tags Add Tags
Version Published Release Notes
1.0.0