Skip to main content

MOSADE

CI PyPI Python License: MIT

Multi-Objective Self-Adaptive Differential Evolution — a Python library for multi-objective optimisation over real-valued decision variables, including constrained problems.

MOSADE combines several differential-evolution mutation strategies under an online, self-adaptive credit-assignment scheme, decomposition-based environmental selection, per-strategy parameter memories, and ε-constraint handling for constrained problems. It ships with the standard ZDT, DTLZ and WFG suites, the constrained DAS-CMOP suite, and real-world CRE problems, together with the usual quality indicators (HV, IGD, IGD+, GD, spread).

It also interoperates with pymoo: the comparison baselines are pymoo's own algorithm implementations, run on MOSADE's problems and scored by the same indicators, using the same problem and metric interfaces to reduce implementation differences rather than relying on re-implemented competitors.

Installation

Install the latest released package from PyPI:

python -m pip install mosade

Python 3.10 or newer is required. Install the optional analysis and pymoo baseline dependencies with:

python -m pip install "mosade[analysis,baselines]"

For development from source:

git clone https://github.com/Levvvi/MOSADE.git
cd MOSADE
python -m pip install -e ".[dev,analysis,baselines]"

Quick start

import numpy as np
from mosade.problems import ZDT1
from mosade.algorithm import MOSADE
from mosade.metrics import hypervolume, igd

# Pick a benchmark problem (or subclass mosade.problems.Problem with your own).
problem = ZDT1(n_var=30)

# Run MOSADE. A fixed seed makes the run deterministic within the pinned, tested environment. (~20 s)
result = MOSADE(pop_size=100, max_evals=25_000, seed=0).run(problem)

print("non-dominated solutions:", result.F.shape)   # (200, 2)
print("function evaluations:   ", result.n_evals)    # 25030

# Score the approximation set against the analytical Pareto front.
pf = problem.pareto_front(200)
print("hypervolume (ref 1.1):  ", round(hypervolume(result.F, ref=np.array([1.1, 1.1])), 4))  # ≈ 0.854
print("IGD:                    ", round(igd(result.F, pf), 4))                                  # ≈ 0.013

result.F and result.X are the objective and decision vectors of the final non-dominated set; result.history holds per-generation diagnostics (strategy usage, parameter memories, convergence snapshots).

To run a configured experiment from the command line:

python scripts/run_experiment.py --config configs/smoke_test.yaml

What's inside

  • Algorithms (mosade.algorithm): MOSADE, plus NSGA2 and MOEAD reference implementations and a PymooAlgorithm adapter that runs pymoo's algorithms as comparison baselines on MOSADE's own problems.
  • Problems (mosade.problems): ZDT1–4 and ZDT6, DTLZ1–4 and DTLZ7, WFG1–9, the constrained DAS-CMOP1–9 suite, and real-world CRE problems — all sharing one Problem interface with a g(x) <= 0 feasibility convention.
  • Metrics (mosade.metrics): hypervolume, igd, igd_plus, gd, spread.
  • Reproducibility: per-run seeding via NumPy's SeedSequence (statistically independent streams, not offset base seeds). See REPRODUCIBILITY.md.

Benchmarking and reproduction

The full experiment harness — multi-run benchmarking, statistical comparison (Wilcoxon signed-rank with Holm correction and Vargha–Delaney A12 effect sizes), and figure/table generation — lives under experiments/ (the mosade_experiments package) and is intentionally kept out of the installed library. See REPRODUCIBILITY.md for the recommended workflow.

Testing and coverage

pytest                                               # full suite
pytest --cov=src/mosade --cov-report=term-missing    # with coverage

On the 0.1.1 release commit, a clean test run reports 287 passed and 5 skipped. Line coverage for the shipped library (src/mosade) is 89%, with CI enforcing at least 85% on Python 3.10, 3.11, 3.12, and 3.13.

The suite emphasises what matters for a stochastic optimiser: seed-determinism, structural invariants (population size, decision bounds, constraint feasibility), indicator correctness against analytically known Pareto fronts, and regression snapshots — not line coverage for its own sake.

Project layout

src/mosade/     # the installable library: algorithm, problems, metrics, runner
experiments/    # thesis benchmarking and analysis tooling (not packaged)
tests/          # library test suite
configs/        # example experiment configurations

License

Released under the MIT License — see LICENSE.

Metadata

Release files for mosade 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mosade 0.1.1
File Size Uploaded
mosade-0.1.1.tar.gz 86.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mosade 0.1.1
File Interpreter ABI Platform
mosade-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 167.0 kB

Release files / mosade-0.1.1.tar.gz

Download URL mosade-0.1.1.tar.gz
Size 86.9 kB
Tags Source
SHA-256 checksum
How to use checksums
50c5bd74272fa0b78c6fe216a8970e17599aaf631d95493eb0ee597b4636fb31
BLAKE2b-256 checksum
How to use checksums
86dfe35e068e5f5bf60220971c703e4a9fe92f5ae9fafc98cdee422dfcb3f19c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / mosade-0.1.1-py3-none-any.whl

Download URL mosade-0.1.1-py3-none-any.whl
Size 80.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa11694c7d957d8c923ec06c1f5081ae0dea12d735e11b5d9e38cea19a1ac6cb
BLAKE2b-256 checksum
How to use checksums
b27ce7efd7503a9ad81822ec98922054e2e1e7b8e8fc2b6b5515342abde5910d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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