Skip to main content

A Python optimization package using Differential Evolution.

Project description

header

pymoode

A Python framework for Differential Evolution using pymoo (Blank & Deb, 2020).

Read the Docs

Contents

Install | Algorithms | Survival Operators | Crowding Metrics | Usage | Structure | Citation | References | Contact | Acknowledgements

Install

First, make sure you have a Python 3 environment installed.

From PyPi:

pip install pymoode

From the current version on github:

pip install git+https://github.com/mooscaliaproject/pymoode

Algorithms

  • DE: Differential Evolution for single-objective problems proposed by Storn & Price (1997). Other features later implemented are also present, such as dither, jitter, selection variants, and crossover strategies. For details see Price et al. (2005).
  • NSDE: Non-dominated Sorting Differential Evolution, a multi-objective algorithm that combines DE mutation and crossover operators to NSGA-II (Deb et al., 2002) survival.
  • GDE3: Generalized Differential Evolution 3, a multi-objective algorithm that combines DE mutation and crossover operators to NSGA-II survival with a hybrid type survival strategy. In this algorithm, individuals might be removed in a one-to-one comparison before truncating the population by the multi-objective survival operator. It was proposed by Kukkonen, S. & Lampinen, J. (2005). Variants with M-Nearest Neighbors and 2-Nearest Neighbors survival are also available.
  • NSDE-R: Non-dominated Sorting Differential Evolution based on Reference directions (Reddy & Dulikravich, 2019). It is an algorithm for many-objective problems that works as an extension of NSDE using NSGA-III (Deb & Jain, 2014) survival strategy.

Survival Operators

  • RandAndCrowding: Flexible structure to implement NSGA-II rank and crowding survival with different options for crowding metric and elimination of individuals.
  • ConstrRankAndCrowding: A survival operator based on rank and crowding with a special constraint handling approach proposed by Kukkonen, S. & Lampinen, J. (2005).

Crowding Metrics

  • Crowding Distance ('cd'): Proposed by Deb et al. (2002) in NSGA-II. Imported from pymoo.
  • Pruning Crowding Distance ('pruning-cd' or 'pcd'): Proposed by Kukkonen & Deb (2006a), it recursively recalculates crowding distances as removes individuals from a population to improve diversity.
  • M-Nearest Neighbors ('mnn'): Proposed by Kukkonen & Deb (2006b) in an extension of GDE3 to many-objective problems.
  • 2-Nearest Neighbors ('2nn'): Also proposed by Kukkonen & Deb (2006b), it is a variant of M-Nearest Neighbors in which the number of neighbors is two.
  • Crowding Entropy ('ce'): Proposed by Wang et al. (2010) in MOSADE.

Metrics 'pcd', 'mnn', and '2nn' are recursively recalculated as individuals are removed, to improve the population diversity. Therefore, they are implemented using cython to reduce computational time. If compilation fails, .py files are used instead, which makes it slightly slower.

Usage

For more examples, read the docs

import matplotlib.pyplot as plt
from pymoo.problems import get_problem
from pymoo.optimize import minimize
from pymoode.algorithms import GDE3
from pymoode.survival import RankAndCrowding

problem = get_problem("tnk")
pf = problem.pareto_front()
gde3 = GDE3(
    pop_size=50, variant="DE/rand/1/bin", CR=0.5, F=(0.0, 0.9),
    survival=RankAndCrowding(crowding_func="pcd")
)
    
res = minimize(problem, gde3, ('n_gen', 200), seed=12)
fig, ax = plt.subplots(figsize=[6, 5], dpi=100)
ax.scatter(pf[:, 0], pf[:, 1], color="navy", label="True Front")
ax.scatter(res.F[:, 0], res.F[:, 1], color="firebrick", label="GDE3")
ax.set_ylabel("$f_2$")
ax.set_xlabel("$f_1$")
ax.legend()
fig.tight_layout()
plt.show()

tnk_gde3

Alternatively, on the three-objective problem DTLZ2, it would produce amazing results.

problem = get_problem("dtlz2")
gde3mnn = GDE3(
    pop_size=150, variant="DE/rand/1/bin", CR=0.5, F=(0.0, 0.9),
    survival=RankAndCrowding(crowding_func="mnn")
)
    
res = minimize(problem, gde3mnn, ('n_gen', 250), seed=12)

gde3_dtlz2

Structure

pymoode
├───algorithms
│   ├───DE
│   ├───GDE3
│   ├───NSDE
│   └───NSDER
├───survival
│   ├───RankAndCrowding
│   └───ConstrRankAndCrowding
├───performance
│   └───SpacingIndicator
└───operators
    ├───dem.py
    │   └───DEM
    ├───dex.py
    │   └───DEX
    └───des.py
        └───DES

Citation

This package was developed as part of an academic optimization project. Please, if you use it for research purposes, cite it using the published article:

