Skip to content

feat: shift and rotation wrappers and seventeen CEC- and BBOB-style functions, each with its own example - #409

Merged
tachsin merged 17 commits into
tachsin:mainfrom
tachsinatalay-code:feat/problems-batch-10b
Oct 2, 2026
Merged

tachsin merged 17 commits into
tachsin:mainfrom
tachsinatalay-code:feat/problems-batch-10b

Conversation

@tachsinatalay-code

Copy link
Copy Markdown
Contributor

Batch 10b of #260: the shift and rotation wrappers, and 17 CEC- and BBOB-style functions, each with its own example.

The wrappers

problems::Shifted<P> and problems::Rotated<P>, generic over any Problem on Real genomes and generated from a seed, so the same seed gives the same instance on every platform:

  • Shifted moves the wrapped optimum's first solution to a point uniform in the middle 80% of each range: CEC's [−80, 80] in [−100, 100], BBOB's [−4, 4] in [−5, 5].
  • Rotated draws a matrix of standard normal numbers from the seed and orthonormalizes its rows by Gram-Schmidt, applied twice, which is BBOB's method. It turns the function about that solution, as CEC 2005's (x − o) M and BBOB's R (x − xᵒᵖᵗ) do.
  • Both keep the optimum's value, take their name and reference from the wrapped problem, and draw from separate streams of the seed, so a problem shifted and rotated with one seed gets independent ones. They aren't in the registry, since they're instances of other problems. The shifted and rotated Rastrigin of CEC 2005 and BBOB are these wrappers around Rastrigin.

The functions

Sum of different powers, step, quartic (without noise, or with noise seeded from the genome), Yao, Liu and Lin's penalized 1 and 2, the high-conditioned elliptic, bent cigar, discus, BBOB's different powers, Büche-Rastrigin, non-continuous Rastrigin, Weierstrass, Katsuura, HappyCat, HGBat, Schaffer F7 and the rotated hyper-ellipsoid. They're in problems::all() and gx.problems.

Sources read:

  • the BBOB definitions (RR-6829, version 2 of 2019, with its errata)
  • the CEC 2005, 2014 and 2017 reports
  • Yao, Liu and Lin (1999)
  • Liang, Qin, Suganthan and Baskar (2006)
  • Molga and Smutnicki (2005)

Not reachable: Beyer and Finck (2012), Katsuura (1991), Schaffer et al. (1989), Levy and Montalvo (1985), and De Jong's thesis for F4's noise.

Choices:

  • Form: the functions are the plain basic functions, z = x, as the CEC 2014 and 2017 reports define them; BBOB composes its own with T_osz, T_asy and conditioning matrices. The exception is Büche-Rastrigin, which exists only in BBOB's form and keeps T_osz and its penalty.
  • Bounds: each follows its plain form's source: CEC's [−100, 100] for the elliptic, bent cigar and discus; BBOB's [−5, 5] for different powers, Büche-Rastrigin and Katsuura; CEC 2014's scaled [−5, 5] for HappyCat and HGBat; Schaffer F6's [−100, 100] for F7.

Corrections to the sources:

  • Molga and Smutnicki's "rotated" hyper-ellipsoid is axis-parallel: Σⱼ (n − j + 1) xⱼ².
  • Yao, Liu and Lin's appendix gives f12's minimizer as (1, …, 1); it's (−1, …, −1). Their table I also drops the square of f13's last (xₙ − 1).
  • The CEC 2017 report prints Schaffer F7 with sin, for BBOB's sin².

Other findings:

  • Katsuura's minima include the bounds ±5, where a PSO that stops particles at the bounds lands.
  • At G06's minimum, shifted, rounding in x − o leaves an active constraint violated by 6e-14; the docs say so.

The minima are proven from the formulas, every term being at least 0, except the noisy quartic's, which isn't known. The plan has the details in section 1.1's "Checked in batch 10b".

I checked by hand the bent cigar, discus, high-conditioned elliptic (with its guard for n = 1), HappyCat and Weierstrass (a = 0.5, b = 3, 21 terms, with the offset that makes the minimum exactly 0) against the CEC 2014 definitions.

Examples

One per function, with their rows in examples/README.md and contours on the site, including those of rotated functions (problem.rotation). To fit them among the continuous functions, 111 existing examples' orders move up by 10 or 20, ending at 198. That's below the marine design (229) and the newer method pages (280 on), and no new orders collide.

