Chuyển đến nội dung
Skillpedia
Học máy51k · #3544

pymoo

Skill này làm gì

Đây là công cụ tìm giải pháp tốt nhất cho các bài toán phức tạp có nhiều mục tiêu, có thể mâu thuẫn với nhau. Nó giúp tìm ra những sự đánh đổi (trade-off) tốt nhất có thể.

Khi nào nên dùng

  • ✓Khi bạn có một bài toán với nhiều mục tiêu cần tối ưu cùng lúc.
  • ✓Khi cần tìm sự cân bằng tốt nhất giữa các mục tiêu cạnh tranh.
  • ✓Khi phân tích nhiều phương án khác nhau để đưa ra quyết định sáng suốt.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pymoo/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn tối ưu thiết kế xe hơi để tiêu hao nhiên liệu thấp nhất và chi phí sản xuất thấp nhất. Những phương án tốt nhất là gì?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn định nghĩa bài toán, chọn một phương pháp tối ưu (như NSGA-II), và công cụ sẽ tìm các giải pháp tốt nhất. Nó trả về các giải pháp tìm được cùng kết quả của chúng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

…

Câu hỏi thường gặp

Giải pháp đánh đổi (trade-off) là gì?

Đó là giải pháp cân bằng tốt giữa các mục tiêu mâu thuẫn. Ví dụ, một chiếc xe có thể không tiêu hao nhiên liệu thấp nhất tuyệt đối, nhưng là sự thỏa hiệp tốt giữa quãng đường đi được và chi phí.

Mặt Pareto (Pareto front) là gì?

Đó là tập hợp các giải pháp mà không thể cải thiện một mục tiêu nếu không làm xấu đi mục tiêu khác. Nó thể hiện tất cả các sự đánh đổi tốt nhất có thể.

Công cụ này có thể giải những loại bài toán nào?

Nó có thể giải bài toán có một hoặc nhiều mục tiêu, có hoặc không có ràng buộc, và cả bài toán với các kiểu biến khác nhau (số nguyên, nhị phân, v.v.).

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3544
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự