Skip to main content

Multi-objective optimization using dynamic programming to find Pareto-optimal solutions

Project description

pareto_dp

Simple multi-objective optimization using dynamic programming to approximate the Pareto frontier.

Written in Rust, published as a Python PyPI package with PyO3 and maturin.

Problem specification

This library solves a multi-objective multiple-choice combinatorial optimization problem with additive separable objectives, designed for scenarios with precomputed data for independent decision points.

Core user-facing properties

  • Independent groups: The problem consists of n independent groups (e.g., decision stages, components) with no interdependencies.
  • Additive objective aggregation: The total objective vector for a configuration is the sum of per-group contributions. For a configuration x (one scenario chosen per group), the v-dimensional objective is: $$ F(x) = \sum_{i=1}^n a_{i,x_i} \in \mathbb{R}^v $$ where a_{i,j} is the precomputed objective vector for group i, scenario j.
  • Precomputed lookup table: All per-group, per-scenario objective values are precomputed (table-lookup/black-box). The library takes this 3D lookup table as direct input.

Formal structure

  • n independent groups (typical n ~ 300)
  • Each group i has m_i ∈ [3,12] scenarios (branching options)
  • Multiple-choice constraint: A configuration selects exactly one scenario per group
  • v objectives (typical v ~ 6), precomputed as a_{i,j} ∈ ℝᵛ
  • Goal: Compute the Pareto-optimal frontier in the v-dimensional objective space

Scale challenge

The configuration space size is |X| = ∏_{i=1}^n m_i, which grows exponentially with n. Exhaustive search is infeasible for large n, so the library uses dynamic programming with epsilon-dominance pruning to efficiently approximate the Pareto front.

Installation

pip install pareto-dp

Usage

from pareto_dp import find_pareto_front

# Define your multi-objective optimization problem
# Each stand has multiple scenarios, each scenario has objective values
data = [
    [[3.0, 2.1], [2.0, 1.0]],  # Stand 0: 2 scenarios, 2 objectives
    [[1.0, 1.0], [2.0, 0.5]],  # Stand 1: 2 scenarios, 2 objectives
]

# Find Pareto-optimal solutions with epsilon precision
solutions = find_pareto_front(data, epsilon=0.01)

for sol in solutions:
    print(f"Design: {sol.design_vector}, Objectives: {sol.target_vector}")

API

find_pareto_front(data, epsilon)

Finds all Pareto-optimal solutions for a multi-objective optimization problem.

Parameters:

  • data (List[List[List[float]]]): A 3D list where:
    • First dimension: decision points
    • Second dimension: options for each decision point
    • Third dimension: objective variable values (e.g., [cost, time, quality])
  • epsilon (float): Precision parameter for epsilon-dominance pruning

(Note: the context in which this problem originated is forestry land-use, so decision points are called stands in the code, and options are called scenarios).

Returns:

  • List of ParetoFrontSolution objects, each with:
    • design_vector (List[int]): Which scenario to pick for each stand
    • target_vector (List[float]): The summed objective values for that design

Raises:

  • ValueError: If data is empty, has only one stand, or has inconsistent dimensions

Algorithm

The algorithm uses dynamic programming to efficiently find the Pareto front:

  1. Data Validation: Validates input structure and dimensions
  2. Shift to Positive Space: Shifts all objective values to positive space for numerical stability
  3. DP Tree Construction: Builds partial Pareto fronts iteratively for each stand
  4. Epsilon-Dominance Pruning: Uses logarithmic binning to prune dominated solutions
  5. Solution Reconstruction: Traces back through parent pointers to reconstruct full solutions

Requirements

  • Python >= 3.9
  • Compatible with CPython and PyPy

License

MIT License - see LICENSE file for details.

Repository

https://github.com/Txart/pareto_dp

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

pareto_dp-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

pareto_dp-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl (254.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

File details

Details for the file pareto_dp-0.1.1.tar.gz.

File metadata

  • Download URL: pareto_dp-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for pareto_dp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89ea683180273cd48499f2dc07993eef53b742729d96b9638d1d840774fdb9a4
MD5 73c50a21977d88724388685e6c25893f
BLAKE2b-256 448e28e912e5c8ab84e034f92ffe68b54cfd0bea4ef8d365d3c2f4754ec95380

See more details on using hashes here.

File details

Details for the file pareto_dp-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pareto_dp-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a6f5ba2c1f33b9c0bd45f7e55e77a36af9a16279c50c9594af1f674bc8f6005d
MD5 291754d12ccc44a42baa7c9d0f540997
BLAKE2b-256 c5f6a8c062109309b21bacf9c2bde25654122b48734b5e15bcdfa4b0beb1ada9

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