Skip to main content

A metabolic multi-agent optimization framework for continuous, discrete, dynamic, and classification-oriented search.

Project description

mmao

MMAO is a metabolic multi-agent optimization framework for continuous, discrete, dynamic, and classification-oriented search. It uses endogenous resource allocation and closed-loop adaptation to provide a reusable, parameter-light optimizer with reproducible benchmarks, examples, and research-friendly APIs.

What This Repository Provides

This repository is the unified software release for the MMAO research line. It consolidates the core ideas validated across the current MMAO papers into one installable Python package, with a shared API and lightweight command-line entry points.

The current package includes:

  • Continuous optimization with a reusable MMAO controller
  • Discrete optimization for TSP and multidimensional knapsack
  • Dynamic optimization with environment-shift response
  • Classification-oriented optimization for feature selection and classifier tuning
  • Standard loaders for TSPLIB and OR-Library style benchmark data
  • JSON result export, smoke tests, and a PyPI-ready package layout

Why This Repository Matters

The MMAO papers address different scientific questions, but external readers should not have to navigate several disconnected codebases. This repository is the common implementation surface that the papers can cite for:

  • installation and quick verification
  • unified interfaces across domains
  • lightweight reproducibility
  • standard data loading
  • future benchmark expansion

Design Goal

This repository is intended to make MMAO easier to verify, test, and reuse. It is not just a dump of paper scripts. The package is organized around a common metabolic control logic:

  • agents maintain private energy
  • a communal resource pool redistributes search pressure
  • role states shift continuously with success and scarcity
  • expansion, contraction, and respawn are driven by the same internal loop

Installation

Install from PyPI with pip:

pip install mmao-opt

Install from PyPI with uv:

uv pip install mmao-opt

If you use uv as your project manager, you can also add the package as a dependency:

uv add mmao-opt

For local development with pip:

pip install -e .

For local development with uv:

uv pip install -e .

If you want TSPLIB loading support with pip:

pip install -e .[io]

If you want TSPLIB loading support with uv:

uv pip install -e ".[io]"

For development and testing with pip:

pip install -e .[dev]

For development and testing with uv:

uv pip install -e ".[dev]"

Quick Start

Run the packaged CLI:

mmao continuous --problem rastrigin --dimension 10 --iterations 80
mmao tsp --iterations 100
mmao dynamic --problem dyn-rastrigin --dimension 10 --iterations 80
mmao classification --dataset breast_cancer --classifier svm_rbf --iterations 12

To print a compact summary instead of the full history:

mmao continuous --problem sphere --dimension 5 --iterations 20 --summary-only

To save the full JSON result:

mmao continuous --problem sphere --dimension 5 --iterations 20 --output outputs/sphere.json

Standard data loaders are also available:

mmao tsp --tsplib path/to/berlin52.tsp --summary-only
mmao knapsack --orlib path/to/mknap2.txt --instance-index 0 --summary-only

The package also bundles two standard benchmark files for direct verification after installation:

mmao tsp --benchmark berlin52 --summary-only
mmao knapsack --benchmark mknap2 --instance-index 0 --summary-only

You can also run the Python example:

python examples/quickstart.py

Python API

from mmao.api import optimize_continuous
from mmao.continuous import MMAOContinuousConfig, rastrigin_problem

problem = rastrigin_problem(dimension=10)
result = optimize_continuous(problem, MMAOContinuousConfig(iterations=80, seed=7))
print(result["best_fitness"])

For file-based benchmark loading:

from mmao import load_tsplib_problem, load_orlib_mkp_instance, optimize_tsp, optimize_knapsack

tsp_problem = load_tsplib_problem("berlin52.tsp")
mkp_problem = load_orlib_mkp_instance("mknap2.txt", index=0)

Package Structure

mmao/
  continuous/      continuous optimization
  discrete/        tsp and knapsack
  dynamic/         dynamic optimization
  classification/  feature selection and classifier tuning
  io/              optional loaders such as TSPLIB
  cli.py           command-line interface

Scope of This First Release

This first release focuses on a clean and usable public package interface. It already exposes the major MMAO problem families, but it is still a research-oriented release rather than a fully stabilized production library.

Near-term improvements will likely include:

  • richer benchmark adapters
  • experiment orchestration utilities
  • result serialization helpers
  • stronger dataset and problem loaders
  • broader documentation for paper-level reproducibility

Testing

Run the smoke tests with:

pytest

The repository currently includes:

  • API smoke tests
  • CLI smoke tests
  • data-loader tests
  • source and wheel build validation

For public trust and regression control, CI is defined in .github/workflows/ci.yml.

Citation

Please use CITATION.cff for software citation metadata.

Recommended practice:

  • cite the repository or mmao-opt package for software availability and reproducibility
  • cite the foundational MMAO paper for the core optimizer
  • cite the relevant derivative paper for domain-specific discussion such as dynamic optimization or classification-oriented search

Additional orientation documents:

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

mmao_opt-0.1.0.tar.gz (49.0 kB view details)

Uploaded Source

Built Distribution

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

mmao_opt-0.1.0-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

Details for the file mmao_opt-0.1.0.tar.gz.

File metadata

  • Download URL: mmao_opt-0.1.0.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mmao_opt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b9e89e40183d4cad3cf9742626e2e40054b37fa39f9771fc1897c8e63607946e
MD5 8b601cacb97f7601bbb2149f2a916a33
BLAKE2b-256 b20e858657d432d541eb6f3bd8c1e97168cdf239c442278eeaf948911f20d349

See more details on using hashes here.

File details

Details for the file mmao_opt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mmao_opt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mmao_opt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5d1e4157dbb30964e57ad74624aba14fb7e4c66598c3dbf55d3d90438b491f3
MD5 289c7233c0e8502f8dcf0159b4da64e1
BLAKE2b-256 5d018712963802dc30a2763589cccd68a297596b87aabdd3ce0c4fd882f7345f

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