scientific-skills/pymoo/references/problems.md
Comprehensive reference for benchmark optimization problems in pymoo.
Characteristics:
Characteristics:
Characteristics:
Characteristics:
Characteristics:
Purpose: Standard benchmark for bi-objective optimization Construction: f₂(x) = g(x) · h(f₁(x), g(x)) where g(x) = 1 at Pareto-optimal solutions
Usage:
from pymoo.problems.multi import ZDT1, ZDT2, ZDT3, ZDT4, ZDT5, ZDT6
problem = ZDT1() # or ZDT2(), ZDT3(), etc.
Characteristics:
Characteristics:
Characteristics:
Characteristics:
Characteristics:
Characteristics:
Characteristics:
Purpose: Scalable many-objective benchmarks Objectives: Configurable (typically 3-15) Variables: Scalable
Usage:
from pymoo.problems.many import DTLZ1, DTLZ2
problem = DTLZ1(n_var=7, n_obj=3) # 7 variables, 3 objectives
Purpose: Walking Fish Group scalable benchmarks Features: More complex than DTLZ, various front shapes and difficulties
Variants: WFG1-WFG9 with different characteristics
Purpose: Multi-objective problems with various constraint types Features: Different constraint difficulty levels
Purpose: Difficulty-adjustable and scalable constrained multi-objective problems Features: Tunable constraint difficulty
Purpose: Multi-objective optimization with active constraints Features: Realistic constraint scenarios
Purpose: CEC2018 Competition dynamic multi-objective benchmarks Features:
Variants: DF1-DF14 with different dynamics
Define custom problems by extending base classes:
from pymoo.core.problem import ElementwiseProblem
import numpy as np
class MyProblem(ElementwiseProblem):
def __init__(self):
super().__init__(
n_var=2, # number of variables
n_obj=2, # number of objectives
n_ieq_constr=0, # inequality constraints
n_eq_constr=0, # equality constraints
xl=np.array([0, 0]), # lower bounds
xu=np.array([1, 1]) # upper bounds
)
def _evaluate(self, x, out, *args, **kwargs):
# Define objectives
f1 = x[0]**2 + x[1]**2
f2 = (x[0]-1)**2 + x[1]**2
out["F"] = [f1, f2]
# Optional: constraints
# out["G"] = constraint_values # <= 0
# out["H"] = equality_constraints # == 0
For algorithm development:
For comprehensive testing:
For real-world validation:
Variable types: