Skip to main content

Swarm Seek

Literature-validated Artificial Bee Colony (ABC) optimization for Python.

Swarm Seek implements Original ABC and principal peer-reviewed variants (GABC, qABC, MABC, CABC) with a NumPy core, optional Numba/JAX backends, an ask/tell API, scikit-learn / Optuna adapters, and automated checks against published benchmark figures.

Status: 0.2.0 (beta). Docs: https://swarm-seek.readthedocs.io/

Install

Requires Python 3.10+.

pip install swarm-seek

Optional extras:

pip install 'swarm-seek[numba]'    # Numba backend
pip install 'swarm-seek[jax]'      # JAX backend
pip install 'swarm-seek[sklearn]'  # ABCSearchCV
pip install 'swarm-seek[optuna]'   # ABCSampler

Editable install for development:

pip install -e ".[dev]"

Quick start

from swarm_seek import ABC, ContinuousSpace
from swarm_seek.benchmarks import sphere

space = ContinuousSpace([(-5.0, 5.0)] * 5)
colony = ABC(space, variant="original", pop_size=20, limit=100, max_evals=5_000, seed=0)
best = colony.minimize(sphere)
print(best.fitness)

Ask/tell loop:

import numpy as np

from swarm_seek import ABC, ContinuousSpace
from swarm_seek.benchmarks import sphere

space = ContinuousSpace([(-5.0, 5.0)] * 5)
colony = ABC(space, variant="gabc", pop_size=20, limit=100, max_evals=5_000, seed=0)

while not colony.converged:
    candidates = colony.ask()
    if candidates.size == 0:
        colony.tell([])
        continue
    colony.tell(np.asarray(sphere(candidates), dtype=np.float64))

print(colony.best.fitness)

Combinatorial ABC (permutation / TSP-style):

from swarm_seek import ABC, PermutationSpace
from swarm_seek.benchmarks import random_cities, tour_length

cities = random_cities(12, seed=0)
space = PermutationSpace(12)
best = ABC(space, variant="cabc", pop_size=16, max_evals=2_000, seed=0).minimize(
    lambda x: tour_length(x, cities)
)
print(best.fitness)

Runnable notebooks with stated pass criteria live in examples/. Backend timing: python scripts/compare_backends.py. Full documentation builds from docs/source/.

License

Apache License 2.0. See LICENSE.

Citation

See CITATION.cff for citation metadata. Archive / DOI: 10.5281/zenodo.21630532 (concept; version v0.1.1 is 10.5281/zenodo.21630533).

Download files

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

Source Distribution

swarm_seek-0.2.0.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

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

swarm_seek-0.2.0-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file swarm_seek-0.2.0.tar.gz.

File metadata

  • Download URL: swarm_seek-0.2.0.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for swarm_seek-0.2.0.tar.gz
Algorithm Hash digest
SHA256 28b89f367e098f7800a2f6386a261f7b930809be52b3bab3d7fa4ae3466de423
MD5 1aa426a94d6d4819e0abe1964ef5a3d7
BLAKE2b-256 e219465f0378e2261d1ed0be87351965c96f477f7e60463e7d3318eb91b919dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for swarm_seek-0.2.0.tar.gz:

Publisher: release.yml on tjkessler/swarm-seek

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swarm_seek-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: swarm_seek-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 53.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for swarm_seek-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee97963f81fa81e5c70bacb40a31a63fe6b82226bfe97d2518941b3987092f20
MD5 fc31ed86a13de6912f9f30b13fe796c9
BLAKE2b-256 deed4f82481bd4f5c5cd97fd8e7bf87be1944767b07bfae82417e8570cccb43a

See more details on using hashes here.

Provenance

The following attestation bundles were made for swarm_seek-0.2.0-py3-none-any.whl:

Publisher: release.yml on tjkessler/swarm-seek

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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