pymoo

Solve single and multi-objective optimization problems in Python using evolutionary algorithms.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/ricfulop/cba-agentic-engineering-bootstrap --skill pymoo-ricfulop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymoo
Source: https://github.com/ricfulop/cba-agentic-engineering-bootstrap/tree/main/skills/pymoo
Command: npx skills add https://github.com/ricfulop/cba-agentic-engineering-bootstrap --skill pymoo-ricfulop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymoo, numpy, matplotlib, and includes scripts (resource) and references (resource) components.

What problem does it solve? Engineering and design problems often involve conflicting objectives (cost vs. performance, weight vs. strength) with no single best answer. This Skill provides structured workflows for defining optimization problems, running evolutionary algorithms, and selecting trade-off solutions from Pareto fronts using the pymoo Python framework. ## Core Features & Use Cases - Multi-Objective Optimization: Run NSGA-II, NSGA-III, MOEA/D, and SPEA2 to compute Pareto fronts for problems with 2 to 15+ conflicting objectives. - Constraint Handling & Decision Making: Apply feasibility-first, penalty, or constraint-as-objective strategies, then select preferred solutions with MCDM methods like Pseudo-Weights and knee-point detection. - Benchmarks & Visualization: Test algorithms on ZDT, DTLZ, and WFG benchmark suites and visualize results with scatter plots, parallel coordinate plots, and petal diagrams. - Use Case: An engineer optimizing a structural design for minimum weight and maximum stiffness can define a custom ElementwiseProblem, run NSGA-II, visualize the Pareto front, and pick a balanced design using pseudo-weights. ## Quick Start Use the pymoo skill to solve a bi-objective optimization problem with NSGA-II and plot the resulting Pareto front.

Frequently Asked Questions about pymoo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run multi-objective optimization with NSGA-II in Python?

Install pymoo, define or load a problem with get_problem, configure NSGA2 with a population size, and call minimize with a termination criterion. The result object contains Pareto-optimal decision variables in result.X and objective values in result.F.

NSGA-II vs NSGA-III: which algorithm should I use?

Use NSGA-II for problems with 2-3 objectives where crowding-distance diversity works well. Use NSGA-III for 4 or more objectives, since it maintains uniform coverage through reference directions generated with get_reference_directions.

How do I define a custom constrained optimization problem in pymoo?

Subclass ElementwiseProblem, set n_var, n_obj, n_ieq_constr, and bounds in __init__, then implement _evaluate to fill out["F"] with objectives and out["G"] with inequality constraints formulated as g(x) <= 0. Equality constraints go in out["H"] as h(x) = 0.

Does pymoo support parallel evaluation of expensive objective functions?

Yes, pymoo supports parallel evaluation for ElementwiseProblem via an elementwise_runner. Use StarmapParallelization with a thread or process pool, or JoblibParallelization with joblib, passing the runner to the problem constructor.

Why is my pymoo algorithm not converging to the Pareto front?

Common causes include insufficient population size or generations, incorrect constraint formulation, and multimodal landscapes. Increase pop_size and generations, verify constraints use g(x) <= 0 form, enable eliminate_duplicates, and compare against the true Pareto front when available.

Can pymoo handle mixed integer, binary, and continuous variables?

Yes, define a vars dict using Real, Integer, Binary, and Choice variable types in an ElementwiseProblem, then optimize with MixedVariableGA. For multi-objective mixed problems, pass RankAndCrowdingSurvival as the survival operator.