Reference Python implementation of the Success-Based Optimization Algorithm
(SBOA), a population-based metaheuristic inspired by success attribution
theory. The search is guided by two influence sub-populations: spA (the three
best solutions, exploitation) and spB (a binary-tournament sub-population,
exploration). A probabilistic criterion (Cp1, Cp2) selects which
sub-population influences each candidate at every iteration.
If you use this code, please cite:
Lara-Montaño, O.D., Gómez-Castro, F.I., Gutiérrez-Antonio, C., Dragoi, E.N. (2025). Success-Based Optimization Algorithm (SBOA): Development and enhancement of a metaheuristic optimizer. Computers and Chemical Engineering, 194, 108987. https://doi.org/10.1016/j.compchemeng.2024.108987
pip install -r requirements.txtRequires Python 3.10+.
import numpy as np
from sboa import sboa
def sphere(x):
return float(np.sum(x ** 2))
best_pos, best_score, history = sboa(
sphere, lb=-5.12, ub=5.12, dim=30,
pop_size=50, max_iter=1000, seed=42,
)
print(best_score)best_pos, best_score, history = sboa(fobj, lb, ub, dim,
pop_size=50, max_iter=1000,
Cp1=0.9, Cp2=0.55, seed=None)
fobj— objective function to minimize: takes a length-dimvector, returns a scalar.lb,ub— lower/upper bounds (scalar or length-dimarray).dim— number of decision variables.pop_size(n),max_iter(N) — population size and iteration budget.Cp1,Cp2— probability criteria. Defaults are the paper's tuned values (Table 3).- Returns the best position, its objective value, and the per-iteration convergence curve.
benchmark.py compares SBOA against PSO, DE and GWO on five classic test
functions, reporting mean ± std over independent runs, the Wilcoxon signed-rank
test (SBOA vs. each competitor), and per-run compute time. It also saves a
convergence plot (convergencia.png).
python3 benchmark.pyThis is a lightweight benchmark (dim=30, pop=30, 500 iterations, 15 runs) for quick verification. It does not reproduce the paper's experimental protocol (CEC 2017, pop=100, N = 10000·m/n). Results are illustrative, not the published benchmark.
Two points in the paper leave room for interpretation; this implementation resolves them as follows:
spBsize. The paper's final version (Fig. 1) buildsspBby binary tournament. HerespBhas the same size as the population (pop_sizetournament winners). The earlier ranking-based definition described in Section 3.3 is not used.- Second probability test (
r ≤ Cp2). Drawn independently from the first (r ≤ Cp1). With a shared draw andCp2 < Cp1, the firstspBstrategy could never trigger.
If your original implementation differs on either point, adjust sboa.py
accordingly.
sboa.py— standalone SBOA implementation.benchmark.py— comparison against PSO, DE, GWO with statistics and timing.requirements.txt— pinned dependencies.
Released under the MIT License. See LICENSE.