Changelog¶
1.0.0 (2026-12-04)¶
The first stable release. The public API follows semantic versioning from now on: setting names, defaults and seeded results change only in a new major version, or with a note here when a fix needs it. Subclassing Algorithm stays provisional in 1.x.
- Docs: the documentation moved to https://smkalami.github.io/ypea-docs/. The old address forwards every page there. A new page compares YPEA with other libraries (Comparison with other libraries).
- Breaking: a few arguments are now keyword-only, so their meaning cannot be mixed up: everything after
budgetintune(), everything afterrunsinExperiment(),m,dimandfront_pointsinypea.benchmarks.multi_problem()(before,multi_problem("zdt1", 30)meant 30 objectives), andradiusandseedinypea.problems.circle_tsp(). Code that passed them by name, as the docs do, is unchanged. - Breaking:
from ypea import *no longer replaces Python's ownrandommodule.ypea.randomandypea.StudioRngwork as before. - Breaking:
Sequence(pop_size=...)raises an error. The value was ignored, because each stage has its ownpop_size. - Renamed settings, so that names are clear and the same idea has the same name everywhere: PSO
wdampis noww_damp, BAtypeisvariant, BBOmutation_probismutation_rate(as in GA and SA), MOPSOmutation_rateismutation_decay, IPOP-CMA-ESincpopsizeispop_size_factor, andstrategyof HillClimbing, VNS, ILS and GRASP isimprovement. CAselection=TrueorFalseis nowsurvival="best"(default) or"offspring", and MOEA/Dbatch=FalseorTrueis nowupdate="steady"(default) or"generational". GA's roulette wheel selection is nowselection="roulette"("roulettewheel"and"rw"are still accepted). The old setting names still work as arguments when an algorithm is created (also in thefixedsettings oftuneandsweep) in all 1.x releases, with aDeprecationWarning, and they will be removed in 2.0. Attributes such aspso.w_damp,params(), printed algorithms and pickles use only the new names. Seeded results are unchanged. history.at_nfe(n)returns a number for a singlen, and an array for several.DE(strategy=...)raises an error when another setting disagrees with the strategy (it was silently dropped), andde.strategycan be set after construction.NativeCrossoverandNativeMutationsay at once when a function has the wrong form, for examplepmx, which belongs inPermutationOperators(crossovers=...).Population.violationgives the violation of each row, asBest.violationdoes for the best solution.- Internal names of
ypea.random,ypea.plot,ypea.callbacksandypea.constructionare no longer exported, andypea.neighborhoodsis imported with the package. - Docs: an API page for tuning, the missing members on the API pages, which attributes of a running algorithm are stable (Callbacks), and a note that subclassing
Algorithmis provisional in the 1.x releases.
0.11.0 (2026-12-02)¶
- New: Applications. Worked examples of real problems, each with the model, the code, results of a few suitable algorithms against the best known value, and figures. The first are job shop scheduling (ft06 and ft10), project scheduling (PSPLIB j60), economic dispatch (6 and 13 units), graph coloring (DIMACS queen graphs), PID controller tuning, portfolio selection, antenna array design (a thinned 100-element array), traveling salesman problem (TSPLIB eil51 and st70), vehicle routing with time windows (Solomon C101), inventory control (a warehouse and four shops, by simulation), supply chain network design, water network design (two-loop and Hanoi networks) and system identification (choosing the terms of a nonlinear model). Scripts in
examples/applications/. - New:
ypea.problems.port1(), the Hang Seng portfolio data of OR-Library with its efficient frontier. - Changed:
alg.best.obj_valueand the newalg.best.violationare plain numbers, as inresult.best, so callbacks no longer need[0]. Code that usedalg.best.obj_value[0]must drop the[0]. - Changed:
history.front_at(nfe)returns the objective values of the front afternfeevaluations. The boolean mask it returned before is nowhistory.front_mask(nfe). TuneResult.summary()shows the best setting and the runs used out of the budget, with the reason when a few runs stay unused.TuneResult.budgetkeeps the budget.- Fix: CMA-ES and IPOP-CMA-ES no longer print an overflow warning when a very large step makes the step size jump (it is capped at the size of the search space anyway). Seeded results are unchanged.
- Printed solutions show plain numbers,
Solution(x=5.0, k=7)instead ofSolution(x=np.float64(5.0), k=np.int64(7)).
0.10.2 (2026-11-30)¶
- Docs: every code example now runs on its own when copied, and every printed output comes from a real run (the tuning, experiments and VNS pages showed outdated values). Examples say what they show, and terms are explained where they first appear.
- Fix: the Ant System, Ant Colony System and MAX-MIN Ant System classes had no docstring, so
help()and their docs pages showed no description or settings. - Clearer docstrings for GA, SA, ICA, BA, FA, CA, CMA-ES, IPOP-CMA-ES, L-SHADE, VNS and GRASP. No change in behavior or results.
0.10.1 (2026-11-30)¶
- Docs and project page: a new README with a table of all 34 algorithms (full names, classes and families) and links to every main docs page, a Start here section on the docs home, and Documentation, Changelog and Issues links on PyPI. The algorithm count, the common settings lists and the advice on choosing an algorithm are updated for 0.10.
- No code changes.
0.10.0 (2026-11-30)¶
- Local search:
HillClimbing(HC),TabuSearch(TS),VNS,ILS(iterated local search, with random or double bridge kicks and four acceptance rules) andGRASP(greedy randomized construction from a heuristic, then local search). They suit combinatorial problems, and all but GRASP also handle real variables. See Hill Climbing, Tabu Search, VNS, ILS and GRASP. - Ant colony optimization:
AntSystem(AS, with Elitist and rank-based AS),AntColonySystem(ACS) andMaxMinAntSystem(MMAS) build permutations, selections, integers and partitions step by step, with an optional heuristic. See Ant colony optimization. - Hybrids:
Sequenceruns several algorithms one after another as one run, with one budget, one best solution and one Result. Each stage starts from the previous stage's best solutions, andshares=splits the budget. See Sequence. - Memetic runs: every population algorithm takes
local_search=(an algorithm such asHillClimbing()),local_search_probandlocal_search_nfe. Some new solutions are improved by a short local search and replaced (Lamarckian). See Memetic runs. - Starting solutions: every algorithm takes
x0: code arrays, decoded solutions,Individualobjects or aResult. They become the first members of the initial population, and restarts stay random. CMA-ES now rejects anx0outside [0, 1] instead of clipping it. - Neighborhoods:
ypea.neighborhoodslists, samples and applies the local moves of every variable type, with the tabu attributes of each move. See Neighborhoods. - Experiments: a setting that is a function (for example an ACO heuristic) is stored by its name, so its stored runs are reused.
Algorithm.params()now listsx0and the memetic settings, so experiment runs stored by earlier versions are not reused and run again. - Seeded results of the existing algorithms are unchanged.
0.9.1 (2026-11-29)¶
- Docs: rewritten to be brief: each fact is stated once, algorithm pages show the defaults with real output, and stale outputs and figures are updated for the 0.9.0 defaults. The page on changes from the original toolbox moved to
changes.md, and the shared rules of JADE, SHADE and L-SHADE moved to the JADE page. - Test problems: the 20-item example knapsack is now
ypea.problems.small_knapsack(). Its earlier name is removed, so update calls to it. - Fixes in the docs: the JADE tie rule (JADE replaces a parent only when the trial is strictly better), and
targetis not a setting of the multi-objective algorithms. - No seeded result changes.
0.9.0 (2026-11-29)¶
- Install:
pip install "ypea[all]"installs both optional groups,plotandstats. - SA: new setting
selection."pool"(the new default) sorts all moves of an iteration together and makes the k-th best move the candidate of the k-th best current solution, so a promising solution can place several candidates."chain"keeps the previous behavior (independent chains). Seeded SA results change. - New defaults (seeded results change): PSO lowers the inertia weight linearly from 0.9 to 0.4 and limits each velocity component to 0.15 in code units (
w=0.9, w_final=0.4, max_velocity=0.15, beforew=1, wdamp=0.99without a limit). DE usescrossover_prob=0.9(before 0.2), SAselection="pool", CA influence type 4 withbeta=0.2(CAEP(Nsd), before type 3 with beta 1), IWOmodulation_index=3(the paper's recommendation, before 2) and HSpar=0.35(before 0.1). Each was chosen on benchmark tests (see Default values). On random-key combinatorial problems the previous PSO settings are still better. The old values stay available as settings. - Fixes from a paper audit (seeded results change in these cases only): crowding distance no longer gives an infinite distance to two arbitrary solutions when an objective is constant over a front (NSGA-II, and
max_archivetrimming). JADE keeps the parent when a trial vector ties with it, as in the JADE paper. The pbest count of JADE, SHADE and L-SHADE rounds halves up, as in the reference code (for example 17 of 150, before 16). In SHADE and L-SHADE, a finite trial that beats a parent with an infinite or NaN value now gets the largest weight of its batch, before 0. CMA-ES withmu=lambda // 2given explicitly now uses the default weights. GA rounds its crossover and mutation counts half up (for example 5 mutants of 15, before 4). - MOPSO repository (seeded MOPSO results change): when the repository is full, the member to remove now comes from a hypercube chosen at random among the most crowded ones. Before, ties always went to the first hypercube in sorted order, so on three objectives the repository, and with it the leaders, collapsed to one end of the front. The reported front was not affected.
- Nelder-Mead (seeded results change near the bounds): the expansion and the outside contraction are built from the centroid and the worst vertex, as in Lagarias et al. (1998), not from the reflection after it was clipped to the bounds.
- NSGA-III (seeded results change on constrained problems): only feasible solutions set the ideal and extreme points of the normalization (all solutions while none is feasible), as in pymoo.
- Docs: corrected sources for DE (exponential crossover and accepted ties).
- MOPSO: settings
c1andc2scale the pulls toward the particle's best position and its leader (default 1 and 1, as in the paper). Default results are unchanged.
0.8.0 (2026-11-28)¶
- Native space for several objectives: NSGA-II, NSGA-III, SPEA2 and MOEA/D take
space="native"andoperators=, as GA does. Permutation, integer, selection and partition variables get their native operators, and real variables keep SBX and polynomial mutation, so problems with only real variables give the same results. The defaultspace="encoded"is unchanged. See Native operators. - Indicators: a test now covers experiments with mixed senses (one objective minimized, one maximized), and the guide explains how to use
ypea.indicatorsdirectly with maximized objectives. - Docs: figures and diagrams throughout: how the library fits together, how each variable type decodes its codes, the run loop, the constraint rules, ask and tell, the tuning race, benchmark functions, test problem solutions, Pareto fronts, indicators, operators, experiment reports, and a figure of how each algorithm searches.
docs/figures/make_figures.pymakes every figure from seeded runs.
0.7.0 (2026-11-27)¶
- MOPSO inertia (seeded MOPSO results change once): the default
wis now 0.7 (before 0.4, the paper's value). On 21 ZDT, DTLZ and WFG problems (15 runs, 25 000 evaluations), 0.7 had 13 wins, 2 ties and 6 losses in IGD and 12 wins, 4 ties and 5 losses in hypervolume.MOPSO(w=0.4)gives the paper's setting. - Constraint scaling (seeded results on constrained problems change once): each constraint is divided by its largest violation among the first solutions of a run (at least 20, so algorithms that start with fewer evaluate random solutions to make up 20), as Deb (2000) recommends, so constraints of different sizes count alike. The scales stay fixed for the run and are in
Result.constraint_scale. The penalty uses the scaled violation too.Problem(constraint_scaling=False)gives the raw sum as before, and a list gives fixed scales. See Scaling of the constraints. - ICA defaults from the paper (seeded ICA results change once):
assimilation_coeff=2,zeta=0.1,empire_count=10(before 1.5, 0.2 and 5), and the competition rule of Atashpaz-Gargari and Lucas (2007), the largest P - U(0, 1). On 119 benchmark problems (15 runs each), they had 30 wins, 83 ties and 6 losses against the old values.competition="roulette"gives the old draw. See Default values. - HS and BA: the paper values tested (one new harmony per iteration, and the Bees Algorithm's fewer sites and smaller patch) did not do better, so the defaults stay. The evidence is in Default values.
- Docs: claims about the papers of BA, HS, ICA, TLBO, CA and FA corrected after checking them against the papers.
0.6.0 (2026-11-26)¶
- New defaults for DE and GA (seeded results change once): DE uses the fixed scale factor F = 0.5 of Storn and Price (
beta_min=0.5, beta_max=0.5, before a new F per component from [0.2, 0.9]), and GA uses BLX-0.5 (crossover_inflation=0.5, before 0.1). On 119 benchmark problems (15 runs each), F = 0.5 had 38 wins, 81 ties and no loss, and BLX-0.5 had 41 wins, 70 ties and 8 losses. The old values stay available as settings. See Default values. - Multiple objectives (core):
Problem(..., n_obj=m, sense=[...]), constrained domination, fast non-dominated sorting and the crowding distance of Deb et al. (2002) in the comparator, an exact archive of the non-dominated solutions in every run (Result.front, withmax_archive), a trace that rebuilds the front at any budget (history.front_at), andypea.scalarize(weighted sum or Tchebycheff).RandomSearchsolves both kinds of problems, and the other algorithms raise a clear error on several objectives. See Multiple objectives. Single-objective results are unchanged. - Operator library:
ypea.operators.SBXandPolynomialMutation(Deb's bounded forms, in the [0, 1] codes), andNativeCrossoverandNativeMutation. GA takescrossover=andmutation=, and SA takesmutation=, with a check that each operator fits the space and the variables. The defaults and their results are unchanged. GA's methodcrossoveris nowblend_crossover. - Equality constraints: the objective may return
(f, g, h). An equality counts as satisfied when|h| <= atol + rtol * scale(defaults 1e-4, 1e-6 and 1, set withequality_atol,equality_rtolandequality_scale). See Equality constraints. - Best feasible solution and the evaluation log:
Result.best_feasibleis the best feasible solution, tracked exactly with its own trace, also whenconstraints="penalty"makes the best solution infeasible.solve(..., keep_evaluations=True)keeps every evaluated solution inResult.evaluations. - Native mutation with several variables: each variable now mutates with probability 1/k (k variables), with at least one per mutant, instead of all at once. A good move in one variable is no longer always paired with forced changes in the others. On a problem with three routes and a knapsack (10 runs, 10 000 evaluations), the mean result improved from -9.48 to -11.65 with GA and from -6.76 to -11.85 with SA. Results with one variable, or with the default
space, are unchanged. - Ask and tell:
algorithm.ask_tell(problem, seed=...)runs any algorithm while you evaluate its solutions yourself (ask(),tell(values),result(),stop()), with the same results assolve. A problem may haveobjective=Nonefor this. See Ask and tell. - Multi-objective benchmarks: ZDT1 to ZDT6, DTLZ1 to DTLZ7 and WFG1 to WFG9 as vectorized functions with sampled true Pareto fronts (
ypea.benchmarks.pareto_front), checked against pymoo. The indicators GD, IGD, GD+, IGD+, hypervolume (exact for up to three objectives, seeded Monte Carlo above) and spacing inypea.indicators, and front plots inypea.plot.front. See Multi-objective benchmarks. - NSGA-II and NSGA-III:
ypea.NSGAII(Deb et al. 2002) andypea.NSGAIII(Deb and Jain 2014) for problems with several objectives, with the papers' operators by default and any code operator fromypea.operatorsascrossover=andmutation=. See NSGA-II and NSGA-III. - MOEA/D (Zhang and Li 2007): decomposition with Tchebycheff (default), weighted sum or PBI subproblems on Das and Dennis weights, SBX and polynomial mutation by default. See MOEA/D.
- MOPSO (Coello Coello, Pulido and Lechuga 2004): a particle swarm with a repository of leaders in an adaptive grid and the paper's fading mutation. See MOPSO.
- Experiments with several objectives: each run stores the IGD and hypervolume of its front at the end and at the checkpoints, and
Report.table(metric="igd")andmetric="hypervolume"compare them with the same Wilcoxon and Friedman tests as for one objective, with convergence plots of the checkpoints. The hypervolume is normalized by the ideal and nadir points of the true front, with the reference point 1.1.ypea.benchmarks.multi_problemgives ZDT, DTLZ and WFG benchmarks as problems with their true fronts. Single-objective runs and their stored files are unchanged. See Experiments. - MOEA/D
batch=True: a variant that breeds and evaluates a whole generation in one call, then applies the updates in order, for vectorized or parallel objectives. The default (batch=False, the paper) is unchanged. - SPEA2 (Zitzler, Laumanns and Thiele 2001): strength and density fitness, an archive with the truncation operator, SBX and polynomial mutation by default. See SPEA2.
0.5.0 (2026-11-26)¶
- The GA guide recommends
mutation_step_size_damp=1for combinatorial problems and long runs, with benchmark evidence. The default stays 0.99. - Native operators for
PartitionandBinaryPartition(space="native"): the permutation crossovers and moves on the ordering of items and separators, so routing problems modeled as a partition benefit from the native space. Results with the defaultspaceare unchanged. Native space runs with a partition variable change.
0.4.0 (2026-11-26)¶
- Benchmarks: 26 classic functions with seeded shift and rotation, and the CEC 2017 and CEC 2022 suites with the official data, checked against the official C code. See Benchmarks.
- Test problems: constrained engineering design (pressure vessel, welded beam, spring, speed reducer, three bar truss, gear train), combinatorial problems (TSP, knapsack, QAP, n-Queens) and allocation problems (CVRP, generalized assignment, hub location, transportation), with readers for TSPLIB, QAPLIB, OR-Library and CVRPLIB files. See Test problems.
- Experiments:
ypea.Experimentruns many algorithms on many problems in parallel, with reproducible seeds, and resumes interrupted studies.ypea.Reportgives Wilcoxon, Friedman and Holm tests, CSV, LaTeX, Markdown and HTML tables, figures, a one-page HTML report, and the CEC 1e-8 rule (zero_below). See Experiments. - Native operators for GA and SA (
space="native"): permutation crossovers and moves, operators for real, integer, binary and selection variables, and custom operators. Default results are unchanged. See Native operators. Problem(info=...)for metadata,Result.to_dict()for JSON, andResult.extrafor information of the algorithm.- Tuning: iterated racing (as in irace) and sweeps of algorithm settings. See Tuning.
- This documentation site and the
examplesfolder. - Faster evaluation and comparison in the core (5 to 38% less run time), with identical results.
- CMA-ES and IPOP-CMA-ES sample with the symmetric root B D B^T z, so seeded runs do not depend on the eigenvector signs. This changes seeded CMA-ES results once.
- ICA: the weakest empire can no longer win its own colony in the competition.
- Default values records which defaults follow their papers, with benchmark evidence.
0.3.0 (2026-11-25)¶
ypea.StudioRng, the random generator of YPEA Studio:solve(problem, seed=ypea.StudioRng(n))draws the same numbers as Studio.ypea.derive_seedgives the seeds of an experiment.- Two reference methods:
RandomSearchandNelderMead(with restarts). - Objective values that are not finite (NaN, inf and -inf) count as the worst.
- Fixes from code audits:
- IWO: the step size schedule follows the share of the run used, so it ends with the run.
- CA: at least two solutions update the culture.
- SA: the Metropolis rule uses the comparison keys, so it is correct with constraints and penalties, and the temperature no longer falls below
final_temp. - IPOP-CMA-ES: restarts on plateaus of infinite values and always grows the population at a restart.
- Clearer errors for wrong settings.
- Stress tests for every algorithm (one and 30 dimensions, flat, infinite and NaN objectives, problems that are never feasible), and numeric warnings now fail the tests.
0.2.0 (2026-11-25)¶
- All 15 algorithms of the original toolbox: ABC, ACOR, BA, BBO, CA, CMA-ES, DE, FA, GA, HS, ICA, IWO, PSO, SA and TLBO.
- Four modern baselines: JADE, SHADE, L-SHADE and IPOP-CMA-ES.
- CMA-ES rewritten from the tutorial of Hansen (2016), with the recombination weights and learning rates of its Table 1.
- ABC and IWO use the fitness formula of their papers, and switch to ranks when the problem has constraints.
- Defaults follow the papers: the onlooker count and trial limit of ABC, the initial step size of IPOP-CMA-ES.
CA(selection=False)andBA(neighborhood="component")keep the schemes of the original toolbox.- Changes from the original toolbox lists every change.
0.1.1 (2026-11-25)¶
- A new release to refresh the description on PyPI.
0.1.0 (2026-11-25)¶
- The first release: the core framework (variable types with decoding and encoding, problems with constraints, the comparison rules, evaluation with an exact budget, results and history, callbacks and plots) and the first four algorithms: PSO, DE, GA and SA.
max_iterdefaults to None, and 100 iterations apply only when no limit is given.- Algorithms pickle with their settings only.