本文へスキップ
Skillpedia
機械学習51k · #3544

pymoo

できること

複数の目標が同時に存在し、それらが互いに衝突することもある複雑な問題について、最適な解を見つけるためのツールです。最も良い「トレードオフ」を見つけるのに役立ちます。

使う場面

  • ✓同時に最適化すべき複数の目標がある問題に取り組むとき。
  • ✓互いに競合する目標の間で、最適なバランスを見つけたいとき。
  • ✓複数の選択肢を分析して、根拠のある判断をしたいとき。

スキルのリンク

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pymoo/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pymoo/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“燃費が最も良く、製造コストも最も安い自動車設計を最適化したいです。最良の選択肢は何ですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

まず問題を定義し、NSGA-IIなどの最適化手法を選びます。するとツールが最適な解を探索し、見つかった解とその結果を返します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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, SPEA2), 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. Targets stable pymoo 0.6.2, reviewed 2026-10-01 against current official docs and native toy runs.

Installation

uv pip install "pymoo==0.6.2"

For reproducible environments, pin a version: uv pip install "pymoo==0.6.2".

Dependencies: The released 0.6.2 wheel requires NumPy, SciPy, moocore, autograd, cma, matplotlib, alive_progress, and Deprecated. NumPy 2.x is supported. The current installation prose describes some dependencies as optional; the released package metadata governs installation. Joblib, Optuna and dill are separate dependencies for the corresponding recipes.

Documentation: https://pymoo.org/ — LLM-friendly index: https://pymoo.org/llms.txt

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

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: 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. Re-evaluate chosen candidates against the original physical constraints after any normalization or repair. See the result contract.

Problem Definition Styles

Pymoo supports three 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

Problem Types

Single-objective: One objective to minimize; negate a maximization objective and record the conversion Multi-objective: 2-3 conflicting objectives → Pareto front Many-objective: 4+ objectives → High-dimensional Pareto front Constrained: Objectives + inequality/equality constraints Mixed-variable: Continuous, integer, binary, and categorical variables in one problem Dynamic: Time-varying objectives or constraints

Quick Start Workflows

Nine workflows and context-dependent adaptation snippets are in references/quick_start_workflows.md:

# Workflow Use when
1 Single-objective optimization one objective, GA or DE
2 Multi-objective (2-3 objectives) NSGA-II and a Pareto front
3 Many-objective (4+ objectives) NSGA-III or reference-direction methods
4 Custom problem definition subclassing Problem / ElementwiseProblem
5 Constraint handling inequality and equality constraints
6 Decision making from a Pareto front scalarization and MCDM selection

…

よくある質問

「トレードオフの解」とは何ですか?

互いに競合する目標の間で、良いバランスを実現する解のことです。たとえば、自動車は燃費が最良ではなくても、燃費と価格のバランスが良い場合があります。

「パレートフロント(Pareto front)」とは何ですか?

ある目標を改善すると別の目標が必ず悪化してしまう、解の集合のことです。考えうる最良のトレードオフをすべて表します。

このツールでどのような問題を解けますか?

目標が1つのものや複数のもの、制約がある・ない問題、さらに整数や二値などさまざまな種類の変数を扱う問題を解けます。

詳細

作者による元の説明

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 for engineering and research problems.

repo: K-Dense-AI/scientific-agent-skills

人気

GitHubのスター
51k
ランキング
#3544
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル