GEPA.Utils.Pareto (GEPA v0.3.0)

Copy Markdown View Source

Pareto-front utilities used for candidate selection and merge parent choice.

The domination algorithm follows the official Python GEPA utility: a program is dominated when, for every Pareto front that contains it, another active program also appears on that front. Programs absent from every front are considered dominated/irrelevant.

Summary

Functions

find_dominator_programs(fronts, scores)

@spec find_dominator_programs(GEPA.Types.pareto_fronts(), %{
  required(GEPA.Types.program_idx()) => float()
}) :: [GEPA.Types.program_idx()]

get_all_programs(fronts)

@spec get_all_programs(GEPA.Types.pareto_fronts()) :: [GEPA.Types.program_idx()]

is_dominated?(program, other_programs, fronts)

remove_dominated_programs(fronts, scores)

@spec remove_dominated_programs(GEPA.Types.pareto_fronts(), %{
  required(GEPA.Types.program_idx()) => float()
}) :: GEPA.Types.pareto_fronts()

select_from_pareto_front(fronts, scores, rand_state)

@spec select_from_pareto_front(
  GEPA.Types.pareto_fronts(),
  %{required(GEPA.Types.program_idx()) => float()},
  :rand.state()
) :: {GEPA.Types.program_idx(), :rand.state()}