NSGA-II — Non-dominated Sorting Genetic Algorithm II

Decision Sciences
Year
2002
Type
Evolutionary multi-objective optimisation algorithm

What does it do?

NSGA-II (Non-dominated Sorting Genetic Algorithm II) is a multi-objective evolutionary algorithm introduced by Deb, Pratap, Agarwal and Meyarivan in 2002.

Rather than combining conflicting objectives into a single score, it evolves a population of candidate solutions over generations and returns a set of Pareto-optimal trade-off solutions, the Pareto front. It uses fast non-dominated sorting to rank solutions and a crowding distance measure to keep the population spread along the front.

The intuition behind the method

Suppose you want a product that is both cheap and durable. Cheaper usually means less durable, so there is no single best design, only a family of compromises. NSGA-II keeps a population of competing designs: in each generation, a design that is dominated by another (no worse on every objective and strictly better on at least one) is ranked lower, and designs in crowded regions are de-prioritised so that the survivors cover the full range of trade-offs. After the final generation, the non-dominated survivors form the Pareto front, a menu of options from which you choose the balance that fits your priorities.

History

NSGA-II was published in 2002 by Kalyanmoy Deb, Amrit Pratap, Sameer Agarwal and T. Meyarivan in IEEE Transactions on Evolutionary Computation, as a successor to the original NSGA. The paper's main changes were a fast non-dominated sorting procedure with O(MN²) complexity, a crowding distance operator that removes the need to specify a sharing parameter, and elitist selection that combines parent and offspring populations. The paper also modified the dominance definition to handle constraints and compared the algorithm with the Pareto-archived evolution strategy and the strength-Pareto evolutionary algorithm. Later variants, including NSGA-III, extend the framework to many-objective problems.

When to use it

Choose NSGA-II when a problem has two or more conflicting objectives that cannot be merged into one criterion without losing information, and you need a set of trade-off solutions rather than a single optimum. The standard real-coded operators suit continuous decision variables; binary or categorical variables need an appropriate encoding or operator. The method does not require normally distributed data. It suits engineering design, resource allocation, scheduling and portfolio problems. Do not use it when there is only one objective, where a single-objective optimiser is simpler, or when each objective evaluation is so expensive that enough generations cannot be run; a weighted single-objective approach may then be more practical. For problems with many objectives, the crowding distance becomes a weak diversity measure, and many-objective variants such as NSGA-III or decomposition-based methods such as MOEA/D are usually preferred. Running too few generations for the front to stabilise is the main failure mode.

Limitations and considerations

  • Crowding distance becomes a weaker diversity measure as the number of objectives grows, so performance on problems with more than three or four objectives is generally weaker than on fewer objectives.
  • Population size and the number of generations must be set by the user; if the run is too short, the front will be incomplete.
  • Every generation evaluates the population, so expensive objective functions, such as simulations, make the method computationally costly.
  • Results are stochastic: different random seeds can give different Pareto fronts, so repeated runs and a comparison using an indicator such as hypervolume are needed.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Returns a diverse set of Pareto-optimal trade-off solutions from one run, so the trade-off between objectives is visible without repeating the optimisation with different weight settings.
  • Fast non-dominated sorting has O(MN²) computational complexity, where M is the number of objectives and N the population size, which the original paper presents as a reduction in the cost of earlier sorting-based approaches.
  • Selection from the combined parent and offspring populations provides elitism, so good solutions found earlier are not lost; the Zitzler et al. comparison identifies elitism as an important factor for multi-objective search.
  • The crowding distance operator maintains spread without a sharing parameter that must be specified in advance, one of the difficulties the original paper set out to remove.
  • Handles constrained multi-objective problems: the original paper modifies the definition of dominance so that constraints can be handled efficiently, and the constrained version was compared favourably with another constrained multi-objective optimizer on test problems.

