domains / science / multi-objective-optimization / pymoo
The K-Dense-AI copy is the most complete and current procedure, but the other copies contain material constraints and steps it lacks. Specifically, the foryourhealth111-pixel copy includes a 'Routing Boundary' section that explicitly excludes the skill from generic optimization, gradient descent, and Bayesian modeling, which is a critical guardrail for an agent. The K-Dense copy also contains specific version-pinning (pymoo 0.6.2) and a more detailed result contract (distinguishing G, H, and CV) that the others omit. Because the K-Dense copy lacks the routing boundary and the others lack the version/result details, crowning one would hide a real alternative or a necessary constraint.
| Repository | Path |
|---|---|
| zLanqing/codex-claude-academic-skills | scientific-toolkit-skill/references/scientific-skills/pymoo/SKILL.md |
| K-Dense-AI/scientific-agent-skills | skills/pymoo/SKILL.md |
| foryourhealth111-pixel/Vibe-Skills | bundled/skills/pymoo/SKILL.md |
| FreedomIntelligence/OpenClaw-Medical-Skills | skills/pymoo/SKILL.md |
| Role | Repository | Path |
|---|---|---|
| peer | zLanqing/codex-claude-academic-skills | scientific-toolkit-skill/references/scientific-skills/pymoo/SKILL.md |
| peer | K-Dense-AI/scientific-agent-skills | skills/pymoo/SKILL.md |
| peer | foryourhealth111-pixel/Vibe-Skills | bundled/skills/pymoo/SKILL.md |
| peer | FreedomIntelligence/OpenClaw-Medical-Skills | skills/pymoo/SKILL.md |
---
name: pymoo
description: Solves and validates single-, multi-, and many-objective optimization with pymoo, including NSGA-II, NSGA-III, MOEA/D, constraints, Pareto approximations, reference directions, and ZDT/DTLZ benchmarks.
license: Apache-2.0
metadata:
skill-author: K-Dense Inc.
---
# Pymoo - Multi-Objective Optimization in Python
## Routing Boundary
Use this skill only for pymoo, NSGA-II/NSGA, Pareto-front analysis, multi-objective optimization, constrained optimization, and pymoo algorithm implementation. Do not use it for generic optimization planning, experiment design, gradient descent, Bayesian modeling, PyMC, or causal analysis.
## 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), and multi-criteria decision making methods.
## Installation
```bash
uv pip install "pymoo==0.6.2"
```
## Core Concepts
### The Unified Interface
Pymoo uses a consistent `minimize()` function for all optimization tasks:
```python
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`: Raw inequality values (`g(x) <= 0` is feasible)
- `result.H`: Raw equality residuals
- `result.CV`: Aggregated constraint violation under the configured tolerances
- `result.algorithm`: Final algorithm state; history is retained when requested
**Check feasibility before plotting or selecting:** If no feasible solution was found, `result.X` and `result.F` can be `None`. With `return_least_infeasible=True`, a returned candidate can still violate constraints; report its `CV` and residuals instead of calling it feasible.
### Problem Definition Styles
- **`Problem`**: Vectorized — `_evaluate` receives a batch of solutions (matrix)
- **`ElementwiseProblem`**: One solution per call — recommended for custom problems and parallel evaluation
- **`FunctionalProblem`**: Define objectives and constraints as separate functions without subclassing
## Quick Start Workflows
### Workflow 1: Single-Objective Optimization
**When:** Optimizing one objective function
**Steps:**
1. Define or select problem
2. Choose single-objective algorithm (GA, DE, PSO, CMA-ES)
3. Configure termination criteria
4. Run optimization
5. Extract best solution
### Workflow 2: Multi-Objective Optimization (2-3 objectives)
**When:** Optimizing 2-3 conflicting objectives, need Pareto front
**Algorithm choice:** NSGA-II (standard for bi/tri-objective)
**Steps:**
1. Define multi-objective problem
2. Configure NSGA-II
3. Run optimization to obtain Pareto front
4. Visualize trade-offs
5. Apply decision making (optional)
### Workflow 3: Many-Objective Optimization (4+ objectives)
**When:** Optimizing 4 or more objectives
**Algorithm choice:** NSGA-III (designed for many objectives)
**Key difference:** Must provide reference directions for population guidance
**Steps:**
1. Define many-objective problem
2. Generate reference directions
3. Configure NSGA-III with reference directions
4. Run optimization
5. Visualize using Parallel Coordinate Plot
### Workflow 4: Custom Problem Definition
**When:** Solving domain-specific optimization problem
**Steps:**
1. Extend `ElementwiseProblem` class
2. Define `__init__` with problem dimensions and bounds
3. Implement `_evaluate` method for objectives (and constraints)
4. Use with any algorithm