NSGA-II

Also known as: Non-dominated sorting genetic algorithm II

On this page 7

NSGA-II, the Non-dominated sorting genetic algorithm II, is an elitist multi-objective evolutionary algorithm that approximates the Pareto front of a problem by ranking candidate solutions into non-dominated fronts and preserving diversity with a crowding distance measure. In evolutionary computation, it is one of the most widely used and cited methods for optimizing several conflicting objectives at once.

Published in 2002 by Kalyanmoy Deb and colleagues, NSGA-II replaced the original NSGA with a faster sorting procedure, built-in elitism and a parameter-free diversity mechanism. It remains a standard baseline against which newer multi-objective algorithms are compared.

How NSGA-II evolves a population

NSGA-II evolves a population of N candidate solutions through repeated generations that combine parents and offspring, sort them by dominance and keep the best N. Solution A dominates solution B if A matches or beats B on all objectives and beats it outright on one or more; the set of solutions that no other solution dominates forms the Pareto-optimal front.

  1. Create an offspring population of size N from the parents using tournament selection, crossover and mutation.
  2. Merge parents and offspring into a combined pool of 2N solutions.
  3. Apply fast non-dominated sorting to split the pool into fronts F1, F2, F3 and so on.
  4. Fill the next generation front by front until adding a whole front would exceed N.
  5. Compute crowding distance in the last partially fitting front and keep its least crowded members.
  6. Repeat until a generation budget or convergence criterion is reached.

Because parents compete directly with offspring, good solutions are never lost, which is how NSGA-II implements elitism without a separate archive. Selection uses the crowded comparison operator: a lower front rank wins, and within the same front a larger crowding distance wins.

Fast non-dominated sorting and crowding distance

The two core procedures of NSGA-II are fast non-dominated sorting, which assigns each solution a rank, and crowding distance, which estimates how isolated a solution is within its rank. Sorting counts, for every solution, how many others dominate it and which ones it dominates, then peels off fronts in order. This reduces complexity from O(MN³) in the original NSGA to O(MN²), where M is the number of objectives.

Crowding distance sorts a front along each objective, assigns infinite distance to boundary solutions, and sums the normalized gaps between each solution’s neighbors. Larger values indicate sparse regions, so favoring them spreads solutions along the front without a user-defined sharing radius.

MechanismWhat it doesProblem it solves
Non-dominated sortingRanks solutions into Pareto frontsConverts many objectives into one rank
Crowding distanceMeasures local density on a frontMaintains diversity along the front
Elitist replacementSelects from parents plus offspringPrevents loss of good solutions
Crowded tournamentCompares rank, then crowdingDrives convergence and spread together
Core mechanisms and their roles

Key parameters and typical settings

NSGA-II has few parameters, and most of them belong to its variation operators rather than to the sorting scheme. For real-valued problems, the reference implementation uses simulated binary crossover (SBX) and polynomial mutation, each controlled by a distribution index.

ParameterTypical valueEffect when increased
Population size N100 to 500Denser front, higher cost per generation
Crossover probability0.8 to 1.0More recombination of parent traits
SBX distribution indexAbout 15 to 20Children closer to parents
Mutation probability1 divided by variable countMore frequent perturbations
Mutation distribution indexAbout 20Smaller mutation steps
Generations100 to several thousandBetter convergence, longer runtime
Common parameter settings for real-coded problems

These values are starting points, not rules. Problems with many decision variables, expensive simulations or constraints often require tuning, and constraint handling in NSGA-II typically uses constrained domination, in which feasible solutions always beat infeasible ones and infeasible ones are compared by total violation.

NSGA-II compared with other multi-objective methods

NSGA-II belongs to the Pareto-dominance family of multi-objective evolutionary algorithms, which differs from decomposition-based and indicator-based approaches in how it rewards solutions. The table places it among common alternatives.

AlgorithmSelection principleTypical strength
NSGA-IIDominance rank plus crowding distanceRobust default for two or three objectives
SPEA2Strength fitness with external archiveFine-grained density estimation
MOEA/DDecomposition into scalar subproblemsEfficient on regular front shapes
NSGA-IIIDominance plus reference directionsMany-objective problems with four or more objectives
SMS-EMOAHypervolume contributionHigh-quality fronts at higher cost
Selected multi-objective evolutionary algorithms

Compared with weighted-sum scalarization, NSGA-II finds many trade-off solutions in a single run and can approximate non-convex fronts, which weighted sums cannot reach. Compared with single-objective genetic algorithms, it replaces scalar fitness with rank and density.

Limitations and common mistakes

The main weakness of NSGA-II is loss of selection pressure as the number of objectives grows. With four or more objectives, most solutions become mutually non-dominated, so almost the entire population falls into the first front and crowding distance alone guides selection, which degrades convergence.

SymptomLikely causeRemedy
Front stalls far from optimumToo many objectivesUse NSGA-III or reduce objectives
Gaps in the final frontPopulation too smallIncrease N or run longer
Clustered solutions at one endUnscaled objectivesNormalize objective ranges
Many infeasible resultsWeak constraint handlingApply constrained domination
Results vary between runsStochastic searchReport several seeds and statistics
Symptoms, causes and remedies

Another frequent mistake is judging a run by visual inspection alone. Quality should be measured with indicators such as hypervolume or inverted generational distance, averaged over multiple independent runs.

A non-technical view

Engineers often face targets that conflict. A bridge can be lighter or stiffer, yet seldom both at the top level. NSGA-II finds a whole menu of good compromises instead of one single answer.

It works like breeding. It starts with many random designs. It mixes and tweaks the best ones over many rounds. In each round it keeps designs that no other design beats on every goal. It also prefers designs that are different from their neighbors, so the menu covers cheap options, safe options and everything in between. A person then picks the compromise that fits the situation.

A concrete example

A structural engineering team designs a steel truss for a pedestrian bridge. It wants to minimize material mass and minimize maximum deflection, while meeting stress limits. The design has 24 decision variables, the cross-sectional areas of each member, and each evaluation runs a finite element analysis.

The team runs NSGA-II with a population of 200 for 300 generations, using SBX crossover, polynomial mutation and constrained domination for the stress limits. Five independent runs produce consistent fronts, checked with the hypervolume indicator.

The result is a front of roughly 150 feasible designs, ranging from a light truss with larger deflection to a heavier, stiffer one. The client sees that cutting deflection by the last 10 percent would add about a quarter of the mass, and chooses a mid-front design that balances cost and comfort.