Skip to main content

Estimation of Distribution Algorithms for permutation-based optimization problems

Project description

perm_pateda

Estimation of Distribution Algorithms (EDAs) for permutation-based combinatorial optimization problems.

perm_pateda is an independent, permutation-focused companion to pateda. It contributes the model learning and sampling methods that are specific to permutation spaces — histogram models and distance-based Mallows / Generalized Mallows models — and reuses pateda for everything common to all EDAs (the core EDA engine, selection, replacement, statistics, and visualization utilities).

It is a Python port of the algorithms in perm_mateda (Irurozki, Ceberio, Santamaria & Mendiburu, 2018, Algorithm 989: perm_mateda — A Matlab Toolbox of Estimation of Distribution Algorithms for Permutation-based Combinatorial Optimization Problems, ACM TOMS 44(4), Article 47).


Relationship to pateda

pateda  ─────────────────────────────►  perm_pateda
(core EDA engine, selection,            (permutation learning + sampling,
 replacement, statistics, viz,           Mallows / GMallows models,
 discrete & continuous EDAs)             histogram models, TSP/QAP/LOP)

pateda is a dependency of perm_pateda. All permutation-related code has been removed from pateda and now lives here, so the two packages have a clean separation of concerns:

Concern Package
Core EDA loop, components, models pateda
Selection / replacement / statistics / visualization pateda
Discrete & continuous EDAs (UMDA, EBNA, Gaussian, …) pateda
Permutation distances (Kendall, Cayley, Ulam) perm_pateda
Mallows & Generalized Mallows learning/sampling perm_pateda
Edge / Node histogram models perm_pateda
Permutation problems (TSP, QAP, LOP) perm_pateda

Installation

pateda is an in-development package (not yet on PyPI), so install it first from the local checkout, then install perm_pateda:

# from the repository root (…/github/pateda)
pip install -e packages/pateda
pip install -e packages/perm_pateda

For development tooling (pytest, ruff, …):

pip install -e "packages/perm_pateda[dev]"

Requires Python ≥ 3.9, numpy, scipy, and pateda.


Quick start

import numpy as np
from perm_pateda import MallowsKendallEDA
from perm_pateda.functions import create_random_lop

# A Linear Ordering Problem instance on 15 items
lop = create_random_lop(15, seed=0)

alg = MallowsKendallEDA(
    n_vars=15,
    fitness_func=lop,        # callable: permutation -> scalar (higher is better)
    pop_size=100,
    n_gen=50,
    selection_ratio=0.3,
    random_seed=0,
)
stats, _ = alg.run()
print("Best fitness:", stats.best_fitness_overall)
print("Best permutation:", stats.best_individual)

Available algorithms

Plug-and-play wrappers (import from perm_pateda):

Class Model Distance
MallowsKendallEDA Mallows Kendall's-τ
MallowsCayleyEDA Mallows Cayley
GMallowsKendallEDA Generalized Mallows Kendall's-τ
GMallowsCayleyEDA Generalized Mallows Cayley
EHMEDA Edge Histogram Model
NHMEDA Node Histogram Model

See ROADMAP.md for the planned additions (Mallows–Ulam, BestPermutation consensus, the PFSP problem, and real-instance loaders) that complete the feature set of the perm_mateda toolbox.


Package layout

perm_pateda/
├── distances.py          # Kendall, Cayley, Ulam distances (+ helpers)
├── consensus.py          # central-permutation estimators (Borda, SetMedian)
├── learning/
│   ├── histogram.py      # LearnEHM, LearnNHM
│   └── mallows.py        # LearnMallows{Kendall,Cayley}, LearnGeneralizedMallows{Kendall,Cayley}
├── sampling/
│   ├── histogram.py      # SampleEHM, SampleNHM
│   └── mallows.py        # SampleMallows{Kendall,Cayley}, SampleGeneralizedMallows{Kendall,Cayley}
├── seeding/
│   └── permutation_init.py   # PermutationInit (random permutations)
├── functions/
│   ├── tsp.py            # Traveling Salesman Problem
│   ├── qap.py            # Quadratic Assignment Problem
│   └── lop.py            # Linear Ordering Problem
└── algorithms/
    └── permutation.py    # plug-and-play EDA wrappers

Citation

If you use the distance-based permutation EDAs implemented here, please cite the original toolbox:

E. Irurozki, J. Ceberio, J. Santamaria, and A. Mendiburu (2018). Algorithm 989: perm_mateda — A Matlab Toolbox of Estimation of Distribution Algorithms for Permutation-based Combinatorial Optimization Problems. ACM Transactions on Mathematical Software, 44(4), Article 47.

License

MIT — see LICENSE.

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

perm_pateda-0.2.0.tar.gz (75.3 kB view details)

Uploaded Source

Built Distribution

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

perm_pateda-0.2.0-py3-none-any.whl (96.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for perm_pateda-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5222e7e3df22e8de3532c5d5313ba6f0376b1b30e58467dc2792c8e97e697547
MD5 5fa14afbef62f9c71438d65e453c7a3c
BLAKE2b-256 736929d53a894069cb06952d9b705b6b0321e75ab1e287786577fa7f345484da

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on rsantana-isg/perm_pateda

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

File details

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

File metadata

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

File hashes

Hashes for perm_pateda-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a14f29c8dc455af965ff50ddb2c3de7e484af0b68dabaa3013ffbd87433f35d
MD5 3fddec5d959d04a91a649b7d99405e08
BLAKE2b-256 edd56826047e0674331e4fd9e58b1f66fb5152f77fd0690740d66b163e864025

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on rsantana-isg/perm_pateda

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 Pingdom Monitoring Sentry Error logging StatusPage Status page