uo.algorithm.metaheuristic.moead package
Submodules
uo.algorithm.metaheuristic.moead.moead_optimizer module
The moead_optimizer
module contains class
MoeadOptimizer,
that represents implementation of the
MOEA/D algorithm.
The algorithm decomposes a multi-objective optimization problem into a set of scalar subproblems defined by weight vectors and solves them cooperatively by means of neighborhood-based offspring generation and replacement.
- class uo.algorithm.metaheuristic.moead.moead_optimizer.MoeadOptimizer(moead_variation_support: MoeadVariationSupport, population_size: int, neighborhood_size: int, max_number_of_replaced_neighbors: int, finish_control: FinishControl, problem: Problem, solution_template: Solution | None, output_control: OutputControl | None, random_seed: int | None, additional_statistics_control: AdditionalStatisticsControl | None, lattice_parameter_H: int | None = None)
Bases:
PopulationBasedMetaheuristicImplementation of the Multi-Objective Evolutionary Algorithm based on Decomposition (MOEA/D).
- copy() MoeadOptimizer
Copy the current object.
- Returns:
copied MOEA/D optimizer
- Return type:
- property max_number_of_replaced_neighbors: int
Property getter for maximum number of replaced neighbors.
- property moead_variation_support: MoeadVariationSupport
Property getter for variation support.
- string_rep(delimiter: str, indentation: int = 0, indentation_symbol: str = '', group_start: str = '{', group_end: str = '}') str
String representation of the MOEA/D optimizer.
- property weight_setup: WeightSetup | None
Property getter for weight setup.
uo.algorithm.metaheuristic.moead.moead_variation_support module
The moead_variation_support
module describes the class
MoeadVariationSupport.
- class uo.algorithm.metaheuristic.moead.moead_variation_support.MoeadVariationSupport
Bases:
Generic[R_co,A_co]- abstract copy()
Copy the current object.
- Returns:
new instance with the same properties
- Return type:
- abstract generate_offspring(problem: Problem, parent1: Solution[R_co, A_co], parent2: Solution[R_co, A_co], child: Solution[R_co, A_co], optimizer: PopulationBasedMetaheuristic) None
Generate one offspring from two parents.
- Parameters:
problem (Problem) – problem that is solved
parent1 (Solution[R_co,A_co]) – first parent
parent2 (Solution[R_co,A_co]) – second parent
child (Solution[R_co,A_co]) – child solution that is created
optimizer (PopulationBasedMetaheuristic) – optimizer that is executed
- Returns:
None
uo.algorithm.metaheuristic.moead.moead_variation_support_real module
The moead_variation_support_real
module contains class
MoeadVariationSupportReal,
that represents variation support for the MOEA/D algorithm where solution
representation is real-valued.
- class uo.algorithm.metaheuristic.moead.moead_variation_support_real.MoeadVariationSupportReal(crossover_probability: float = 1.0, mutation_probability: float | None = None, eta_c: float = 20.0, eta_m: float = 20.0)
Bases:
MoeadVariationSupport[ndarray,A_co]- copy()
Copy the current instance.
- Returns:
copied instance
- Return type:
uo.algorithm.metaheuristic.moead.moead_variation_support_binary module
The moead_variation_support_binary
module contains class
MoeadVariationSupportBinary,
that represents variation support for the MOEA/D algorithm where solution
representation is binary.
- class uo.algorithm.metaheuristic.moead.moead_variation_support_binary.MoeadVariationSupportBinary(crossover_probability: float = 0.9, mutation_probability: float | None = None)
Bases:
MoeadVariationSupport[ndarray,A_co]- copy()
Copy the current instance.
- Returns:
copied instance
- Return type:
uo.algorithm.metaheuristic.moead.moead_decomposition module
The moead_decomposition
module contains scalarization functions used by the
MoeadOptimizer
algorithm.
Currently, the module provides Tchebyscheff scalarization.
- uo.algorithm.metaheuristic.moead.moead_decomposition.tchebyscheff(F: ndarray, w: ndarray, z: ndarray, eps: float = 1e-12) ndarray
Compute Tchebyscheff scalarization values for objective vectors.
- Parameters:
F (np.ndarray) – objective matrix of shape
(N, M)w (np.ndarray) – weight vector of shape
(M,)z (np.ndarray) – ideal point of shape
(M,)eps (float) – small positive value used to avoid zero weights
- Returns:
scalarization values of shape
(N,)- Return type:
np.ndarray
uo.algorithm.metaheuristic.moead.moead_weights module
The moead_weights
module contains functions for generating MOEA/D weight vectors and
their neighborhoods.
- class uo.algorithm.metaheuristic.moead.moead_weights.WeightSetup(W: ndarray, B: ndarray)
Bases:
objectContainer that stores MOEA/D weight vectors and neighborhoods.
- Variables:
W (np.ndarray) – weight-vector matrix
B (np.ndarray) – neighborhood matrix
- B: ndarray
- W: ndarray
- uo.algorithm.metaheuristic.moead.moead_weights.build_weight_setup(n_obj: int, population_size: int | None = None, H: int | None = None, T: int = 20) WeightSetup
Build weight vectors and neighborhoods for MOEA/D.
- Parameters:
- Returns:
weight setup object
- Return type:
- uo.algorithm.metaheuristic.moead.moead_weights.neighborhood_by_euclidean(W: ndarray, T: int) ndarray
Build neighborhood matrix from weight vectors using Euclidean distance.
- Parameters:
W (np.ndarray) – weight matrix of shape
(N, M)T (int) – neighborhood size
- Returns:
neighborhood index matrix of shape
(N, T)- Return type:
np.ndarray
uo.algorithm.metaheuristic.moead.moead_metrics module
The moead_metrics
module contains quality indicators for multi-objective optimization
results, including IGD and 2D hypervolume.
- uo.algorithm.metaheuristic.moead.moead_metrics.filter_nondominated_points(A: ndarray) ndarray
Return nondominated subset of points for minimization problems.
- Parameters:
A (np.ndarray) – objective matrix of shape
(N, M)- Returns:
nondominated subset
- Return type:
np.ndarray
- uo.algorithm.metaheuristic.moead.moead_metrics.hypervolume_2d(A: ndarray, ref_point: tuple[float, float]) float
Compute 2D hypervolume for minimization problems.
- uo.algorithm.metaheuristic.moead.moead_metrics.igd(A: ndarray, Z: ndarray) float
Compute Inverted Generational Distance.
- Parameters:
A (np.ndarray) – approximation set in objective space of shape
(N, M)Z (np.ndarray) – reference set in objective space of shape
(K, M)
- Returns:
IGD value
- Return type:
Module contents
The moead
package contains implementation of the Multi-Objective Evolutionary
Algorithm based on Decomposition (MOEA/D), together with supporting
functionality for decomposition, weight-vector generation, variation
support, and quality indicators.
- class uo.algorithm.metaheuristic.moead.MoeadOptimizer(moead_variation_support: MoeadVariationSupport, population_size: int, neighborhood_size: int, max_number_of_replaced_neighbors: int, finish_control: FinishControl, problem: Problem, solution_template: Solution | None, output_control: OutputControl | None, random_seed: int | None, additional_statistics_control: AdditionalStatisticsControl | None, lattice_parameter_H: int | None = None)
Bases:
PopulationBasedMetaheuristicImplementation of the Multi-Objective Evolutionary Algorithm based on Decomposition (MOEA/D).
- copy() MoeadOptimizer
Copy the current object.
- Returns:
copied MOEA/D optimizer
- Return type:
- property max_number_of_replaced_neighbors: int
Property getter for maximum number of replaced neighbors.
- property moead_variation_support: MoeadVariationSupport
Property getter for variation support.
- string_rep(delimiter: str, indentation: int = 0, indentation_symbol: str = '', group_start: str = '{', group_end: str = '}') str
String representation of the MOEA/D optimizer.
- property weight_setup: WeightSetup | None
Property getter for weight setup.
- class uo.algorithm.metaheuristic.moead.MoeadVariationSupport
Bases:
Generic[R_co,A_co]- abstract copy()
Copy the current object.
- Returns:
new instance with the same properties
- Return type:
- abstract generate_offspring(problem: Problem, parent1: Solution[R_co, A_co], parent2: Solution[R_co, A_co], child: Solution[R_co, A_co], optimizer: PopulationBasedMetaheuristic) None
Generate one offspring from two parents.
- Parameters:
problem (Problem) – problem that is solved
parent1 (Solution[R_co,A_co]) – first parent
parent2 (Solution[R_co,A_co]) – second parent
child (Solution[R_co,A_co]) – child solution that is created
optimizer (PopulationBasedMetaheuristic) – optimizer that is executed
- Returns:
None
- class uo.algorithm.metaheuristic.moead.MoeadVariationSupportBinary(crossover_probability: float = 0.9, mutation_probability: float | None = None)
Bases:
MoeadVariationSupport[ndarray,A_co]- copy()
Copy the current instance.
- Returns:
copied instance
- Return type:
- class uo.algorithm.metaheuristic.moead.MoeadVariationSupportReal(crossover_probability: float = 1.0, mutation_probability: float | None = None, eta_c: float = 20.0, eta_m: float = 20.0)
Bases:
MoeadVariationSupport[ndarray,A_co]- copy()
Copy the current instance.
- Returns:
copied instance
- Return type:
- class uo.algorithm.metaheuristic.moead.WeightSetup(W: ndarray, B: ndarray)
Bases:
objectContainer that stores MOEA/D weight vectors and neighborhoods.
- Variables:
W (np.ndarray) – weight-vector matrix
B (np.ndarray) – neighborhood matrix
- B: ndarray
- W: ndarray
- uo.algorithm.metaheuristic.moead.build_weight_setup(n_obj: int, population_size: int | None = None, H: int | None = None, T: int = 20) WeightSetup
Build weight vectors and neighborhoods for MOEA/D.
- Parameters:
- Returns:
weight setup object
- Return type:
- uo.algorithm.metaheuristic.moead.filter_nondominated_points(A: ndarray) ndarray
Return nondominated subset of points for minimization problems.
- Parameters:
A (np.ndarray) – objective matrix of shape
(N, M)- Returns:
nondominated subset
- Return type:
np.ndarray
- uo.algorithm.metaheuristic.moead.hypervolume_2d(A: ndarray, ref_point: tuple[float, float]) float
Compute 2D hypervolume for minimization problems.
- uo.algorithm.metaheuristic.moead.igd(A: ndarray, Z: ndarray) float
Compute Inverted Generational Distance.
- Parameters:
A (np.ndarray) – approximation set in objective space of shape
(N, M)Z (np.ndarray) – reference set in objective space of shape
(K, M)
- Returns:
IGD value
- Return type:
- uo.algorithm.metaheuristic.moead.neighborhood_by_euclidean(W: ndarray, T: int) ndarray
Build neighborhood matrix from weight vectors using Euclidean distance.
- Parameters:
W (np.ndarray) – weight matrix of shape
(N, M)T (int) – neighborhood size
- Returns:
neighborhood index matrix of shape
(N, T)- Return type:
np.ndarray
- uo.algorithm.metaheuristic.moead.simplex_lattice_weights(M: int, H: int) ndarray
Generate simplex-lattice design weights.
- uo.algorithm.metaheuristic.moead.tchebyscheff(F: ndarray, w: ndarray, z: ndarray, eps: float = 1e-12) ndarray
Compute Tchebyscheff scalarization values for objective vectors.
- Parameters:
F (np.ndarray) – objective matrix of shape
(N, M)w (np.ndarray) – weight vector of shape
(M,)z (np.ndarray) – ideal point of shape
(M,)eps (float) – small positive value used to avoid zero weights
- Returns:
scalarization values of shape
(N,)- Return type:
np.ndarray