Abstract
Sampler using MOEA/D algorithm. MOEA/D stands for “Multi-Objective Evolutionary Algorithm based on Decomposition.
This sampler is specialized for multiobjective optimization. The objective function is internally decomposed into multiple single-objective subproblems to perform optimization.
It may not work well with multi-threading. Check results carefully.
APIs
MOEADSampler(*, population_size = 100, n_neighbors = None, scalar_aggregation_func = "tchebycheff", mutation = None, mutation_prob = None, crossover = None, crossover_prob = 0.9, seed = None
n_neighbors
: The number of the weight vectors in the neighborhood of each weight vector. The larger this value, the more weight is applied to the exploration.- If None,
population_size // 10
is used
- If None,
scalar_aggregation_func
: The scalar aggregation function to use. The default istchebycheff
. Other options isweight_sum
.mutation
: Mutation to be applied when creating child individual.- If None,
UniformMutation
is selected. For categorical variables, it is alwaysUniformMutation
.
- If None,
crossover
: Crossover to be applied when creating child individual.- If None,
UniformCrossover(swapping_prob=0.5)
is selected.
- If None,
- The other arguments are the same as for Optuna’s NSGA-II.
- Supported mutation methods are listed below
UniformMutation()
- This is a mutation method that uses a Uniform distribution for the distribution of the generated individuals.
PolynomialMutation(eta=20)
- This is a mutation method that uses a Polynomial distribution for the distribution of the generated individuals.
eta
: Argument for the width of the distribution. The larger the value, the narrower the distribution. A valueeta ∈ [20, 100]
is adequate in most problems
GaussianMutation(sigma_factor=1/30)
- This is a mutation method that uses a Gaussian distribution for the distribution of the generated individuals.
sigma_factor
: It is a factor that is multiplied by the sigma of the Gaussian distribution. When thesigma_factor
is1.0
, the sigma is the difference between the maximum and minimum of the search range for the target variable.
Installation
pip install scipy
or
pip install -r https://hub.optuna.org/samplers/moead/requirements.txt
Example
import optuna
import optunahub
def objective(trial: optuna.Trial) -> tuple[float, float]:
x = trial.suggest_float("x", 0, 5)
y = trial.suggest_float("y", 0, 3)
v0 = 4 * x**2 + 4 * y**2
v1 = (x - 5) ** 2 + (y - 5) ** 2
return v0, v1
mod = optunahub.load_module("samplers/moead")
sampler = mod.MOEADSampler(
population_size=100,
scalar_aggregation_func="tchebycheff",
n_neighbors=20,
mutation=mod.PolynomialMutation(eta=20)
)
study = optuna.create_study(sampler=sampler, directions=["minimize", "minimize"])
study.optimize(objective, n_trials=1000)
Others
For more information, check out Optuna’s Medium article
Reference
Q. Zhang and H. Li, “MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition,” in IEEE Transactions on Evolutionary Computation, vol. 11, no. 6, pp. 712-731, Dec. 2007, doi: 10.1109/TEVC.2007.892759.
- Package
- samplers/moead
- Author
- Hiroaki Natsume
- License
- MIT License
- Verified Optuna version
- 4.0.0
- Last update
- 2025-06-04