Commit Graph
54 Commits
Author SHA1 Message Date
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
swaits 3f2921ea60 feat: add prelude module
A single `use heuropt::prelude::*;` brings in the common user-facing
types and traits available so far. Subsequent commits add Pareto
helpers, operators, and algorithms to the same prelude as they land.
2026-05-04 19:18:11 -06:00