saealib.ParetoDominator#

class saealib.ParetoDominator[source]#

Bases: Dominator

Pareto dominance predicate.

fa dominates fb iff fa is at most as large as fb in all objectives and strictly smaller in at least one (after applying the direction transform).

This is the default dominance relation used throughout the library.

Methods

__init__

dominance_matrix

Compute the NxN Pareto-dominance matrix.

dominates

Return True if fa dominates fb.

dominates_many

Compute one-vs-many Pareto dominance via a single O(n) broadcast.

Method Details

ParetoDominator.__init__()#
ParetoDominator.dominance_matrix(f, direction=None)[source]#

Compute the NxN Pareto-dominance matrix.

Applies the f * (-direction) transform so that smaller is always better, then accumulates per-objective leq_all / less_any comparisons. Peak memory is O(N²); no (N, N, M) tensor is created.

Parameters:
  • f (np.ndarray) – Objective matrix. shape: (n, n_obj). Must contain no NaN values.

  • direction (np.ndarray or None) – Per-objective direction. None → minimize all.

Returns:

Boolean matrix of shape (n, n). D[i, j] = True iff row i Pareto-dominates row j.

Return type:

np.ndarray

ParetoDominator.dominates(fa, fb, direction=None)#

Return True if fa dominates fb.

Derived from dominates_many with a single-row objective matrix. NaN values in fa always return False. NaN values in fb are treated as infinitely bad.

Parameters:
  • fa (np.ndarray) – Objective vectors. shape: (n_obj,)

  • fb (np.ndarray) – Objective vectors. shape: (n_obj,)

  • direction (np.ndarray or None) – Per-objective direction. None → minimize all.

Return type:

bool

ParetoDominator.dominates_many(fa, f_matrix, direction=None)[source]#

Compute one-vs-many Pareto dominance via a single O(n) broadcast.

Parameters:
  • fa (np.ndarray) – shape: (n_obj,)

  • f_matrix (np.ndarray) – shape: (n, n_obj). Must contain no NaN values.

  • direction (np.ndarray or None) – Per-objective direction. None -> minimize all.

Returns:

(fa_dominates, dominates_fa), each shape (n,).

Return type:

tuple[np.ndarray, np.ndarray]