Leite, B., Costa, A. O. S., Costa, E. F., 2023. Multi-objective optimization of adiabatic styrene reactors using Generalized Differential Evolution 3 (GDE3). Chem. Eng. Sci., Volume 265, Article 118196. doi:10.1016/j.ces.2022.118196.

References

Blank, J. & Deb, K., 2020. pymoo: Multi-Objective Optimization in Python. IEEE Access, Volume 8, pp. 89497-89509. doi:10.1109/ACCESS.2020.2990567.

Deb, K. & Jain, H., 2014. An evolutionary many-objective optimization algorithm using reference-point-based nondominated sorting approach, part I: solving problems with box constraints. IEEE Transactions on Evolutionary Computation, 18(4), pp. 577–601. doi:10.1109/TEVC.2013.2281535.

Deb, K., Pratap, A., Agarwal, S. & Meyarivan, T. A. M. T., 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE transactions on evolutionary computation, 6(2), pp. 182-197. doi:10.1109/4235.996017.

Kukkonen, S. & Deb, K., 2006a. Improved Pruning of Non-Dominated Solutions Based on Crowding Distance for Bi-Objective Optimization Problems. Vancouver, s.n., pp. 1179-1186. doi:10.1109/CEC.2006.1688443.

Kukkonen, S. & Deb, K., 2006b. A fast and effective method for pruning of non-dominated solutions in many-objective problems. In: Parallel problem solving from nature-PPSN IX. Berlin: Springer, pp. 553-562. doi:10.1007/11844297_56.

Kukkonen, S. & Lampinen, J., 2005. GDE3: The third evolution step of generalized differential evolution. 2005 IEEE congress on evolutionary computation, Volume 1, pp. 443-450. doi:10.1109/CEC.2005.1554717.

Reddy, S. R. & Dulikravich, G. S., 2019. Many-objective differential evolution optimization based on reference points: NSDE-R. Struct. Multidisc. Optim., Volume 60, pp. 1455-1473. doi:10.1007/s00158-019-02272-0.

Price, K. V., Storn, R. M. & Lampinen, J. A., 2005. Differential Evolution: A Practical Approach to Global Optimization. 1st ed. Springer: Berlin.

Storn, R. & Price, K., 1997. Differential evolution–a simple and efficient heuristic for global optimization over continuous spaces. J. Glob. Optim., 11(4), pp. 341-359. doi:10.1023/A:1008202821328

Wang, Y.-N., Wu, L.-H. & Yuan, X.-F., 2010. Multi-objective self-adaptive differential evolution with elitist archive and crowding entropy-based diversity measure. Soft Comput., 14(3), pp. 193-209. doi:10.1007/s00500-008-0394-9

Contact

e-mail: bruscalia12@gmail.com

Acknowledgements

To Julian Blank, who created the amazing structure of pymoo, making such a project possible.

To Esly F. da Costa Junior, for the unconditional support all along.

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

pymoode-0.3.1.dev1.tar.gz (42.7 kB view details)

Uploaded Source

Built Distributions

pymoode-0.3.1.dev1-cp313-cp313-win_amd64.whl (287.1 kB view details)

Uploaded CPython 3.13 Windows x86-64

pymoode-0.3.1.dev1-cp313-cp313-macosx_10_13_universal2.whl (562.6 kB view details)

Uploaded CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)

pymoode-0.3.1.dev1-cp312-cp312-win_amd64.whl (288.6 kB view details)

Uploaded CPython 3.12 Windows x86-64

pymoode-0.3.1.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pymoode-0.3.1.dev1-cp312-cp312-macosx_10_13_universal2.whl (570.7 kB view details)

Uploaded CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)

