Skip to main content

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).

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)

Source distribution for heuristic-optimization 0.4.3
File Size Uploaded
heuristic_optimization-0.4.3.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for heuristic-optimization 0.4.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page