moptipy.algorithms.mo package

The multi-objective optimization algorithms of the moptipy package.

Submodules

moptipy.algorithms.mo.morls module

A multi-objective version of the Randomized Local Search algorithm.

The original randomized local search (RLS) always remembers the best-so-far solution and, in each step, generates a new one by applying the unary search operator. If the new solution is not worse than the best-so-far one (according to the single objective function), it becomes the new best-so-far solution. In this multi-objective version, we accept the new solution if it is not dominated by the best-so-far solution.

class moptipy.algorithms.mo.morls.MORLS(op0, op1)[source]

Bases: Algorithm1, MOAlgorithm

The MO-RLS is a local search accepting all non-worsening moves.

initialize()[source]

Initialize the algorithm.

Return type:

None

solve_mo(process)[source]

Apply the MO-RLS to an optimization problem.

Parameters:

process (MOProcess) – the black-box process object

Return type:

None

moptipy.algorithms.mo.nsga2 module

An implementation of NSGA-II, a famous multi-objective optimization method.

Here we implement the famous NSGA-II algorithm by Deb, Agrawal, Pratap, and Meyarivan.

We apply the following modifications to the computation of the crowding distance: First, we normalize each dimension based on its range in the population. This may make sense because some objective functions may have huge ranges while others have very small ranges and would then basically be ignored in the crowding distance. Also, we do not assign infinite crowding distances to border elements of collapsed dimensions. In other words, if all elements have the same value of one objective function, none of them would receive infinite crowding distance for this objective. This also makes sense because in this case, sorting would be rather random. We also start by generating the 2*:attr:NSGA2.pop_size random solutions. When selecting parents, we apply tournament selection with replacement.

  1. Kalyanmoy Deb, Samir Agrawal, Amrit Pratap, and T. Meyarivan. A Fast Elitist Non-Dominated Sorting Genetic Algorithm for Multi-Objective Optimization: NSGA-II. In Proceedings of the International Conference on Parallel Problem Solving from Nature (PPSN VI), September 18-20, 2000, Paris, France, pages 849-858. Lecture Notes in Computer Science, volume 1917. ISBN 978-3-540-41056-0. Berlin, Heidelberg: Springer. https://doi.org/10.1007/3-540-45356-3_83. Also: KanGAL Report Number 200001. http://repository.ias.ac.in/83498/1/2-a.pdf.

class moptipy.algorithms.mo.nsga2.NSGA2(op0, op1, op2, pop_size, cr)[source]

Bases: Algorithm2, MOAlgorithm

The NSGA-II algorithm by Deb, Agrawal, Pratap, and Meyarivan.

cr: Final[float]

the crossover rate

initialize()[source]

Initialize the algorithm.

Return type:

None

log_parameters_to(logger)[source]

Log the parameters of the NSGA-II algorithm to a logger.

Parameters:

logger (KeyValueLogSection) – the logger for the parameters

Return type:

None

pop_size: Final[int]

the population size

solve_mo(process)[source]

Apply the MO-RLS to an optimization problem.

Parameters:

process (MOProcess) – the black-box process object

Return type:

None