Skip to content

Benchmark problems

sezgi.problems.*: CEC 2014/2017/2022, TSPLIB, and a small diagnostic trio (onemax / int_quadratic / cat_match) plus a mixed-space scaffold. Every handle here is solve()-eligible, exactly like sezgi.bbob(...).

problems.cec2022 builtin

cec2022(fid, dim)

sezgi.problems.cec2022(fid, dim) -- a [Problem] handle for a CEC 2022 function (sezgi_problems::Cec2022::new), usable with solve() (via sezgi.presets.* + sezgi.solve) exactly like sezgi.bbob(...). See [Cec2022::new]'s own doc for the exact fid/dim domain.

Errors

ValueError for [sezgi_problems::Cec2022Error]: fid outside 1..=12, dim outside {2, 10, 20}, or dim=2 for a hybrid function (fid 6-8).

problems.cec2022_evaluate builtin

cec2022_evaluate(fid, dim, x)

sezgi.problems.cec2022_evaluate(fid, dim, x) -- direct, one-shot evaluation of a CEC 2022 function at x (a length-dim list of floats), bypassing solve()'s budget/engine machinery entirely. Returns the exact f64 [Cec2022::evaluate_batch] computes (Problem::evaluate_batch's own xs.len() == self.dim check is redundant with the explicit length check below, but the explicit check gives a clear ValueError message instead of a silent f64::INFINITY sentinel).

Errors

ValueError for the same [sezgi_problems::Cec2022Error] cases as cec2022(...), plus a ValueError if len(x) != dim.

problems.cec2022_f_star builtin

cec2022_f_star(fid)

sezgi.problems.cec2022_f_star(fid) -- the report's pinned F_i* bias ([Cec2022::f_star], module doc section 1.2's table). f_star does not depend on dim, so an internal probe dim=10 is used purely to validate fid (every fid in 1..=12 accepts dim=10, hybrids included) -- dim is not itself a parameter of this function.

Errors

ValueError if fid is outside 1..=12.

problems.cec2014 builtin

cec2014(fid, dim)

sezgi.problems.cec2014(fid, dim) -- a [Problem] handle for a CEC 2014 function (sezgi_problems::Cec2014::new), usable with solve() and EvalSession.for_problem exactly like sezgi.problems.cec2022(...). See [Cec2014::new]'s own doc for the exact fid/dim domain.

Errors

ValueError for [sezgi_problems::Cec2014Error]: fid outside 1..=30, or dim outside {10, 30}.

problems.cec2014_evaluate builtin

cec2014_evaluate(fid, dim, x)

sezgi.problems.cec2014_evaluate(fid, dim, x) -- direct, one-shot evaluation of a CEC 2014 function at x (a length-dim list of floats), bypassing solve()'s budget/engine machinery entirely. Same shape as cec2022_evaluate(...).

Errors

ValueError for the same [sezgi_problems::Cec2014Error] cases as cec2014(...), plus a ValueError if len(x) != dim.

problems.cec2014_f_star builtin

cec2014_f_star(fid)

sezgi.problems.cec2014_f_star(fid) -- the pinned F_i* = 100*fid bias ([Cec2014::f_star]). Does not depend on dim; an internal probe dim=10 validates fid only.

Errors

ValueError if fid is outside 1..=30.

problems.cec2017 builtin

cec2017(fid, dim)

sezgi.problems.cec2017(fid, dim) -- a [Problem] handle for a CEC 2017 function (sezgi_problems::Cec2017::new), usable with solve() and EvalSession.for_problem exactly like sezgi.problems.cec2022(...). See [Cec2017::new]'s own doc for the exact fid/dim domain.

Errors

ValueError for [sezgi_problems::Cec2017Error]: fid outside {1} union {3..=30}, fid == 2 (officially withdrawn -- the Rust [sezgi_problems::Cec2017Error::Withdrawn] message is surfaced VERBATIM so a caller sees the honest reason, distinct from an ordinary out-of-range fid), or dim outside {10, 30}.

problems.cec2017_evaluate builtin

cec2017_evaluate(fid, dim, x)

sezgi.problems.cec2017_evaluate(fid, dim, x) -- direct, one-shot evaluation of a CEC 2017 function at x (a length-dim list of floats), bypassing solve()'s budget/engine machinery entirely. Same shape as cec2022_evaluate(...).

Errors

ValueError for the same [sezgi_problems::Cec2017Error] cases as cec2017(...) (withdrawn fid == 2 included), plus a ValueError if len(x) != dim.

problems.cec2017_f_star builtin

cec2017_f_star(fid)

sezgi.problems.cec2017_f_star(fid) -- the pinned F_i* = 100*fid bias ([Cec2017::f_star]). Does not depend on dim; an internal probe dim=10 validates fid only.

