Skip to content

Add OmniOptimizer algorithm#791

Open
blankjul wants to merge 4 commits into
mainfrom
feature/omni-optimizer
Open

Add OmniOptimizer algorithm#791
blankjul wants to merge 4 commits into
mainfrom
feature/omni-optimizer

Conversation

@blankjul

@blankjul blankjul commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Closes #776

Based on @evanroyrees' implementation (commits 77a0340..5d7786e) which was already referencing this issue — credit goes to them for the full paper-faithful design. Porting it in here with omni.py naming and a small cleanup.

What this adds

pymoo/algorithms/moo/omni.py — the Omni-Optimizer (Deb & Tiwari, EJOR 2008), a generic EA that finds and maintains multiple equivalent Pareto-optimal solutions (distinct in decision space, equivalent in objective space). NSGA-II has no variable-space niching and typically collapses to a single Pareto subset.

Three components from the paper

1. LooseDominator — dynamic epsilon-dominance
Per-objective epsilon computed every generation as a configurable fraction (delta) of each objective's range. Solutions closer than delta * epsilon_j in every objective end up in the same front, preventing over-splitting on flat regions.

2. calc_omni_crowding_distance — combined obj + var space crowding
Crowding is computed independently in objective space and decision variable space. For each individual: if it is less crowded than the front average in either space, take the max; otherwise take the min. This rewards solutions that maintain diversity in at least one space.

3. NeighborBasedTournamentSelection — restricted mating
Each tournament pairs a randomly drawn solution with its nearest neighbor in the (normalized) decision space. Restricting recombination to nearby solutions in X-space biases offspring toward the same region, preserving distinct Pareto subsets.

Result on OmniTest (n_var=2, 9 Pareto subsets, pop=100, gen=150)

Algorithm Pareto subsets found IGD
NSGA-II 8 / 9 ~0.005
OmniOptimizer 9 / 9 ~0.005

Files

File Description
pymoo/algorithms/moo/omni.py Algorithm + all components
tests/algorithms/test_omni.py Unit tests per component + algorithm
examples/algorithms/moo/omni.py Basic usage example
examples/algorithms/moo/omni_custom.py Custom operators example

Hey @lea11100 — this is the implementation you requested in #776. Would you mind having a look and testing it against your use case before we merge? Happy to adjust anything.

Implements the Omni-Optimizer (Deb & Tiwari, 2005), a generic EA for
single and multi-objective optimization that maintains diversity in both
objective and decision variable space.

Key components:
- Dynamic epsilon for NDS: epsilon_k = (f_k_max - f_k_min) / (N-1),
  computed per generation to prevent degenerate front splitting
- Combined crowding distance: min(CD_F, CD_X), ensuring spread in both
  objective and variable space simultaneously
- OmniRankAndCrowding survival wired into NSGA-II's binary tournament

The algorithm correctly finds all 9 Pareto-optimal subsets of OmniTest
(n_var=2) where NSGA-II typically misses one or more.

Closes #776
blankjul added 3 commits June 21, 2026 22:31
Based on evanroyrees' implementation (commits 77a0340..5d7786e).

Implements the Omni-Optimizer (Deb & Tiwari, EJOR 2008) with all three
components from the paper:

- LooseDominator: dynamic per-objective epsilon-dominance whose epsilon
  is a configurable fraction (delta) of each objective's range
- calc_omni_crowding_distance: crowding in both objective and variable
  space; takes max when above average in either space, min otherwise
- NeighborBasedTournamentSelection: restricts mating to nearest
  neighbors in decision space to preserve distinct Pareto subsets

Includes unit tests for each component, registration in no-error and
deterministic test suites, and two usage examples.
@blankjul blankjul force-pushed the feature/omni-optimizer branch from 26e55bc to b2cac93 Compare June 21, 2026 22:50
@lea11100

Copy link
Copy Markdown

Looks fine from my perspective. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement Omni-Optimizer

2 participants