pymoo

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

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/littlt-momo-c-yfc/skills --skill pymoo-littlt-momo-c-yfc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymoo
Source: https://github.com/littlt-momo-c-yfc/skills/tree/main/skills/scientific-toolkit-skill/references/scientific-skills/pymoo
Command: npx skills add https://github.com/littlt-momo-c-yfc/skills --skill pymoo-littlt-momo-c-yfc

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Finding optimal trade-offs between conflicting objectives—such as cost versus performance in engineering design—requires specialized algorithms and careful handling of constraints, Pareto fronts, and decision making, which is difficult to implement from scratch. ## Core Features & Use Cases - Multi-Objective Optimization: Run NSGA-II, NSGA-III, MOEA/D, and other evolutionary algorithms to compute Pareto fronts for 2 to 15+ objectives. - Constraint Handling & Decision Making: Apply feasibility-first, penalty, or constraint-as-objective strategies, then select preferred solutions using pseudo-weights, compromise programming, or knee-point detection. - Benchmarks & Visualization: Test algorithms on ZDT, DTLZ, and WFG problems and visualize results with scatter plots, parallel coordinate plots, and petal diagrams. - Use Case: An engineer optimizing a structural design for both weight and strength can define a custom constrained problem, run NSGA-II to obtain the Pareto front, and use pseudo-weights to pick the design matching project priorities. ## Quick Start Use the pymoo skill to solve a bi-objective ZDT1 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 solve a multi-objective optimization problem in Python?

Use pymoo's minimize function with a problem definition and an algorithm like NSGA-II. The result object contains the Pareto-optimal decision variables in result.X and objective values in result.F, which you can visualize with a scatter plot.

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

Use NSGA-II for problems with 2-3 objectives, as it is fast and well-tested. Use NSGA-III for 4 or more objectives, since its reference-direction mechanism maintains uniform Pareto front coverage in high-dimensional objective spaces.

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

Extend the ElementwiseProblem class, set n_var, n_obj, n_ieq_constr, and bounds in __init__, then implement _evaluate to return objectives in out["F"] and constraints in out["G"]. Inequality constraints must be formulated as g(x) <= 0.

Does pymoo support constrained optimization?

Yes, pymoo handles constraints through feasibility-first selection by default, penalty methods, constraint-as-objective conversion, and specialized algorithms like SRES and ISRES for heavily constrained problems. Custom repair operators are also supported.

Why is my Pareto front poorly distributed in pymoo?

Poor distribution often results from insufficient population size, too few generations, or missing duplicate elimination. For NSGA-III, verify that reference directions match the objective count and consider increasing partitions for denser coverage.

How do I select one solution from a Pareto front?

Normalize the objective values to [0, 1], then apply a multi-criteria decision making method such as PseudoWeights with your preference weights, compromise programming toward an ideal point, or knee-point detection for balanced trade-offs.