Skip to main content

Simplicial homology global optimisation

Project description

https://travis-ci.org/Stefan-Endres/shgo.svg?branch=master https://coveralls.io/repos/github/Stefan-Endres/shgo/badge.png?branch=master

Description

Finds the global minimum of a function using simplicial homology global optimisation (shgo). Appropriate for solving general purpose NLP and blackbox optimisation problems to global optimality (low dimensional problems). The general form of an optimisation problem is given by:

minimize f(x) subject to

g_i(x) >= 0,  i = 1,...,m
h_j(x)  = 0,  j = 1,...,p

where x is a vector of one or more variables. f(x) is the objective function R^n -> R, g_i(x) are the inequality constraints. h_j(x) are the equality constrains.

Installation

Stable:

$ pip install shgo

Latest:

$ git clone https://bitbucket.org/upiamcompthermo/shgo
$ cd shgo
$ python setup.py install
$ python setup.py test

Documentation

The project website https://stefan-endres.github.io/shgo/ contains more detailed examples, notes and performance profiles.

Quick example

Consider the problem of minimizing the Rosenbrock function. This function is implemented in rosen in scipy.optimize

>>> from scipy.optimize import rosen
>>> from shgo import shgo
>>> bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
>>> result = shgo(rosen, bounds)
>>> result.x, result.fun
(array([ 1.,  1.,  1.,  1.,  1.]), 2.9203923741900809e-18)

Note that bounds determine the dimensionality of the objective function and is therefore a required input, however you can specify empty bounds using None or objects like numpy.inf which will be converted to large float numbers.

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

shgo-0.3.8.tar.gz (342.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shgo-0.3.8-py3.6.egg (393.0 kB view details)

Uploaded Egg

shgo-0.3.8-py2.py3-none-any.whl (343.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file shgo-0.3.8.tar.gz.

File metadata

  • Download URL: shgo-0.3.8.tar.gz
  • Upload date:
  • Size: 342.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shgo-0.3.8.tar.gz
Algorithm Hash digest
SHA256 aad4011e616d56862f20cdfbb9b1ab516a1b496f6a76448042f781f2b6cd75bc
MD5 97fe55df6558f2283e250e292bb3657d
BLAKE2b-256 a798828198fa867afc230e5cd7f4796676408630bb0b334b563c38900226042b

See more details on using hashes here.

File details

Details for the file shgo-0.3.8-py3.6.egg.

File metadata

  • Download URL: shgo-0.3.8-py3.6.egg
  • Upload date:
  • Size: 393.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shgo-0.3.8-py3.6.egg
Algorithm Hash digest
SHA256 efc3e99c0667f0fb48e96e67aeb25cd7063664ca1b202d1a14ece967082d36ed
MD5 e6ff120d99525a5fdfc5d26bb59a8d1c
BLAKE2b-256 c455116be420aadcac0aee944ae1be39ac672058c35bdaa04292ff56f28803b1

See more details on using hashes here.

File details

Details for the file shgo-0.3.8-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for shgo-0.3.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ed11928bda6728e41a293e3130fadcefd9d11627343553f8c7c8a095167d2e45
MD5 1fbba81eb6640b686cd11423a4f12552
BLAKE2b-256 a42d6b30de8fef6e6320d94fc24aa9a8e32d46aa19aa90fda17ff8b9d356b43d

See more details on using hashes here.

Supported by

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