Multi-objective
MOEA/D-DE
Multiobjective optimization problems with complicated Pareto sets by (Li and Zhang, 2008).
Metaheuristics.MOEAD_DE
— TypeMOEAD_DE(weights ;
F = 0.5,
CR = 1.0,
λ = Array{Vector{Float64}}[], # ref. points
η = 20,
p_m = -1.0,
T = round(Int, 0.2*length(weights)),
δ = 0.9,
n_r = round(Int, 0.02*length(weights)),
z = zeros(0),
B = Array{Int}[],
s1 = 0.01,
s2 = 20.0,
information = Information(),
options = Options())
MOEAD_DE
implements the original version of MOEA/D-DE. It uses the contraint handling method based on the sum of violations (for constrained optimizaton): g(x, λ, z) = max(λ .* abs.(fx - z)) + sum(max.(0, gx)) + sum(abs.(hx))
To use MOEAD_DE, the output from the objective function should be a 3-touple (f::Vector, g::Vector, h::Vector)
, where f
contains the objective functions, g
and h
are the equality and inequality constraints respectively.
A feasible solution is such that g_i(x) ≤ 0 and h_j(x) = 0
.
Ref. Multiobjective Optimization Problems With Complicated Pareto Sets, MOEA/D and NSGA-II; Hui Li and Qingfu Zhang.
Example
Assume you want to solve the following optimizaton problem:
Minimize:
f(x) = (x_1, x_2)
subject to:
g(x) = x_1^2 + x_2^2 - 1 ≤ 0
x_1, x_2 ∈ [-1, 1]
A solution can be:
# Dimension
D = 2
# Objective function
f(x) = ( x, [sum(x.^2) - 1], [0.0] )
# bounds
bounds = [-1 -1;
1 1.0
]
nobjectives = 2
npartitions = 100
# reference points (Das and Dennis's method)
weights = gen_ref_dirs(nobjectives, npartitions)
# define the parameters
moead_de = MOEAD_DE(weights, options=Options(debug=false, iterations = 250))
# optimize
status_moead = optimize(f, bounds, moead_de)
# show results
display(status_moead)
NSGA-II
A fast and elitist multiobjective genetic algorithm: NSGA-II by (Deb et al., 2002).
Metaheuristics.NSGA2
— TypeNSGA2(;
N = 100,
η_cr = 20,
p_cr = 0.9,
η_m = 20,
p_m = 1.0 / D,
information = Information(),
options = Options(),
)
Parameters for the metaheuristic NSGA-II.
Parameters:
N
Population size.η_cr
η for the crossover.p_cr
Crossover probability.η_m
η for the mutation operator.p_m
Mutation probability (1/D for D-dimensional problem by default).
To use NSGA2, the output from the objective function should be a 3-touple (f::Vector, g::Vector, h::Vector)
, where f
contains the objective functions, g
and h
are inequality, equality constraints respectively.
A feasible solution is such that g_i(x) ≤ 0 and h_j(x) = 0
.
using Metaheuristics
# Dimension
D = 2
# Objective function
f(x) = ( x, [sum(x.^2) - 1], [0.0] )
# bounds
bounds = [-1 -1;
1 1.0
]
# define the parameters (use `NSGA2()` for using default parameters)
nsga2 = NSGA2(N = 100, p_cr = 0.85)
# optimize
status = optimize(f, bounds, nsga2)
# show results
display(status)
NSGA-III
An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints by (Deb and Jain, 2014).
Metaheuristics.NSGA3
— TypeNSGA3(;
N = 100,
η_cr = 20,
p_cr = 0.9,
η_m = 20,
p_m = 1.0 / D,
partitions = 12,
reference_points = Vector{Float64}[],
information = Information(),
options = Options(),
)
Parameters for the metaheuristic NSGA-III.
Parameters:
N
Population size.η_cr
η for the crossover.p_cr
Crossover probability.η_m
η for the mutation operator.p_m
Mutation probability (1/D for D-dimensional problem by default).reference_points
reference points usually generated bygen_ref_dirs
.partitions
number of Das and Dennis's reference points ifreference_points
is empty.
To use NSGA3, the output from the objective function should be a 3-touple (f::Vector, g::Vector, h::Vector)
, where f
contains the objective functions, g
and h
are inequality, equality constraints respectively.
A feasible solution is such that g_i(x) ≤ 0 and h_j(x) = 0
.
using Metaheuristics
# Objective function, bounds, and the True Pareto front
f, bounds, pf = Metaheuristics.TestProblems.get_problem(:DTLZ2)
# define the parameters (use `NSGA3()` for using default parameters)
nsga3 = NSGA3(p_cr = 0.9)
# optimize
status = optimize(f, bounds, nsga3)
# show results
display(status)
SMS-EMOA
An EMO algorithm using the hypervolume measure as a selection criterion by (Emmerich et al., 2005).
Metaheuristics.SMS_EMOA
— TypeSMS_EMOA(;
N = 100,
η_cr = 20,
p_cr = 0.9,
η_m = 20,
p_m = 1.0 / D,
n_samples = 10_000,
information = Information(),
options = Options(),
)
Parameters for the metaheuristic SMS-EMOA.
Parameters:
N
Population size.η_cr
η for the crossover.p_cr
Crossover probability.η_m
η for the mutation operator.p_m
Mutation probability (1/D for D-dimensional problem by default).n_samples
number of samples to approximate hypervolume in many-objective (M > 2).
To use SMS_EMOA, the output from the objective function should be a 3-touple (f::Vector, g::Vector, h::Vector)
, where f
contains the objective functions, g
and h
are inequality, equality constraints respectively.
A feasible solution is such that g_i(x) ≤ 0 and h_j(x) = 0
.
using Metaheuristics
# Dimension
D = 2
# Objective function
f(x) = ( x, [sum(x.^2) - 1], [0.0] )
# bounds
bounds = [-1 -1;
1 1.0
]
# define the parameters (use `SMS_EMOA()` for using default parameters)
sms_emoa = SMS_EMOA(N = 100, p_cr = 0.85)
# optimize
status = optimize(f, bounds, sms_emoa)
# show results
display(status)
SPEA2
Improved strength Pareto evolutionary algorithm by (Zitzler et al., 2001).
Metaheuristics.SPEA2
— TypeSPEA2(;
N = 100,
η_cr = 20,
p_cr = 0.9,
η_m = 20,
p_m = 1.0 / D,
information = Information(),
options = Options(),
)
Parameters for the metaheuristic NSGA-II.
Parameters:
N
Population size.η_cr
η for the crossover.p_cr
Crossover probability.η_m
η for the mutation operator.p_m
Mutation probability (1/D for D-dimensional problem by default).
To use SPEA2, the output from the objective function should be a 3-touple (f::Vector, g::Vector, h::Vector)
, where f
contains the objective functions, g
and h
are inequality, equality constraints respectively.
A feasible solution is such that g_i(x) ≤ 0 and h_j(x) = 0
.
using Metaheuristics
# Dimension
D = 2
# Objective function
f(x) = ( x, [sum(x.^2) - 1], [0.0] )
# bounds
bounds = [-1 -1;
1 1.0
]
# define the parameters (use `SPEA2()` for using default parameters)
nsga2 = SPEA2(N = 100, p_cr = 0.85)
# optimize
status = optimize(f, bounds, nsga2)
# show results
display(status)
CCMO
A Coevolutionary Framework for Constrained Multiobjective Optimization Problems proposed by (Tian et al., 2021).
Metaheuristics.CCMO
— TypeCCMO(base_optimizer; infromation, options)
Parameters for CCMO algorithm. base_algorithm
only supports NSGA2()
.
A feasible solution is such that g_i(x) ≤ 0 and h_j(x) = 0
.
Example
julia> f, bounds, pf = Metaheuristics.TestProblems.MTP();
julia> ccmo = CCMO(NSGA2(N=100, p_m=0.001));
julia> optimize(f, bounds, ccmo)
+=========== RESULT ==========+
iteration: 500
population: ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀F space⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
┌────────────────────────────────────────┐
2 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
f₂ │⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠈⢢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠈⠢⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠈⠑⠦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠉⠒⠤⢤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠢⠤⡀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
0 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⠒⠒⠒⠄⠤⠤⢠⢀⣀⢀⣀⠀⣀⣀⡀⣀⡀│
└────────────────────────────────────────┘
⠀0⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀1⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀f₁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
non-dominated solution(s):
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀F space⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
┌────────────────────────────────────────┐
2 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
f₂ │⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠈⢢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠈⠢⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠈⠑⠦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠉⠒⠤⢤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠢⠤⡀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
0 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⠒⠒⠒⠄⠤⠤⢠⢀⣀⢀⣀⠀⣀⣀⡀⣀⡀│
└────────────────────────────────────────┘
⠀0⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀1⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀f₁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
f calls: 50000
feasibles: 100 / 100 in final population
total time: 7.0616 s
stop reason: Maximum number of iterations exceeded.
+============================+