pymoode-0.3.1.dev1-cp311-cp311-win_amd64.whl (286.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

pymoode-0.3.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pymoode-0.3.1.dev1-cp311-cp311-macosx_10_9_universal2.whl (561.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

pymoode-0.3.1.dev1-cp310-cp310-win_amd64.whl (286.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

pymoode-0.3.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pymoode-0.3.1.dev1-cp310-cp310-macosx_10_9_universal2.whl (562.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

pymoode-0.3.1.dev1-cp39-cp39-win_amd64.whl (327.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

pymoode-0.3.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pymoode-0.3.1.dev1-cp39-cp39-macosx_10_9_universal2.whl (566.0 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

pymoode-0.3.1.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pymoode-0.3.1.dev1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file pymoode-0.3.1.dev1.tar.gz.

File metadata

  • Download URL: pymoode-0.3.1.dev1.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for pymoode-0.3.1.dev1.tar.gz
Algorithm Hash digest
SHA256 6c8c50c9a6dadbfc97e5c5b30eab58ab33f4791d1f5c1cdf1b19bd15bad4f05c
MD5 f754f58f066d7a9419bacf79fd8a5888
BLAKE2b-256 dedc33c555e5bcde74853e3d700f0dc055768c63f78bdfa122c780ad6b1962c9

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9e0c693348bb7982e338ed49d2d8216909ab44a58eb96b42a5dc31baca73d844
MD5 e73451abb86aea1dfd6e070f1adf2749
BLAKE2b-256 b47d805215d1e8970b876504eab5b3a061f26e168b80908308142967a9c7aeda

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f6936238e8e41727497ccaefbc99d1dbb860e88b60f72e88990156442c2812f2
MD5 70ccd12ebb64af457c082b4b06ccbdc0
BLAKE2b-256 95acd587ec8820fb7d42ffdd2e05616f796bda4645aa11ae8fd7ffd630b6f7d4

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd60d8bdb682ae2309a0705b7f83b145a3fb53114826fb1c51d452ee30051871
MD5 295b29edca3b52f14d0416f0bd5a6387
BLAKE2b-256 bbfa722bdbd214d2bb351a1b1bd99c04d983ef681ee402ff2ad77de7e8979404

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53717237acde0f26af38011bfd5c05ae6128b3433235f2abd7e395d2e8713190
MD5 a73e28f4f0d7aee78d7fabb710cd7a5d
BLAKE2b-256 aece3c489b011d6b336f172823a60ddedb3cb0ca21c033b69f99cfdfae083457

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 fc9e5dada5aa84a596b6760bce55946478eb72f97ef4e7da1abc8920b3f763c0
MD5 89b2abf43ad93152a646f00fa24bfcd9
BLAKE2b-256 ef9df20d636b685a07af6ae41b88ceaf85fd862a1d56cfae8501eecd5b5d0840

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a889f0dd452330853277fd9d388cb3e7e51cc99c7fbd04a238b09c3be274a41
MD5 9e7e97b1d2e05bfb40f1e694d0969fca
BLAKE2b-256 398483cbad1d12ffb6c6424092ca9115aa2ceb2911b086fadc3992afb104f15a

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6dd761f05823c5da91a3f818e09995bf5f408f13fa3bd0bcd4637847269c44eb
MD5 188ed0469429cf9ef9c5b22d1b9b323d
BLAKE2b-256 4e2b7ff832d55659c2d7f00f709ac9c93f6e3b0580a47280ee40e146aac66a10

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4c24760c98462ce46738c817ae0b2c6028101c88540dba1c73e2ad0c4c90607c
MD5 ee8f106a7f8f86ace310146382a6f8d7
BLAKE2b-256 cae14ae36ee6423b206821e6ae7f39e5c03ab4296c864811bcfdd6df0775b02c

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 03b669637e92c151cd6936ed62f17bbf3837b153e7cbc58260e3b7003fc413ce
MD5 9d87e9c0f064e70aa9e30832e841d175
BLAKE2b-256 d9ab2f40dff4bfffd2fceb6d2f300d960031de5d1ebab55fb5ab1a000fadd279

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f584e7e1bfb117ad45c46d312d49c71ccf986de85c11d8517a04ee6086f270d9
MD5 ba1df4c06c21bf5478f2292ea67b9ab7
BLAKE2b-256 7bfa653194e976239a1cf8a061d76a5323475c1d6f23ae16f3a21bee4e59e1b2

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e64ba1568f63d23d6e1748a48e0578357a4238841bb741372c13881728504052
MD5 319773c1ec4015e3523814d83490a583
BLAKE2b-256 488eb33754c1c528aaf5236bcb6b8a8b29eac2f59330d802323b5562f9e1c803

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d17901bbcd313d3c94730a0165309757289af36f011225ac19f5ffd2f2e54ef6
MD5 198b6051f90b1e1096b2e754def160fb
BLAKE2b-256 588e77b6a43f095487c2bb7265105871221ca405e72acae6a030fd3f4adb4ae8

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5de891cb1dd06f410d866ab763736190c5c1b101f5337139d2a337b689e736d4
MD5 0adbf3458d1adf9c8e00518e3be443cc
BLAKE2b-256 1d09d29422c891b294bc60f84d7596ed4730914198a4c24714777edfcfef7cab

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fde988a9b68a0c7fa54ff2e46fe624db3834027e2b39626c07e05cc19454e7e7
MD5 dfb47146cb7304e5f380abcd9509716d
BLAKE2b-256 94ff9de6741649c3442093091f84e8ff7f090da924d08eb5c72072800bea759f

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3db30b392d4dd9be06cb1eb45e1fa7b04570ed50322f542416988d90f380be03
MD5 0d33d433493759650ad0cb4899e17eb4
BLAKE2b-256 043082ccf597802f55279229b0604e2043c626d9842b68e59c8e252b62d3a78d

See more details on using hashes here.

File details

Details for the file pymoode-0.3.1.dev1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymoode-0.3.1.dev1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33b6ba78ac13f513f3c2a531643021b0a2c6e75db1900e5c91d1374926f86ad6
MD5 17323e25aa6a197fb392fbbccfbfae09
BLAKE2b-256 04f15e4aa597d8a1085b4eb0a7c3b5a973d26500d5d95718bb9282e319cd477f

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