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.1.0.tar.gz (73.2 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.1.0-py3-none-any.whl (87.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: perm_pateda-0.1.0.tar.gz
  • Upload date:
  • Size: 73.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 e703b8a8152e47df7e0f4fa68eaba12829ac94ffa79454c13a2ff83d03bbbe82
MD5 f35e1ea14c31145f9510e96465b1224d
BLAKE2b-256 9728dba51a6c318812012df8b90f404286cc92b0ddb5dcf15d20cf0ce9cbf4b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for perm_pateda-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: perm_pateda-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 87.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c097925d512c9ae3e0a0613c1a12dddb6e62e712d01a8d5b6b2f800968c8e2c6
MD5 6e98621a068c9a11b3eef9b5a622bbf9
BLAKE2b-256 d6d58fceb96c4afae82dd8648109121ea673fc724d36e93d2c37a4f1ece874f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for perm_pateda-0.1.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