Status: Experimental / alpha – do not use yet
This library currently implements particle swarm optimization and offers base classes to quickly implement other (meta-)heuristic optimization algorithms for continuous domains (as opposed to discrete / combinatorial optimization).
Scope and Audience
Heuristic optimization algorithms (sometimes called metaheuristics) aim to find approximate global optima on problems that are intractable for exact algorithms. They make no guarantees regarding the optimality of the result (in particular, they are not approximation algorithms).
On the upside, these heuristics make few – if any – assumptions about the objective function: It can be non-differentiable or even discontinuous and may have multiple local and global minima.
However, this library originated from a specific use case and thus makes some assumptions (which may also evolve in the future). E.g.,
we assume that objective function evaluations are “costly” (measured in seconds rather than milliseconds, so that an algorithm’s implementation itself is certainly not a performance bottleneck),
we only handle “soft” constraints using penalties,
we may take liberties when converting real-valued inputs to floating-point or rational representations (due to numeric properties of our problems).
Now, even if this still sounds like a good fit for your project, at this point you should probably consider using a more mature alternative or indeed rolling your own solution tailored to your precise problem.
Installation
pip install heuristic_optimization
Usage
See examples/.
Credits
Both tisimst/pyswarm and ljvmiranda921/pyswarms implement particle swarm optimization in Python and served as inspiration (but did not quite fit the use case).
Metadata
Release files for heuristic-optimization 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| heuristic_optimization-0.4.3.tar.gz | 6.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| heuristic_optimization-0.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / heuristic_optimization-0.4.3.tar.gz
| Download URL | heuristic_optimization-0.4.3.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e220e6e02d0e13e2f39c3026100c560226ad51caed6065ad5fa2decc08d3a218
|
|
BLAKE2b-256 checksum How to use checksums |
cd44b803f024f3980f01f4b370640cde9add76c36676b320536fc19fbe786491
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / heuristic_optimization-0.4.3-py3-none-any.whl
| Download URL | heuristic_optimization-0.4.3-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9587df8d454d3388cc21547fb07da4e4cf6123cb5e32bfbb059e08ffcd42bba
|
|
BLAKE2b-256 checksum How to use checksums |
7fa1bf549230334f2573819a0080236fbb71c03e806e39c4bc7947b7f50db03c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for heuristic-optimization 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.