Errors

ValueError if fid is outside {1} union {3..=30} (fid == 2 included, via the [sezgi_problems::Cec2017Error::Withdrawn] message).

problems.tsp builtin

tsp(name)

sezgi.problems.tsp(name) -- a [Problem] handle for a VENDORED TSPLIB instance (sezgi_problems::Tsp::vendored: "berlin52", "eil51", or "st70"), usable with solve() exactly like sezgi.bbob(...) / sezgi.problems.cec2022(...).

Errors

ValueError if name is not one of the three vendored instances.

problems.tsp_load builtin

tsp_load(name_or_text)

sezgi.problems.tsp_load(name_or_text) -- loads a TSPLIB EUC_2D instance, either a vendored instance name or raw TSPLIB file text (see load_tsp), and returns a dict describing it: name (str), n_cities (int), coords (list of (x, y) tuples, index c is the coordinate pair Tsp::coords()[c] -- genotype index c maps to TSPLIB node c + 1, see tsp.rs's module doc), known_optimum (float, or None for an instance parsed from raw text rather than a vendored name).

Errors

ValueError for any [TspError] (unknown vendored name that also fails to parse as TSPLIB text, malformed TSPLIB text, unsupported EDGE_WEIGHT_TYPE, ...).

problems.tsp_tour_length builtin

tsp_tour_length(name_or_text, tour)

sezgi.problems.tsp_tour_length(name_or_text, tour) -- closed-tour length of a 0-based tour (a permutation of 0..n_cities) on the instance named/parsed by name_or_text (see load_tsp), via Tsp::evaluate_batch's nint-rounded EUC_2D sum (tsp.rs's module doc). UNLIKE Tsp::evaluate_batch itself (which returns f64::INFINITY for a malformed genotype, since genotype validity is normally the engine's SearchSpace::validate job, not Tsp's own) -- this binding validates tour itself (exact length, every entry in 0..n_cities, no repeats) and raises a precise ValueError instead, since a tour coming directly from Python has no engine-side validation gate in front of it.

Errors

ValueError for any [TspError] resolving name_or_text, or if tour is not a permutation of 0..n_cities (wrong length, an out-of-range entry, or a repeated entry).

problems.onemax builtin

onemax(n_bits)

sezgi.problems.onemax(n_bits) -- a [Problem] handle for [sezgi_problems::diagnostics::OneMax] (M3-8 Task 9), the classic Binary-block GA diagnostic (Goldberg 1989; this crate's own minimize-the-zero-bit-count re-expression -- see that module's doc). Solve()-eligible exactly like sezgi.bbob(...). Pairs with sezgi.presets.ga_bin(pop_size, budget).

problems.int_quadratic builtin

int_quadratic(lo, hi, n)

sezgi.problems.int_quadratic(lo, hi, n) -- a [Problem] handle for [sezgi_problems::diagnostics::IntQuadratic] (M3-8 Task 9), an Int-block quadratic bowl around a fixed target derived deterministically from (lo, hi, n) (see that module's own doc; the constructor takes no seed argument, by the Task 5 brief's pinned signature). Pairs with sezgi.presets.ga_int(pop_size, budget).

Errors

ValueError if lo >= hi -- checked explicitly here (rather than letting IntQuadratic::new's own internal SearchSpace::new(...).expect(..) panic) so a bad Python call gets a clean exception instead of a Rust panic, matching every other bounds-checked constructor in this file.

problems.cat_match builtin

cat_match(k, n, seed)

sezgi.problems.cat_match(k, n, seed) -- a [Problem] handle for [sezgi_problems::diagnostics::CatMatch] (M3-8 Task 9), a Categorical- block Hamming-distance-to-target matching problem; unlike int_quadratic, seed IS an explicit caller-supplied parameter (Task 5 brief's pinned signature). Pairs with sezgi.presets.ga_cat(pop_size, budget).

problems.mixed_diagnostic builtin

mixed_diagnostic(n_float, n_int, k_cat, n_cat, n_bin)

sezgi.problems.mixed_diagnostic(n_float, n_int, k_cat, n_cat, n_bin) -- a [Problem] handle for [MixedDiagnostic] (M3-8 Task 9), a Float+Int+Categorical+Binary mixed-space scaffold problem added SOLELY so gen/compound (Task 5) is reachable end to end through a Python-authored, mixed-space TOML AlgorithmSpec -- see [MixedDiagnostic]'s own doc for the exact block layout/evaluate_batch formula (mirrors crates/components/src/compound.rs's own test-local MixedProblem). Not a benchmark, not one of Task 5's brief-pinned diagnostics; optimum() is always None.