Package org.moeaframework.core
Class NondominatedSorting
java.lang.Object
org.moeaframework.core.NondominatedSorting
- Direct Known Subclasses:
FastNondominatedSorting
Non-dominated sorting algorithm for dominance depth ranking. Assigns the
rank
and crowdingDistance
attributes to solutions. Solutions of rank 0 belong to the Pareto non-dominated front.
Despite its name, this naive non-dominated sort implementation tends to be faster than the "fast non-dominated sort"
implementation from [1]. This is primarily due to the fact that for the average case, the "fast" version always
requires O(MN^2)
comparisons while this naive implementations requires only
(K-1)/2 * M * (N-1)*N/2
, assuming there are K
equally sized fronts.
References:
- Deb et al (2002). "A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II." IEEE Transactions on Evolutionary Computation. 6(2):182-197.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DominanceComparator
The dominance comparator.static final String
Attribute key for the crowding distance of a solution.static final String
Attribute key for the rank of a solution. -
Constructor Summary
ConstructorDescriptionConstructs a fast non-dominated sorting operator using Pareto dominance.NondominatedSorting
(DominanceComparator comparator) Constructs a non-dominated sorting operator using the specified dominance comparator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate
(Population population) Performs non-dominated sorting on the specified population, assigning therank
andcrowdingDistance
attributes to solutions.Returns the dominance comparator used by this non-dominated sorting routine.static final double
getCrowding
(Solution solution) Returns the crowding distance of the specified solution.static final int
Returns the rank of the specified solution.static final void
setCrowding
(Solution solution, double crowding) Sets the crowding distance of the specified solution.static final void
SEts the rank of the specified solution.void
updateCrowdingDistance
(Population front) Computes and assigns thecrowdingDistance
attribute to solutions.
-
Field Details
-
RANK_ATTRIBUTE
Attribute key for the rank of a solution.- See Also:
-
CROWDING_ATTRIBUTE
Attribute key for the crowding distance of a solution.- See Also:
-
comparator
The dominance comparator.
-
-
Constructor Details
-
NondominatedSorting
public NondominatedSorting()Constructs a fast non-dominated sorting operator using Pareto dominance. -
NondominatedSorting
Constructs a non-dominated sorting operator using the specified dominance comparator.- Parameters:
comparator
- the dominance comparator
-
-
Method Details
-
getComparator
Returns the dominance comparator used by this non-dominated sorting routine.- Returns:
- the dominance comparator used by this non-dominated sorting routine
-
evaluate
Performs non-dominated sorting on the specified population, assigning therank
andcrowdingDistance
attributes to solutions.- Parameters:
population
- the population whose solutions are to be evaluated
-
updateCrowdingDistance
Computes and assigns thecrowdingDistance
attribute to solutions. The specified population should consist of solutions within the same front/rank.- Parameters:
front
- the population whose solutions are to be evaluated
-
getRank
Returns the rank of the specified solution.- Parameters:
solution
- the solution- Returns:
- the rank of the specified solution
-
setRank
SEts the rank of the specified solution.- Parameters:
solution
- the solutionrank
- the rank of the specified solution
-
getCrowding
Returns the crowding distance of the specified solution.- Parameters:
solution
- the solution- Returns:
- the crowding distance of the specified solution
-
setCrowding
Sets the crowding distance of the specified solution.- Parameters:
solution
- the solutioncrowding
- the crowding distance of the specified solution
-