Rebased on today's main

Three conflicts:

  • src/problems.rs: the new mod gradients; and mod transform;, both kept.
  • ContourPlot.jsx: both comment additions kept (Nelder-Mead's simplex and the rotation).
  • docs/features.md: this keeps main's new method entries, its sentence on the constraints' values, and its gradients clause. The clause now says which problems have gradients: the smooth ones up to Kowalik and Powell.

Follow-up, not in this PR: the new functions don't provide analytic gradients yet, and Shifted/Rotated don't pass a wrapped problem's gradient through (chain rule through the shift and the rotation). Both are worth doing now that main has gradients for the other smooth problems.

Tests

Locally, rebased on main:

  • Lint: all four steps pass with Rust 1.99 (WSL): fmt, clippy with and without features, and the docs.
  • Rust: cargo test --all-features passes (24 suites).
  • Python: mypy --strict genoxide reports no issues, and pytest passes (974 passed, 1 skipped).
  • Examples: all 17 print their output.txt identically in Rust and Python.

…and classic functions

Shifted and Rotated make instances of any problem on Real genomes from a seed,
as the CEC and BBOB suites do. The new functions: the sum of different powers,
step, quartic (with noise drawn from the genome, or without), the two penalized
functions, the high-conditioned elliptic, bent cigar, discus, BBOB's different
powers, Büche-Rastrigin, non-continuous Rastrigin, Weierstrass, Katsuura,
HappyCat, HGBat, Schaffer's F7 and the rotated hyper-ellipsoid.
… wrappers

gx.problems gains the seventeen new functions and Shifted and Rotated, which
wrap any single-objective problem on real genomes and give their shift, or
their matrix and center, from Rust.
Seventeen examples, each in Rust and Python with its output and trace: the
unimodal functions compare CMA-ES, sep-CMA-ES, DE, PSO and a GA as they are and
shifted and rotated, and the multimodal ones count the runs that reach the
minimum from ten seeds each.
Also notes in Shifted's docs that rounding in x − o can put a shifted solution
a few ulps outside a constraint that's active there.
Conflict in docs/features.md: main's Bayesian optimization and Gaussian process entries kept, with this branch's longer test problems entry.
… restarts stops once converged

The same output in 3 s instead of 30: each evaluation's 210 cosines, some of arguments up to
2·10¹⁰, are slow, and CMA-ES sampled on to the end of its budget after converging.
…reaching the minimum from all 10 seeds

With 500,000 evaluations per run, it reaches 1e-8 from every seed, after 41,990 to 456,820. CMA-ES
without restarts, SHADE, PSO and the GA stay as contrasts with the other pages' 100,000, PSO's
corners counted in the output.
… of reach

Ten times the budget for CMA-ES with IPOP restarts, then Nelder-Mead from its best, from 5 seeds,
and the CEC 2014 winner's errors on the same functions.
@tachsin
tachsin merged commit 39097d1 into tachsin:main Oct 2, 2026
22 checks passed
@tachsin tachsin mentioned this pull request Oct 2, 2026
18 tasks done
@github-actions github-actions Bot mentioned this pull request Oct 2, 2026
tachsin pushed a commit that referenced this pull request Oct 2, 2026
## 🤖 New release

* `genoxide`: 0.13.0 -> 0.13.1 (✓ API compatible changes)
* `genoxide-python`: 0.13.0 -> 0.13.1

<details><summary><i><b>Changelog</b></i></summary><p>

## `genoxide`

<blockquote>

##
[0.13.1](v0.13.0...v0.13.1)
- 2026-10-02

### <!-- 0 -->Added

- shift and rotation wrappers and seventeen CEC- and BBOB-style
functions, each with its own example
([#409](#409))
- *(moead)* MOEA/D-DE, differential evolution in place of the crossover
(Li and Zhang 2009)
([#418](#418))
- the constrained DTLZ8 and DTLZ9, the DC-DTLZ and the DAS-CMOP
problems, each with its own example
([#414](#414))
- *(problems)* gradients for batch 10b's functions, and gradients and
constraint values through Shifted and Rotated
([#420](#420))
- *(problems)* binary and combinatorial problems, batch 12, each with
its own example ([#421](#421))

### <!-- 4 -->Documentation

- *(ctp)* CTP1-CTP8 checked against the published paper and Deb's 2001
book ([#419](#419))
</blockquote>



</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants