Pymoo - Multi-Objective Optimization in Python
Overview
Pymoo is a comprehensive Python framework for optimization with emphasis on multi-objective problems. Solve single and multi-objective optimization using state-of-the-art algorithms (NSGA-II/III, MOEA/D), benchmark problems (ZDT, DTLZ), customizable genetic operators, and multi-criteria decision making methods. Excels at finding trade-off solutions (Pareto fronts) for problems with conflicting objectives.
When to Use This Skill
This skill should be used when:
- Solving optimization problems with one or multiple objectives
- Finding Pareto-optimal solutions and analyzing trade-offs
- Implementing evolutionary algorithms (GA, DE, PSO, NSGA-II/III)
- Working with constrained optimization problems
- Benchmarking algorithms on standard test problems (ZDT, DTLZ, WFG)
- Customizing genetic operators (crossover, mutation, selection)
- Visualizing high-dimensional optimization results
- Making decisions from multiple competing solutions
- Handling binary, discrete, continuous, or mixed-variable problems
Does NOT Trigger
| Scenario |
Use Instead |
| Simulating queues or shared resources over time (discrete-event simulation) |
alterlab-simpy |
| Hyperparameter search for a machine-learning model (grid/random search, CV) |
alterlab-scikit-learn |
| Closed-form optimum of a formula via derivatives or symbolic solving |
alterlab-sympy |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-simpy) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Core Concepts
The Unified Interface
Pymoo uses a consistent minimize() function for all optimization tasks:
from pymoo.optimize import minimize
result = minimize(
problem, # What to optimize
algorithm, # How to optimize
termination, # When to stop
seed=1,
verbose=True
)
Result object contains:
result.X: Decision variables of optimal solution(s)
result.F: Objective values of optimal solution(s)
result.G: Constraint violations (if constrained)
result.algorithm: Algorithm object with history
Problem Types
Single-objective: One objective to minimize/maximize
Multi-objective: 2-3 conflicting objectives → Pareto front
Many-objective: 4+ objectives → High-dimensional Pareto front
Constrained: Objectives + inequality/equality constraints
Dynamic: Time-varying objectives or constraints
Core Workflow
- Pick problem type — single, multi (2-3 obj), many (4+ obj), or constrained.
- Define or select the problem — built-in via
get_problem(...), or subclass ElementwiseProblem for custom (objectives in out["F"], inequality constraints g(x) <= 0 in out["G"], equality h(x) = 0 in out["H"]).
- Choose the algorithm — NSGA-II for 2-3 objectives, NSGA-III (with reference directions) for 4+, GA/DE/PSO/CMA-ES for single-objective. See the selection tables in
references/quick_reference.md.
- Set termination —
('n_gen', N), ('n_evals', N), or tolerance-based get_termination("moo", ftol=1e-3, n_max_gen=500) ("soo" for single-objective; there is no "f_tol" key).
- Run with
minimize(problem, algorithm, termination, seed=1, verbose=True).
- Inspect
result.X / result.F / result.G (or result.CV for constraint violation).
- Decide & visualize — apply MCDM to pick a preferred Pareto solution, plot with
Scatter/PCP/Petal.
Always set seed for reproducibility, normalize objectives when scales differ, and provide reference directions for NSGA-III.
Routing — where to look
| You need… |
Go to |
| Complete copy-paste examples for all 7 workflows (single/multi/many-objective, custom problems, constraint handling, MCDM decision making, visualization) |
references/workflows.md |
| Algorithm-selection tables, benchmark problem list, operator config, troubleshooting, best practices, install |
references/quick_reference.md |
| Deep algorithm reference (parameters, usage, selection) |
references/algorithms.md |
| Benchmark test problems (ZDT, DTLZ, WFG) with characteristics |
references/problems.md |
| Genetic operators (sampling, selection, crossover, mutation) |
references/operators.md |
| All visualization types with examples |
references/visualization.md |
| Constraint handling + multi-criteria decision making |
references/constraints_mcdm.md |
Runnable scripts (scripts/): single_objective_example.py, multi_objective_example.py, many_objective_example.py, custom_problem_example.py, decision_making_example.py. Run with uv run python scripts/<name>.py.
Search references: grep -r "NSGA-II\|NSGA-III\|MOEA/D" references/ · grep -r "Feasibility First\|Penalty\|Repair" references/ · grep -r "Scatter\|PCP\|Petal" references/
Install
uv run --python ">=3.12" --with "pymoo>=0.6.1" python scripts/multi_objective_example.py # no install step
Dependencies (installed automatically): NumPy, SciPy, matplotlib, autograd, cma, moocore. Docs: https://pymoo.org/ — this skill targets pymoo 0.6.x (current 0.6.2, June 2026, which restored CMA-ES under NumPy 2).
1---2name: alterlab-pymoo3description: Multi-objective optimization with pymoo — NSGA-II, NSGA-III, MOEA/D, Pareto-front computation, constraint handling, and standard benchmarks (ZDT, DTLZ). Use when solving multi-objective or constrained optimization problems, computing Pareto-optimal trade-offs, or tackling engineering design problems with competing objectives. Part of the AlterLab Academic Skills suite.4license: Apache-2.05allowed-tools: Read Write Edit Bash(python:*) Bash(uv:*)6compatibility: No API key required. Runs locally via `uv run --python ">=3.12" --with "pymoo>=0.6.1" python script.py` (no install step; the interpreter pin matters because an older default Python resolves older releases); requires pymoo 0.6.x (current 0.6.2 as of 2026-09).7metadata:8 source: https://skillmd.com/skills/alterlab-ieu/alterlab-pymoo9 skill-author: AlterLab10 version: "1.0.1"11 last_updated: "2026-09-23"12---1314# Pymoo - Multi-Objective Optimization in Python1516## Overview1718Pymoo is a comprehensive Python framework for optimization with emphasis on multi-objective problems. Solve single and multi-objective optimization using state-of-the-art algorithms (NSGA-II/III, MOEA/D), benchmark problems (ZDT, DTLZ), customizable genetic operators, and multi-criteria decision making methods. Excels at finding trade-off solutions (Pareto fronts) for problems with conflicting objectives.1920## When to Use This Skill2122This skill should be used when:23- Solving optimization problems with one or multiple objectives24- Finding Pareto-optimal solutions and analyzing trade-offs25- Implementing evolutionary algorithms (GA, DE, PSO, NSGA-II/III)26- Working with constrained optimization problems27- Benchmarking algorithms on standard test problems (ZDT, DTLZ, WFG)28- Customizing genetic operators (crossover, mutation, selection)29- Visualizing high-dimensional optimization results30- Making decisions from multiple competing solutions31- Handling binary, discrete, continuous, or mixed-variable problems3233### Does NOT Trigger3435| Scenario | Use Instead |36|----------|-------------|37| Simulating queues or shared resources over time (discrete-event simulation) | `alterlab-simpy` |38| Hyperparameter search for a machine-learning model (grid/random search, CV) | `alterlab-scikit-learn` |39| Closed-form optimum of a formula via derivatives or symbolic solving | `alterlab-sympy` |4041**Hand-off rule.** When the request matches a row above, open your answer by naming that skill by its exact id (for example `alterlab-simpy`) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.4243## Core Concepts4445### The Unified Interface4647Pymoo uses a consistent `minimize()` function for all optimization tasks:4849```python50from pymoo.optimize import minimize5152result = minimize(53 problem, # What to optimize54 algorithm, # How to optimize55 termination, # When to stop56 seed=1,57 verbose=True58)59```6061**Result object contains:**62- `result.X`: Decision variables of optimal solution(s)63- `result.F`: Objective values of optimal solution(s)64- `result.G`: Constraint violations (if constrained)65- `result.algorithm`: Algorithm object with history6667### Problem Types6869**Single-objective:** One objective to minimize/maximize70**Multi-objective:** 2-3 conflicting objectives → Pareto front71**Many-objective:** 4+ objectives → High-dimensional Pareto front72**Constrained:** Objectives + inequality/equality constraints73**Dynamic:** Time-varying objectives or constraints7475## Core Workflow76771. **Pick problem type** — single, multi (2-3 obj), many (4+ obj), or constrained.782. **Define or select the problem** — built-in via `get_problem(...)`, or subclass `ElementwiseProblem` for custom (objectives in `out["F"]`, inequality constraints `g(x) <= 0` in `out["G"]`, equality `h(x) = 0` in `out["H"]`).793. **Choose the algorithm** — NSGA-II for 2-3 objectives, NSGA-III (with reference directions) for 4+, GA/DE/PSO/CMA-ES for single-objective. See the selection tables in `references/quick_reference.md`.804. **Set termination** — `('n_gen', N)`, `('n_evals', N)`, or tolerance-based `get_termination("moo", ftol=1e-3, n_max_gen=500)` (`"soo"` for single-objective; there is no `"f_tol"` key).815. **Run** with `minimize(problem, algorithm, termination, seed=1, verbose=True)`.826. **Inspect** `result.X` / `result.F` / `result.G` (or `result.CV` for constraint violation).837. **Decide & visualize** — apply MCDM to pick a preferred Pareto solution, plot with `Scatter`/`PCP`/`Petal`.8485Always set `seed` for reproducibility, normalize objectives when scales differ, and provide reference directions for NSGA-III.8687## Routing — where to look8889| You need… | Go to |90|-----------|-------|91| Complete copy-paste examples for all 7 workflows (single/multi/many-objective, custom problems, constraint handling, MCDM decision making, visualization) | `references/workflows.md` |92| Algorithm-selection tables, benchmark problem list, operator config, troubleshooting, best practices, install | `references/quick_reference.md` |93| Deep algorithm reference (parameters, usage, selection) | `references/algorithms.md` |94| Benchmark test problems (ZDT, DTLZ, WFG) with characteristics | `references/problems.md` |95| Genetic operators (sampling, selection, crossover, mutation) | `references/operators.md` |96| All visualization types with examples | `references/visualization.md` |97| Constraint handling + multi-criteria decision making | `references/constraints_mcdm.md` |9899**Runnable scripts** (`scripts/`): `single_objective_example.py`, `multi_objective_example.py`, `many_objective_example.py`, `custom_problem_example.py`, `decision_making_example.py`. Run with `uv run python scripts/<name>.py`.100101**Search references:** `grep -r "NSGA-II\|NSGA-III\|MOEA/D" references/` · `grep -r "Feasibility First\|Penalty\|Repair" references/` · `grep -r "Scatter\|PCP\|Petal" references/`102103## Install104105```bash106uv run --python ">=3.12" --with "pymoo>=0.6.1" python scripts/multi_objective_example.py # no install step107```108109Dependencies (installed automatically): NumPy, SciPy, matplotlib, autograd, cma, moocore. Docs: https://pymoo.org/ — this skill targets pymoo 0.6.x (current 0.6.2, June 2026, which restored CMA-ES under NumPy 2).110