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.
- Create an offspring population of size N from the parents using tournament selection, crossover and mutation.
- Merge parents and offspring into a combined pool of 2N solutions.
- Apply fast non-dominated sorting to split the pool into fronts F1, F2, F3 and so on.
- Fill the next generation front by front until adding a whole front would exceed N.
- Compute crowding distance in the last partially fitting front and keep its least crowded members.
- 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.
| Mechanism | What it does | Problem it solves |
|---|---|---|
| Non-dominated sorting | Ranks solutions into Pareto fronts | Converts many objectives into one rank |
| Crowding distance | Measures local density on a front | Maintains diversity along the front |
| Elitist replacement | Selects from parents plus offspring | Prevents loss of good solutions |
| Crowded tournament | Compares rank, then crowding | Drives convergence and spread together |
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.
| Parameter | Typical value | Effect when increased |
|---|---|---|
| Population size N | 100 to 500 | Denser front, higher cost per generation |
| Crossover probability | 0.8 to 1.0 | More recombination of parent traits |
| SBX distribution index | About 15 to 20 | Children closer to parents |
| Mutation probability | 1 divided by variable count | More frequent perturbations |
| Mutation distribution index | About 20 | Smaller mutation steps |
| Generations | 100 to several thousand | Better convergence, longer runtime |
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.
| Algorithm | Selection principle | Typical strength |
|---|---|---|
| NSGA-II | Dominance rank plus crowding distance | Robust default for two or three objectives |
| SPEA2 | Strength fitness with external archive | Fine-grained density estimation |
| MOEA/D | Decomposition into scalar subproblems | Efficient on regular front shapes |
| NSGA-III | Dominance plus reference directions | Many-objective problems with four or more objectives |
| SMS-EMOA | Hypervolume contribution | High-quality fronts at higher cost |
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.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Front stalls far from optimum | Too many objectives | Use NSGA-III or reduce objectives |
| Gaps in the final front | Population too small | Increase N or run longer |
| Clustered solutions at one end | Unscaled objectives | Normalize objective ranges |
| Many infeasible results | Weak constraint handling | Apply constrained domination |
| Results vary between runs | Stochastic search | Report several seeds and statistics |
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.