
Pymoo
Pick and configure pymoo evolutionary and swarm optimizers (GA, DE, PSO, CMA-ES) when tuning continuous, discrete, or multi-objective parameters in scientific or backend code.
Overview
Pymoo is an agent skill for the Build phase that documents pymoo single-objective optimizers—GA, DE, PSO, and CMA-ES—with parameters and Python usage for scientific and backend tuning jobs.
Install
npx skills add https://github.com/k-dense-ai/scientific-agent-skills --skill pymooWhat is this skill?
- Reference for single-objective algorithms: Genetic Algorithm (GA), Differential Evolution (DE), Particle Swarm Optimizat
- Documented GA defaults including pop_size 100, SBX crossover, polynomial mutation, eliminate_duplicates True
- Algorithm selection guidance: GA for general mixed problems, DE for continuous global search, PSO for smooth landscapes,
- Import-ready Python snippets such as GA from pymoo.algorithms.soo.nonconvex.ga
- Covers nonconvex single-objective family patterns used in scientific agent workflows
- GA default pop_size documented as 100
- Reference covers at least four single-objective families: GA, DE, PSO, CMA-ES
Adoption & trust: 529 installs on skills.sh; 27.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to optimize continuous or mixed variables but do not know which pymoo algorithm or default hyperparameters fit your landscape.
Who is it for?
Developers and researchers implementing parameter sweeps, engineering design optimization, or ML hyperparameter search with pymoo in Python.
Skip if: Teams needing a no-code optimizer UI, convex-only solvers like pure linear programming, or workflows with zero Python scientific stack.
When should I use this skill?
Choosing or configuring pymoo optimization algorithms for single-objective continuous, discrete, or mixed problems in Python.
What do I get? / Deliverables
You select a documented pymoo algorithm with sensible defaults and starter code to plug into your fitness function and evaluation loop.
- Chosen pymoo algorithm module import and constructor configuration
- Documented parameter set aligned to problem type (continuous vs mixed)
- Starter integration pattern linking sampling, crossover, and mutation operators for GA-style runs
Recommended Skills
Journey fit
Backend build is where optimization algorithms are selected, parameterized, and wired into experiments, simulators, or batch jobs—not launch or growth work. Backend covers numerical libraries and solver integration that agents reference while implementing fitness functions and algorithm loops.
How it compares
In-repo algorithm cheat sheet for pymoo—not a generic “write unit tests” skill or an external optimization SaaS integration.
Common Questions / FAQ
Who is pymoo for?
Solo builders and small teams writing Python backends or experiments who want agent-guided pymoo algorithm selection and parameter defaults.
When should I use pymoo?
Use during build backend when integrating evolutionary or swarm optimization into simulators, pipelines, or API-side batch jobs that evaluate fitness in code.
Is pymoo safe to install?
The skill is documentation referencing library imports; confirm dependency trust and review the Security Audits panel on this page for the parent scientific-agent-skills package.
SKILL.md
READMESKILL.md - Pymoo
# Pymoo Algorithms Reference Comprehensive reference for optimization algorithms available in pymoo. ## Single-Objective Optimization Algorithms ### Genetic Algorithm (GA) **Purpose:** General-purpose single-objective evolutionary optimization **Best for:** Continuous, discrete, or mixed-variable problems **Algorithm type:** (μ+λ) genetic algorithm **Key parameters:** - `pop_size`: Population size (default: 100) - `sampling`: Initial population generation strategy - `selection`: Parent selection mechanism (default: Tournament) - `crossover`: Recombination operator (default: SBX) - `mutation`: Variation operator (default: Polynomial) - `eliminate_duplicates`: Remove redundant solutions (default: True) - `n_offsprings`: Offspring per generation **Usage:** ```python from pymoo.algorithms.soo.nonconvex.ga import GA algorithm = GA(pop_size=100, eliminate_duplicates=True) ``` ### Differential Evolution (DE) **Purpose:** Single-objective continuous optimization **Best for:** Continuous parameter optimization with good global search **Algorithm type:** Population-based differential evolution **Variants:** Multiple DE strategies available (rand/1/bin, best/1/bin, etc.) ### Particle Swarm Optimization (PSO) **Purpose:** Single-objective optimization through swarm intelligence **Best for:** Continuous problems, fast convergence on smooth landscapes ### CMA-ES **Purpose:** Covariance Matrix Adaptation Evolution Strategy **Best for:** Continuous optimization, particularly for noisy or ill-conditioned problems ### Pattern Search **Purpose:** Direct search method **Best for:** Problems where gradient information is unavailable ### Nelder-Mead **Purpose:** Simplex-based optimization **Best for:** Local optimization of continuous functions ### MixedVariableGA **Purpose:** Single-objective optimization with mixed variable types **Best for:** Problems with continuous, integer, binary, and categorical variables **Usage:** ```python from pymoo.core.mixed import MixedVariableGA from pymoo.core.variable import Real, Integer, Choice, Binary # Define problem with vars dict (see mixed-variable docs) algorithm = MixedVariableGA(pop_size=20) ``` For multi-objective mixed-variable problems, pass a survival operator: ```python from pymoo.algorithms.moo.nsga2 import RankAndCrowdingSurvival algorithm = MixedVariableGA(pop_size=20, survival=RankAndCrowdingSurvival()) ``` ### Optuna (Mixed-Variable SOO) **Purpose:** Single-objective mixed-variable search via Optuna wrapper **Best for:** Hyperparameter-style mixed search when Optuna's TPE/samplers are preferred **Usage:** ```python from pymoo.algorithms.soo.nonconvex.optuna import Optuna algorithm = Optuna() ``` Requires Optuna installed separately: `uv pip install optuna` ## Multi-Objective Optimization Algorithms ### NSGA-II (Non-dominated Sorting Genetic Algorithm II) **Purpose:** Multi-objective optimization with 2-3 objectives **Best for:** Bi- and tri-objective problems requiring well-distributed Pareto fronts **Selection strategy:** Non-dominated sorting + crowding distance **Key features:** - Fast non-dominated sorting - Crowding distance for diversity - Elitist approach - Binary tournament mating selection **Key parameters:** - `pop_size`: Population size (default: 100) - `sampling`: Initial population strategy - `crossover`: Default SBX for continuous - `mutation`: Default Polynomial Mutation - `survival`: RankAndCrowding **Usage:** ```python from pymoo.algorithms.moo.nsga2 import NSGA2 algorithm = NSGA2(pop_size=100) ``` **When to use:** - 2-3 objectives - Need for distributed solutions across Pareto front - Standard multi-objective benchmark ### SPEA2 (Strength Pareto Evolutionary Algorithm 2) **Purpose:** Multi-objective optimization with external archive **Best for:** Bi- and tri-objective problems; alternative to NSGA-II when archive-based selection is preferred **Selection strategy:** Strength-based fitness + k-nearest-neighbor density estimation **Key features:** - Ext