Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Defines and solves single- and multi-objective optimization problems with pymoo evolutionary algorithms like NSGA-II, NSGA-III, and MOEA/D.
70% 100%+30 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 16 of 23 without it.
3 of 3 safety checks passed
Not used yet
pymoo provides a unified API for multi-objective optimization via population-based evolutionary algorithms. Users define a problem by subclassing Problem or ElementwiseProblem, specifying objectives (n_obj), decision variables (n_var), and optional constraints (n_ieq_constr). Algorithms like NSGA-II and NSGA-III return a Result object containing the Pareto-optimal population, objective values, and decision variable values. pymoo separates problem definition, algorithm configuration, operator selection, and analysis — each component is independently replaceable.
scipy.optimize instead for single-objective, gradient-available, smooth optimizationpymoo, numpy, matplotlibpip install pymoo numpy matplotlib
import numpy as np
from pymoo.core.problem import Problem
from pymoo.algorithms.moo.nsga2 import NSGA2
from pymoo.optimize import minimize
class SimpleBiObjective(Problem):
def __init__(self):
super().__init__(n_var=2, n_obj=2, xl=np.array([-2, -2]), xu=np.array([2, 2]))
def _evaluate(self, X, out, *args, **kwargs):
f1 = X[:, 0] ** 2 + X[:, 1] ** 2
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.