Discrete optimization library
Project description
Discrete Optimization
Discrete Optimization is a python library to ease the definition and re-use of discrete optimization problems and solvers. It has been initially developed in the frame of scikit-decide for scheduling. The code base starting to be big, the repository has now been splitted in two separate ones.
The library contains a range of existing solvers already implemented such as:
- greedy methods
- local search (Hill Climber, Simulated Annealing)
- metaheuristics (Genetic Algorithms, NSGA)
- linear programming
- constraint programming
- hybrid methods (LNS)
The library also contains implementation of several classic discrete optimization problems:
- Travelling Salesman Problem (TSP)
- Knapsack Problem (KP)
- Vehicle Routing Problem (VRP)
- Facility Location Problem (FLP)
- Resource Constrained Project Scheduling Problem (RCPSP). Several variants of RCPSP are available
- Graph Colouring Problem (GCP)
In addition, the library contains functionalities to enable robust optimization through different scenario handling mechanisms) and multi-objective optimization (aggregation of objectives, Pareto optimization, MO post-processing).
Installation
Prerequisites
-
Install minizinc.
-
Optionally, install gurobi with its python binding (gurobipy) and an appropriate license, if you want to try solvers that make use of gurobi.
NB: If you just do
pip install gurobipy
, you get a minimal license which does not allow to use it on "real" models.
Normal install
Install discrete-optimization from pip:
pip install discrete-optimization
Install in developer mode
You can also install the library directly from the repository in developer mode:
git clone https://github.com/airbus/discrete-optimization.git
cd discrete-optimization
pip install --editable .
If you encounter any problem during installation, please fill an issue on the repository.
Examples
Notebooks
In the notebooks
directory of the repository, you will find several jupyter notebooks demonstrating
how the library can be used
- on a knapsack problem,
- on a scheduling problem (RCPSP).
Scripts
The examples
directory of the repository gather several scripts using the different features of
the library and how to instantiate different problem instances and solvers.
Unit tests
Unit tests are available in tests/
directory of the repository.
To test the library, you can install the library
with the "test" extra dependencies by typing
git clone https://github.com/airbus/discrete-optimization.git
cd discrete-optimization
pip install --editable .[test]
Then run pytest on tests folder:
pytest -v tests
License
This software is under the MIT License that can be found in the LICENSE file at the root of the repository.
Some minzinc models have been adapted from files coming from
- https://github.com/MiniZinc/minizinc-benchmarks under the same license,
- https://github.com/youngkd/MSPSP-InstLib for which we have the written authorization of the author.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for discrete_optimization-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 895ad8e5234807c205261547ca1945e71bbd314b5712236b8c077217453627a0 |
|
MD5 | 5376f4865c183e1967977397032e9736 |
|
BLAKE2b-256 | 377f2838204ea60665428d4957d5b3b64743c535172a197f23c2e0acb6fc7539 |