Welcome to the IBM® Decision Optimization Modeling for Python. Licensed under the Apache License v2.0.
With this library, you can quickly and easily add the power of optimization to your application. You need IBM ILOG CPLEX Optimization Studio to solve the models.
This library is composed of 2 modules:
- IBM® Decision Optimization CPLEX Optimizer Modeling for Python - with namespace docplex.mp
- IBM® Decision Optimization CP Optimizer Modeling for Python - with namespace docplex.cp
This library is numpy friendly.
- Python: 3.10 or (higher)
- DOcplex (Decision Optimization CPLEX Modeling for Python):
pip install docplexpip install cplexThe Community Edition is free and suitable for learning and small-to-medium problems. However, it has limitations on problem size (1000 variables, 1000 constraints).
Note: For larger problems or commercial use, you'll need the full version of CPLEX Optimization Studio or an academic license.
If you have IBM ILOG CPLEX Optimization Studio installed, you can install the Python API from the installation directory:
# Navigate to your CPLEX installation directory
cd <CPLEX_INSTALL_DIR>/python
# Install the package
python setup.py installIf CPLEX is installed separately, configure DOcplex:
docplex config --upgrade <COS_INSTALL_DIR>
This ensures DOcplex correctly detects your CPLEX installation.
DOcplex provides a higher-level API and works with both CPLEX and IBM Decision Optimization on Cloud. See the DOcplex examples repository for more information.
- Latest documentation
- Documentation archives:
- Examples
-
You can get a free Community Edition of CPLEX Optimization Studio, with limited solving capabilities in term of problem size.
-
Faculty members, research professionals at accredited institutions can get access to an unlimited version of CPLEX through the IBM® Academic Initiative.
These third-party dependencies are automatically installed with pip
This library is delivered under the Apache License Version 2.0, January 2004 (see LICENSE.txt).