Applications

  • Engineering design: simultaneously minimising weight and maximising structural strength in mechanical components.
  • Environmental and energy systems: balancing cost, emissions, and reliability in power-grid or renewable-energy planning.
  • Healthcare and operations research: scheduling that optimises patient wait time, resource utilisation, and cost simultaneously.
  • Portfolio optimisation in finance and project selection in business: trading off return, risk, and liquidity.
  • Hyperparameter tuning in machine learning: optimising accuracy against model complexity or inference time.

How it works

How it works

1

A population of candidate solutions is created by sampling decision variables randomly (or by design) within their bounds. The population must be large enough to cover the objective space at the start, and the bounds define the region the search can reach.

2

Each candidate is decoded into decision-variable values and every objective function is evaluated, giving a vector of objective values for each individual. Offspring created in the evolve step must also be evaluated before they can be sorted. When objectives involve simulations or expensive models, this step usually dominates the run time.

3

Solutions are ranked by non-dominated sorting. Assuming all objectives are to be minimised (maximised objectives are negated first), solution A dominates solution B if A is no worse than B on every objective and strictly better on at least one. The first front contains the solutions that no other solution dominates; the second front contains solutions dominated only by members of the first front, and so on. Within each front, a crowding distance is computed from the distances to neighbouring solutions in objective space; a larger value indicates a less crowded region of the front.

4

The parent and offspring populations are merged and the best N individuals are kept. Fronts are taken in rank order; if the next front does not fit entirely, its members are chosen by crowding distance, preferring less crowded solutions. Because parents compete with their offspring in this step, good solutions found in earlier generations are not discarded.

5

Selected individuals are chosen by binary tournament selection, recombined with simulated binary crossover (SBX), and then altered by polynomial mutation, producing an offspring population. SBX and polynomial mutation are real-coded operators designed for continuous decision variables; binary or categorical variables require a suitable encoding or a different operator. The operator settings control how far offspring move from their parents, which balances exploring new regions against refining known solutions.

6

The evaluate, sort, select and evolve steps repeat for a set number of generations, or until the front stops changing noticeably. Progress is judged by inspecting the front across generations or by tracking the hypervolume indicator. The output is the non-dominated set of the final population, which approximates the true Pareto front and is not guaranteed to equal it.

Common pitfalls

  • Stopping before the front has stabilised: the reported solutions may lie well away from the true front. Monitor the front across generations before accepting the result.
  • Applying NSGA-II to a single-objective problem adds cost without benefit; a single-objective optimiser is simpler and more direct.
  • Setting unrealistic or loose variable bounds leaves the population searching regions that are not meaningful or feasible, so the front may not represent the attainable trade-offs.
  • Reporting only one solution from the Pareto front hides the trade-off structure that NSGA-II is designed to reveal; report the full front or a clearly justified subset.

Frequently asked questions

How many generations does NSGA-II need?

There is no universal value. The run should continue until the Pareto front stops changing noticeably; a common way to check this is to track the hypervolume indicator across generations. If the computational budget does not allow the front to stabilise, a weighted single-objective optimiser can be a more practical fallback, although it returns one solution per weighting.

What is the Pareto front?

The Pareto front is the set of solutions where no improvement on one objective is possible without worsening at least one other. NSGA-II approximates this front, giving you the full menu of balanced compromises rather than a single answer.

Can NSGA-II handle more than two objectives?

Yes, but crowding distance, the diversity mechanism, becomes less effective as the number of objectives increases, particularly in the many-objective regime beyond three or four objectives. For problems with five or more objectives, NSGA-III or decomposition-based algorithms such as MOEA/D are generally preferred.

Is NSGA-II deterministic?

No. The genetic operators and initial population involve randomness, so different runs with different random seeds can yield different Pareto-front approximations. Best practice is to run the algorithm multiple times and compare front quality using the hypervolume indicator.

Related methods

Sources

  1. Deb, K., Pratap, A., Agarwal, S. & Meyarivan, T. (2002). A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), 182-197.

    Open DOI reference
  2. Zitzler, E., Deb, K. & Thiele, L. (2000). Comparison of Multiobjective Evolutionary Algorithms: Empirical Results. Evolutionary Computation, 8(2), 173-195.

    Open DOI reference