Valdecy/pyMetaheuristic

pymetaheuristic: A Python Library for Metaheuristic Optimization and Collaborative Search

What it solves

pymetaheuristic provides a comprehensive toolkit for solving complex optimization problems using metaheuristic algorithms. It simplifies the process of finding optimal or near-optimal solutions for objective functions that may be non-linear, constrained, or defined over mixed-type variable spaces (continuous, integer, binary, categorical, and permutation).

How it works

The library implements a wide array of optimization strategies and supporting infrastructure:

  • Algorithm Library: Includes over 400 algorithms across various families, such as swarm intelligence, evolutionary, trajectory, and physics-inspired methods.
  • Execution Engine: Offers a high-level optimize entry point for single algorithms, as well as cooperative_optimize and orchestrated_optimize for multi-island systems where multiple optimizers work together via migration and adaptive orchestration policies.
  • Constraint Handling: Supports inequality and equality constraints using specific handlers (like "deb") and repair strategies (such as clip, reflect, and wang) to ensure solutions remain feasible.
  • Search Space Management: Uses typed variable spaces (FloatVar, IntegerVar, etc.) and transfer functions to map continuous positions to discrete or binary probabilities.
  • Diagnostics and Explainability: Features the EvoMapX layer for internal probe labels and attribution matrices, alongside Plotly-based visualizations for convergence, diversity, and island dynamics.
  • Benchmarking: Provides a BenchmarkRunner for quick sweeps and a BenchmarkStudy for scientific analysis using statistical tests and performance profiles.

Who it’s for

  • Researchers and Data Scientists conducting scientific benchmarking of optimization algorithms.
  • Engineers looking for a robust library to solve constrained real-world optimization problems.
  • Users without deep coding experience who can utilize the pymetaheuristic Lab web application for a graphical interface.

Highlights

  • Massive Algorithm Collection: Access to 400+ optimization algorithms in one package.
  • Cooperative Search: Support for multi-island systems with configurable topologies and adaptive orchestration.
  • Deep Observability: Integrated telemetry, population snapshots, and EvoMapX explainability for understanding how algorithms converge.
  • Flexible Termination: Composable stopping criteria based on steps, evaluations, wall-clock time, target fitness, or early stopping.
  • Mixed-Type Support: Native handling of float, integer, binary, categorical, and permutation variables.

Related

  • Project
  • Project
  • Project
  • Project
  • Project