Commit Graph
6 Commits
Author SHA1 Message Date
swaits 2965955874 feat(pareto): add Das-Dennis reference-point generator
The standard structured weight/reference vector generator for
many-objective MOEAs (NSGA-III, MOEA/D). Generates (H+M-1 choose M-1)
points uniformly distributed on the unit simplex by enumerating all
integer compositions of `divisions` into `num_objectives` parts and
dividing each by `divisions`.

Lives in src/pareto/reference_points.rs. Re-exported from the prelude
as `das_dennis`.

Tests cover: M=2/H=4 → 5 points along the diagonal; M=3/H=12 → 91
points (the canonical NSGA-III 3-objective ref set); each generated
point has exactly M components summing to 1 within float tolerance.
2026-05-04 19:54:37 -06:00
swaits 663ed0ae58 feat(pareto): add ParetoArchive
A concrete archive (not a trait — spec §13). On insert it discards the
new candidate if any existing member dominates it, then removes existing
members the new candidate dominates. `truncate` does simple
tail-truncation in v1; the doc note flags that crowding-aware
truncation is a future improvement.
2026-05-04 19:20:59 -06:00
swaits ff557061bb feat(pareto): add crowding_distance
Computes per-point crowding distance over a single Pareto front (spec
§9.6):

- Returns Vec<f64> with the same length as the front index slice.
- Empty front → empty Vec.
- Front of length ≤ 2 → all f64::INFINITY.
- Boundary points along each objective receive INFINITY.
- Interior points get sum of normalized neighbor gaps; if max == min for
  an objective the contribution is zero.
- Operates on minimization-oriented objective values.
2026-05-04 19:20:08 -06:00
swaits 9d64a0f186 feat(pareto): add non_dominated_sort
Deb's fast non-dominated sort: returns Vec<Vec<usize>> of front indices
into the input population, with fronts[0] being the non-dominated set.
O(N²·M) is acceptable for v1 (spec §9.5).

Tests cover: small known population produces expected fronts; equal
candidates land on the same front; an empty population yields no
fronts.
2026-05-04 19:19:38 -06:00
swaits da9baf0325 feat(pareto): add pareto_front and best_candidate
`pareto_front` returns all candidates not dominated by any other in
input order (O(N²·M), acceptable for v1 per spec §9.3).

`best_candidate` is the single-objective "best" finder: returns None
unless there is exactly one objective; ignores infeasibles; returns None
if every candidate is infeasible (spec §9.4).

Both re-exported from the prelude.
2026-05-04 19:19:13 -06:00
swaits 95e797647b feat(pareto): add Dominance enum and pareto_compare
Implements spec §9.1–9.2:

- `Dominance` enum (Dominates / DominatedBy / NonDominated / Equal).
- `pareto_compare(a, b, objectives)` with the four-step rule: feasible
  beats infeasible; among infeasibles, lower violation wins; among
  feasibles, compare in minimization orientation via
  ObjectiveSpace::as_minimization.

Unit tests cover dominance, dominated-by, non-dominated, equal, the
feasibility tiebreak, and that Maximize objectives are handled correctly
(spec §18.2).
2026-05-04 19:18:43 -06:00