Skip to main content

mmrbipy: A solver for the min-max regret binary integer programming problem (MMR-BIP)

Installation

In a virtual environment with Python 3.6+, mmrbipy can be installed via

pip install mmrbipy

Using mmrbipy

With a compatible instance file, mmrbipy solves the MMR-BIP from a Python script:

from mmrbipy import Model

# Generate a model from instance file
mod = Model(problem='kp', filename='../instance/KP/1-70-01-45-20')

# Solve by iDS algorithm with best-scenario constraints
mod.solve(algorithm='ids-b', timelimit=100)

# Print results
print("objective value: {}".format(mod.objval))
print("time to best: {:.2f}".format(mod.ttb))

# Write the results to file
mod.write("result.txt")

Model

To solve the MMR-BIP, mmrbipy provides five types of instance format:

  • min-max binary integer programming problem (bip)
  • min-max regret knapsack problem (kp)
  • min-max regret multidimensional knapsack problem (mkp)
  • min-max regret set covering problem (scp)
  • min-max regret generalized assignment problem (gap)

See instance page for the details of each type

Set problem type in constructor of Model class

# Generate a model from instance file
mod = Model(problem='kp', filename='../instance/KP/1-70-01-45-20')

Note: Benchmark instances for

  • min-max regret knapsack problem
  • min-max regret multidimensional knapsack problem
  • min-max regret set covering problem
  • min-max regret generalized assignment problem

are available in the instance directory on the project's homepage. For easy access to the example files, we recommend cloning the repository.

Algorithm

To solve the MMR-BIP, mmrbipy provides the following algorithms:

  • fixed scenario algorithm (fix);
  • Benders-like decomposition algorithm (bd);
  • branch-and-cut algorithm with Benders cuts (bc);
  • dual substitution algorithm (ds);
  • iterated dual substitution algorithm with best-scenario constraints (ids-b);
  • iterated dual substitution algorithm with Hamming-distance constraints (ids-h);
  • branch-and-cut algorithm for dual substitution model with best-scenario constraints (bcds-b);
  • branch-and-cut algorithm for dual substitution model with Hamming-distance constraints (bcds-h).

Set algorithm type in solve function

# Solve by iDS algorithm with best-scenario constraints
mod.solve(algorithm='ids-b', timelimit=100)

Note: The implement are based on gurobypy.

Additional information

For more information about the algorithms used in the solver, see Wu et al. (2022).

Metadata

Release files for mmrbipy 1.1.2

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

Source distribution (sdist)

Source distribution for mmrbipy 1.1.2
File Size Uploaded Provenance Actions
mmrbipy-1.1.2.tar.gz 9.1 kB Without provenance Details for mmrbipy-1.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 17.2 kB

Release files / mmrbipy-1.1.2.tar.gz

Download URL mmrbipy-1.1.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0cd3e8ac1f4e0af040cfd136094692b54ae99dc541e18b09aeda21c46f7fb685
BLAKE2b-256 checksum
How to use checksums
8c7ec90906dc70e20d37a3d47c7e04a5b4ee22ed7507071e327af75618df630e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

Release files / mmrbipy-1.1.2-py3-none-any.whl

Download URL mmrbipy-1.1.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57b5628968571ba2d7a5e5e2ccc291b87edc220712cabae735ba34ed753e27e1
BLAKE2b-256 checksum
How to use checksums
525b88566d873114659acb7936d74bc06e50075509c2a7816ce0325c03c2063a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

Security for mmrbipy 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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