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.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
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) <= 0is feasible)result.H: Raw equality residualsresult.CV: Aggregated constraint violation under the configured tolerancesresult.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 —_evaluatereceives a batch of solutions (matrix)ElementwiseProblem: One solution per call — recommended for custom problems and parallel evaluationFunctionalProblem: 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.
Độ 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
Bình luận
- …
Thêm skill từ kho mã này
13c-metabolic-flux
51kƯớc tính thông lượng chuyển hóa bằng dữ liệu theo dõi đồng vị carbon-13. Hữu ích để phân tích chuyển hóa tế bào và các con đường sinh hóa.
adaptyv
51kThiết kế thí nghiệm đặc trưng protein bằng Adaptyv API. Hỗ trợ ước tính chi phí, gửi trình tự và theo dõi kết quả phòng thí nghiệm.
aeon
51kThực hiện các tác vụ học máy trên dữ liệu chuỗi thời gian. Hữu ích để phân loại, dự báo, phát hiện bất thường và tìm mẫu trong dữ liệu tuần tự.
alphagenome
51kTra cứu các tác động di truyền đã được tính trước cho biến thể gen. Cung cấp điểm số và giải thích để hiểu ảnh hưởng của biến thể lên bộ gen.
Skill tương tự
pytorch-patterns
280kGiúp agent của bạn dùng PyTorch cho các mô hình học máy. Áp dụng thực hành tốt nhất để huấn luyện mô hình hiệu quả và đảm bảo kết quả có thể lặp lại.
evm-token-decimals
280kGiúp agent tránh lỗi về số thập phân khi làm việc với các mạng blockchain khác nhau. Đảm bảo giá trị token chính xác trong giao dịch và phép tính.
ito-inference
280kGiúp agent kiểm tra xem các mô hình AI đã sẵn sàng để dùng chưa. Kết nối yêu cầu tài nguyên tính toán với dịch vụ mô hình đã sẵn sàng.