Skip to main content

Module pareto

Module pareto 

Expand description

Multi-objective comparison: dominance, fronts, crowding, constraints and hypervolume.

This is the arithmetic multi-objective optimization rests on, kept free of any sampler, study or storage state so every piece can be pinned by an exact golden computed by hand. Nsga2 is its first consumer; StudyView::pareto_front is the second.

PieceAnswers
dominatesis a at least as good in every objective and better in one?
constrained_dominatesthe same question, feasibility first
fast_non_dominated_sortwhich front does each point belong to?
crowding_distancehow isolated is a point inside its front?
hypervolumehow much objective space does a front cover?
worst_constraintswhat does a multi-seed fan’s feasibility collapse to?

§Multi-objective is not a bolt-on

The seams were built for this from M1: a trial’s values is a Vec<f64>, Scheduler::on_report takes a values slice so pruning is multi-objective-aware, and StudyView::best deliberately returns None for a multi-objective study because there is no total order on a Pareto front. This module is the answer that replaces it.

§Two decisions that run through everything

A NaN objective never wins. A vector that carries a NaN — or that has the wrong number of objectives — is incomparable rubbish: it dominates nothing and is dominated by every well-formed vector, so it sinks to the last front instead of silently colonising the Pareto set. This matches Direction::is_better (where NaN is never better than anything) and the multi-seed aggregates (where NaN propagates and simply cannot win). ±∞ is an ordinary float here and compares normally.

Constraints are feasibility-first (Constraints): a feasible solution beats an infeasible one whatever their objectives say, and two infeasible ones are ranked by total violation. The sign convention is Optuna’s — ≤ 0 is satisfied, > 0 is violated — and a constraint value is recorded as typed state on the trial (constraint, TrialCtx::record_constraints), never as an extra objective column. A trial that is a multi-seed fan records one vector per replicate and carries their componentwise worst (worst_constraints), because feasibility has to hold on every seed.

Re-exports§

pub use constraint::CONSTRAINT_BLOB_KIND;
pub use constraint::CONSTRAINT_BLOB_VERSION;
pub use constraint::TrialConstraints;
pub use constraint::constraint_scope;
pub use constraint::is_feasible;
pub use constraint::total_violation;
pub use constraint::worst_constraints;

Modules§

constraint
Typed constraints: the sign convention, the arithmetic, and where a trial’s constraint values live.

Structs§

Point
One solution as the comparison layer sees it: its objectives and, if it declared any, its constraint values.

Constants§

MAX_EXACT_HYPERVOLUME_DIM
The highest objective count hypervolume computes exactly.

Functions§

constrained_dominates
Feasibility-first dominance (Deb 2000), the relation a constrained multi-objective study ranks by.
crowding_distance
The crowding distance of every member of one front (Deb et al. 2002).
dominates
Direction-aware Pareto dominance: a dominates b iff it is no worse in every objective and strictly better in at least one.
fast_non_dominated_sort
Deb’s fast non-dominated sort: partitions points into fronts, front 0 being the non-dominated (Pareto) set.
hypervolume
The hypervolume indicator: the volume of objective space that points dominate, bounded by reference.
nadir_point
The nadir point of a set of objective vectors: the componentwise worst value observed, in the study’s own orientation.
non_domination_ranks
The non-domination rank of every point: 0 for the Pareto front, 1 for what is left once it is removed, and so on.
pareto_front_indices
The indices of the non-dominated (Pareto) set — front 0 of fast_non_dominated_sort, ascending.