docplex (a.k.a. IBM® Decision Optimization CPLEX® Modeling for Python) is a Python modeling API that provides modules for mathematical programming via CPLEX and constraint programming via CP Optimizer.
Questions tagged [docplex]
316 questions
0
votes
1 answer
Developing desktop app by python with cplex packages
I want to develop an app for my linear programming script in python, and when I installed python cplex API, and docplex that needed cplex optimisation studio to be installed in my computer.
my question is does the user need to install cplex…

Amiine
- 1
0
votes
1 answer
How to use nested IF-THEN constraints in DOCPLEX (Python)?
I am modeling the situation I want using python cplex.
While using it, a few questions arose, and these are:
Can I use nested IF-THEN constraints in CPLEX?
First, I could find below how to use the basic IF-THEN constraint.
How to use Continuous…

pioneer
- 103
- 1
0
votes
1 answer
'Maximum polynomial degree is 2' docplex's error
I am using docplex (docplex.md.model) for a minimization problem, and my objective function has a product of three variables (one continuous and two binaries), when running the code I got this error:
DOcplexException: Cannot multiply -x1*x21 by x2,…

walid
- 285
- 1
- 2
- 8
0
votes
1 answer
CpoException: Executable file should be given in 'execfile' context attribute
the line in question that is giving me problems is the following:
msol = mdl.solve(TimeLimit=20, trace_log=False, execfile='\Applications\CPLEX_Studio_Community201\cpoptimizer\bin\x86-64_osx\cpoptimizer.exe')
Producing the following…

Manuel Lopez
- 1
- 1
0
votes
1 answer
Translation of a mathematical summation into code
I'm playing with docplex on Python and I'm facing some difficulties.
I wanto to code the Mathematical expressions
attached in the image as constraints, but it is quite hard for me. I know that t and T are fixed values.
I coded the first constraint…

Fab
- 1
- 3
0
votes
1 answer
CPLEX with student edition on google colab
I have google colab but I get the warning for using CPLEX and Docplex :
9 frames
CplexSolverError: CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016.
During handling of the above exception,…
0
votes
1 answer
[docplex error]-docplex.mp.utils.DOcplexLimitsExceeded: **** Promotional version. Problem size limits (1000 vars, 1000 consts) exceeded
I want to use docplex module in python and I have installed CPLEX version 20.10 and installed python 3.7.9.
When I tried to run the code, I got the error:
docplex.mp.utils.DOcplexLimitsExceeded: **** Promotional version. Problem size limits (1000…
0
votes
0 answers
How can I optimize the search in a CSP problem using docplex (CpoModel)
I am using docplex (CpoModel) with Python to solve a CSP and I have the following problem: when I test it with a very simple infeasible problem, it does not return that the problem is infeasible in a reasonable amount of time (it never stops).…

user606273
- 143
- 6
0
votes
1 answer
CPLEX - batch quantity
I have seen comparable questions in other programming languages but haven't been able to solve the below in CPLEX.
I have two conditions that need to be met.
Produced icecreams can only be used per flavoured batch of 60 and consumable for the same…

BST
- 11
- 1
0
votes
1 answer
Docplex bug for kpi_value_by_name method of Solution object
I think I found a very little bug in https://ibmdecisionoptimization.github.io/docplex-doc/mp/_modules/docplex/mp/solution.html#SolveSolution.kpi_value_by_name
Minimal reproducible example:
from docplex.mp.model import Model
mdl = Model("test")
a…

GuglielmoSanchini
- 27
- 7
0
votes
2 answers
How to export docplex solutions in Python?
I use docplex.model.print_solution() to get solutions in the console. How can I export all the solutions to a file?
Thanks
0
votes
1 answer
IBM CP Optimizer Community Edition
I get the following message when using docplex in Python:
Solver error: Problem size limit exceeded.
CP Optimizer Community Edition solves problems with search spaces up to 2^1000.
Unrestricted version options (including academia) at…

find
- 3
- 1
0
votes
1 answer
How to pass a solution into an model as a fixed start in docplex?
I have two models: an initial model and a more complex model with more decision variables. I need to use the solution to the first model as a fixed start for the second model but can't figure out a way to do this automatically. The decision…

chipmack88
- 3
- 2
0
votes
1 answer
How to get a solution after stopping a model in docplex?
I try to solve a model in docplex(python) and I add a time limit to stop the model; I want return the last upper bound when the model was stopped.

Nada.M
- 103
- 4
0
votes
2 answers
How to implement time limit in Docplex
I am using Docplex (Cplex python version) with a minimization objective. As it takes a long time to find the optimum I would like to set a timelimit and receive the found solution at that time.
To limit the time I have tried the following but it…

Mado_xx
- 1
- 2