Algorithms¶
Full class reference for every algorithm and variant. For a runnable example per algorithm, see the Multi-objective and Single-objective pages in the User Guide.
Multi-objective¶
gde3
¶
hype
¶
HYPE(problem, reference_point, population_size, offspring_population_size, mutation, crossover, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), dominance_comparator=DominanceComparator(), rng=None)
¶
Bases: GeneticAlgorithm[S, R]
This is an implementation of the Hypervolume Estimation Algorithm for Multi-objective Optimization proposed in:
- J. Bader and E. Zitzler. HypE: An Algorithm for Fast Hypervolume-Based Many-Objective Optimization. TIK Report 286, Computer Engineering and Networks Laboratory (TIK), ETH Zurich, November 2008.
It uses the Exact Hypervolume-based indicator formulation, which once computed, guides both the environmental selection and the binary tournament selection operator
Please note that as per the publication above, the evaluator and replacement should not be changed anyhow. It also requires that Problem() has a reference_point with objective values defined, e.g.
problem = ZDT1() reference_point = FloatSolution(problem.number_of_variables,problem.number_of_objectives, [0], [1]) reference_point.objectives = [1., 1.]
Source code in src/jmetal/algorithm/multiobjective/hype.py
ibea
¶
IBEA(problem, population_size, offspring_population_size, mutation, crossover, kappa, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), rng=None)
¶
Bases: GeneticAlgorithm[S, R]
Epsilon IBEA implementation as described in
- Zitzler, Eckart, and Simon Künzli. "Indicator-based selection in multiobjective search." In International Conference on Parallel Problem Solving from Nature, pp. 832-842. Springer, Berlin, Heidelberg, 2004.
https://link.springer.com/chapter/10.1007/978-3-540-30217-9_84
IBEA is a genetic algorithm (GA), i.e. it belongs to the evolutionary algorithms (EAs) family. The multi-objective search in IBEA is guided by a fitness associated to every solution, which is in turn controlled by a binary quality indicator. This implementation uses the so-called additive epsilon indicator, along with a binary tournament mating selector.
:param problem: The problem to solve.
:param population_size: Size of the population.
:param mutation: Mutation operator (see mod:
jmetal.operator.mutation).
:param crossover: Crossover operator (see mod:
jmetal.operator.crossover).
:param kappa: Weight in the fitness computation.
Source code in src/jmetal/algorithm/multiobjective/ibea.py
mocell
¶
R = TypeVar('R')
module-attribute
¶
.. module:: MOCell :platform: Unix, Windows :synopsis: MOCell (Multi-Objective Cellular evolutionary algorithm) implementation .. moduleauthor:: Antonio J. Nebro antonio@lcc.uma.es
MOCell(problem, population_size, neighborhood, archive, mutation, crossover, selection=None, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), dominance_comparator=DominanceComparator(), rng=None)
¶
Bases: GeneticAlgorithm[S, R]
MOCEll implementation as described in:
:param problem: The problem to solve.
:param population_size: Size of the population.
:param mutation: Mutation operator (see mod:
jmetal.operator.mutation).
:param crossover: Crossover operator (see mod:
jmetal.operator.crossover).
:param selection: Selection operator (see mod:
jmetal.operator.selection).
Source code in src/jmetal/algorithm/multiobjective/mocell.py
moead
¶
MOEAD(problem, population_size, mutation, crossover, aggregation_function, neighbourhood_selection_probability, max_number_of_replaced_solutions, neighbor_size, weight_files_path, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), rng=None)
¶
Bases: GeneticAlgorithm
:param max_number_of_replaced_solutions: (eta in Zhang & Li paper). :param neighbourhood_selection_probability: Probability of mating with a solution in the neighborhood rather than the entire population (Delta in Zhang & Li paper).
Source code in src/jmetal/algorithm/multiobjective/moead.py
MOEADIEpsilon(problem, population_size, mutation, crossover, aggregation_function, neighbourhood_selection_probability, max_number_of_replaced_solutions, neighbor_size, weight_files_path, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), rng=None)
¶
Bases: MOEAD
:param max_number_of_replaced_solutions: (eta in Zhang & Li paper). :param neighbourhood_selection_probability: Probability of mating with a solution in the neighborhood rather than the entire population (Delta in Zhang & Li paper).
Source code in src/jmetal/algorithm/multiobjective/moead.py
nsgaii
¶
R = TypeVar('R')
module-attribute
¶
.. module:: NSGA-II :platform: Unix, Windows :synopsis: NSGA-II (Non-dominance Sorting Genetic Algorithm II) implementation.
.. moduleauthor:: Antonio J. Nebro antonio@lcc.uma.es, Antonio BenÃtez-Hidalgo antonio.b@uma.es
NSGAII(problem, population_size, offspring_population_size, mutation, crossover, selection=None, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), dominance_comparator=DominanceComparator(), rng=None)
¶
Bases: GeneticAlgorithm[S, R]
NSGA-II implementation as described in
- K. Deb, A. Pratap, S. Agarwal and T. Meyarivan, "A fast and elitist multiobjective genetic algorithm: NSGA-II," in IEEE Transactions on Evolutionary Computation, vol. 6, no. 2, pp. 182-197, Apr 2002. doi: 10.1109/4235.996017
NSGA-II is a genetic algorithm (GA), i.e. it belongs to the evolutionary algorithms (EAs)
family. The implementation of NSGA-II provided in jMetalPy follows the evolutionary
algorithm template described in the algorithm module (mod:
jmetal.core.algorithm).
.. note:: A steady-state version of this algorithm can be run by setting the offspring size to 1.
:param problem: The problem to solve.
:param population_size: Size of the population.
:param mutation: Mutation operator (see mod:
jmetal.operator.mutation).
:param crossover: Crossover operator (see mod:
jmetal.operator.crossover).
Source code in src/jmetal/algorithm/multiobjective/nsgaii.py
replacement(population, offspring_population)
¶
This method joins the current and offspring populations to produce the population of the next generation by applying the ranking and crowding distance selection.
:param population: Parent population. :param offspring_population: Offspring population. :return: New population after ranking and crowding distance selection is applied.
Source code in src/jmetal/algorithm/multiobjective/nsgaii.py
DistributedNSGAII(problem, population_size, mutation, crossover, number_of_cores, client, selection=None, termination_criterion=None, dominance_comparator=DominanceComparator(), rng=None)
¶
Source code in src/jmetal/algorithm/multiobjective/nsgaii.py
run()
¶
Execute the algorithm.
Source code in src/jmetal/algorithm/multiobjective/nsgaii.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
nsgaiii
¶
R = TypeVar('R')
module-attribute
¶
.. module:: NSGA-III :platform: Unix, Windows :synopsis: NSGA-III (Non-dominance Sorting Genetic Algorithm III) implementation.
.. moduleauthor:: Antonio BenÃtez-Hidalgo antonio.b@uma.es, Julian Blank blankjul@egr.msu.edu
NSGAIII(reference_directions, problem, mutation, crossover, population_size=None, selection=None, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), dominance_comparator=DominanceComparator(), rng=None)
¶
Bases: NSGAII
Source code in src/jmetal/algorithm/multiobjective/nsgaiii.py
replacement(population, offspring_population)
¶
Implements NSGA-III environmental selection based on reference points as described in:
- Deb, K., & Jain, H. (2014). An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints. IEEE Transactions on Evolutionary Computation, 18(4), 577–601. doi:10.1109/TEVC.2013.2281535.
Source code in src/jmetal/algorithm/multiobjective/nsgaiii.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | |
result()
¶
Return only non dominated solutions.
Source code in src/jmetal/algorithm/multiobjective/nsgaiii.py
get_extreme_points(F, n_objs, ideal_point, extreme_points=None)
¶
Calculate the Achievement Scalarization Function which is used for the extreme point decomposition.
Source code in src/jmetal/algorithm/multiobjective/nsgaiii.py
get_nadir_point(extreme_points, ideal_point, worst_point, worst_of_front, worst_of_population)
¶
Calculate the axis intersects for a set of individuals and its extremes (construct hyperplane).
Source code in src/jmetal/algorithm/multiobjective/nsgaiii.py
associate_to_niches(F, niches, ideal_point, nadir_point, utopian_epsilon=0.0)
¶
Associate each solution to a reference point.
Source code in src/jmetal/algorithm/multiobjective/nsgaiii.py
omopso
¶
R = TypeVar('R')
module-attribute
¶
.. module:: OMOPSO :platform: Unix, Windows :synopsis: Implementation of SMPSO.
.. moduleauthor:: Antonio J. Nebro antonio@lcc.uma.es
OMOPSO(problem, swarm_size, uniform_mutation, non_uniform_mutation, leaders, epsilon, termination_criterion, swarm_generator=RandomGenerator(), swarm_evaluator=SequentialEvaluator(), rng=None)
¶
Bases: ParticleSwarmOptimization
This class implements the OMOPSO algorithm as described in
todo Update this reference * SMPSO: A new PSO-based metaheuristic for multi-objective optimization
The implementation of OMOPSO provided in jMetalPy follows the algorithm template described in the algorithm templates section of the documentation.
:param problem: The problem to solve. :param swarm_size: Size of the swarm. :param leaders: Archive for leaders.
Source code in src/jmetal/algorithm/multiobjective/omopso.py
random_search
¶
R = TypeVar('R')
module-attribute
¶
.. module:: RamdomSearch :platform: Unix, Windows :synopsis: Simple random_search search algorithms.
.. moduleauthor:: Antonio J. Nebro antonio@lcc.uma.es
smsemoa
¶
R = TypeVar('R')
module-attribute
¶
.. module:: SMSEMOA :platform: Unix, Windows :synopsis: SMSEMOA (S-Metric Selection Evolutionary Multiobjective Algorithm) implementation.
.. moduleauthor:: Antonio J. Nebro ajnebro@uma.es
SMSEMOA(problem, population_size, mutation, crossover, selection=None, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), dominance_comparator=DominanceComparator(), rng=None)
¶
Bases: GeneticAlgorithm[S, R]
SMSEMOA implementation (template based on NSGA-II).
Source code in src/jmetal/algorithm/multiobjective/smsemoa.py
replacement(population, offspring_population)
¶
SMS-EMOA replacement strategy.
Implements replacement according to SMS-EMOA algorithm: 1. Merge current population with offspring 2. Compute non-dominated ranking 3. Fill new population by fronts 4. In the last front, remove solution with smallest HV contribution
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
population
|
list[S]
|
Current population |
required |
offspring_population
|
list[S]
|
Offspring population (typically 1 solution) |
required |
Returns:
| Type | Description |
|---|---|
list[S]
|
New population of size self.population_size |
Source code in src/jmetal/algorithm/multiobjective/smsemoa.py
spea2
¶
R = TypeVar('R')
module-attribute
¶
.. module:: SPEA2 :platform: Unix, Windows :synopsis: SPEA2 implementation. Note that we do not follow the structure of the original SPEA2 code. We consider SPEA2 as a genetic algorithm with binary tournament selection, with a comparator based on the strength fitness and the KNN distance, and a sequential replacement strategy based in iteratively (sequentially) removing the worst solution of the population + offspring population. The worst solutions is selected again considering the strength fitness and KNN distance. Note that the implementation is exactly the same of NSGA-II, but using the fast nondominated sorting and the crowding distance density estimator, and the replacement follows a one-shot scheme (once the solutions are ordered, the best ones are selected without recomputing the ranking and density estimator).
.. moduleauthor:: Antonio J. Nebro antonio@lcc.uma.es
SPEA2(problem, population_size, offspring_population_size, mutation, crossover, termination_criterion=None, population_generator=RandomGenerator(), population_evaluator=SequentialEvaluator(), dominance_comparator=DominanceComparator(), rng=None)
¶
Bases: GeneticAlgorithm[S, R]
:param problem: The problem to solve.
:param population_size: Size of the population.
:param mutation: Mutation operator (see mod:
jmetal.operator.mutation).
:param crossover: Crossover operator (see mod:
jmetal.operator.crossover).
Source code in src/jmetal/algorithm/multiobjective/spea2.py
replacement(population, offspring_population)
¶
This method joins the current and offspring populations to produce the population of the next generation by applying the ranking and crowding distance selection.
:param population: Parent population. :param offspring_population: Offspring population. :return: New population after ranking and crowding distance selection is applied.
Source code in src/jmetal/algorithm/multiobjective/spea2.py
Single-objective¶
See Single-objective algorithms in the User Guide.