Skip to main content

Non-dominated Sorting Differential Evolution (NSDE) Algorithm

Project description

Non-dominated Sorting Differential Evolution (NSDE)

Build Status Code style: black

The Non-dominated Sorting Differential Evolution (NSDE) algorithm combines the strengths of Differential Evolution [1] with those of the Fast and Elitist Multiobjective Genetic Algorithm NSGA-II [2], following the ideas presented in [3], to provide an efficient and robust method for the global optimization of constrained and unconstrained, single- and multi-objective optimization problems.

Installation

NSDE is available on PyPi, so it can be installed using pip install nsde.

Several methods of NSDE are written in C++ to accelerate the code. Therefore, in order to install NSDE manually, a working C++ compiler is required. For Windows, this has been tested only using Visual Studio. Furthermore, pybind11 needs to be installed and available on the environment. Once these requirements are met, NSDE can be compiled and installed using python setup.py install from the root of this repository.

Usage

To solve an optimization problem using NSDE, write a function which takes a single input argument, x, which represents the design vector, and outputs a list of objective values, f, and constraints, g (optional). For example:

def unconstrained(x):
    return [x ** 2, (x - 2) ** 2]

def constrained(x):
    return sum(x * x), 1 - x

The first represents an unconstrained problem with two objectives. The second represents a constrained problem with a single objective.

It is important to note that constraints are expected to be in the form g(x) <= 0. It is the user's responsibility to transform constraints into this form.

Once formulated, problems can be solved using NSDE as follows:

import nsde
opt = nsde.NSDE()
opt.init(constrained, bounds=[(-100, 100)] * 2)
opt.run()
x_opt = opt.best
f_opt = opt.best_fit

For multi-objective problems, it is more useful to look at the pareto front:

opt = nsde.NSDE()
opt.init(constrained, bounds=[(-100, 100)])
opt.run()
pareto = opt.fit[opt.fronts[0]]

When calling .run() on an instance of the NSDE class, the problem is solved until convergence or the maximum number of generations is reached. Alternatively, it is also possible to solve problems one generation at a time by treating opt as an iterator:

for generation in opt:
    print("f_opt = ", generation.best_fit)

OpenMDAO

The NSDE algorithm can also be used in OpenMDAO using the NSDEDriver class.

References

  1. Storn, R., and Price, K. "Differential Evolution – A Simple and Efficient Heuristic for global Optimization over Continuous Spaces." Journal of Global Optimization, Vol. 11, No. 4, 1997, pp. 341–359. doi:10.1023/a:1008202821328.

  2. Deb, K., Pratap, A., Agarwal, S., and Meyarivan, T. “A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II.” IEEE Transactions on Evolutionary Computation, Vol. 6, No. 2, 2002, pp. 182–197. doi:10.1109/4235.996017.

  3. Madavan, N. K. "Multiobjective Optimization Using a Pareto Differential Evolution Approach." Proc. of IEEE Congress on Evolutionary Computation. Vol. 2, 2002, pp. 1145-1150. doi:10.1109/CEC.2002.1004404.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nsde-0.0.2.tar.gz (20.0 kB view details)

Uploaded Source

Built Distributions

nsde-0.0.2-cp37-cp37m-win_amd64.whl (68.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

nsde-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl (72.1 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file nsde-0.0.2.tar.gz.

File metadata

  • Download URL: nsde-0.0.2.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for nsde-0.0.2.tar.gz
Algorithm Hash digest
SHA256 06e6ba26e1b0c1555eb1772c2b034f6716904f45c1d4bcc5cdeb64491318e37d
MD5 750df6dcc6581136950277b625576e9e
BLAKE2b-256 8650e81ec6cc4d7272901d3b3f7ec796a18c00dd645e8ed42c9f3ff33bb1c124

See more details on using hashes here.

File details

Details for the file nsde-0.0.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: nsde-0.0.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 68.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for nsde-0.0.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e627bfbc5800b0ebab82c70eb4babef4e4271f81583e719d443e6c0e6c6403c3
MD5 8ba311f7f8313378b8027986fedc4fe9
BLAKE2b-256 430424900b25cca83ee876447198de531ce76327932e81048a5d7746ff7d9d2a

See more details on using hashes here.

File details

Details for the file nsde-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: nsde-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 72.1 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for nsde-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 56f22dba1fc363d52b8ab37e357d543782d671467c75d92e1bc20666bbe82436
MD5 7f8eed1dcd7cbdecdc75f51b604532fc
BLAKE2b-256 1e0a40b553e74d23beac99afbb500b889355174c473e32f86b56b88ba357dec5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page