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
2 answers
TypeError with docplex 2.10.15x
After switching from docplex 2.9.141 to version 2.10.150 (same with 2.10.151) I started having the following error when trying to call solve on my model (using my docloud credentials).
I expect that this problem is caused by the fact that the class…

Paul V
- 196
- 1
- 8
0
votes
1 answer
Documents and Syntax Reference for docplex
I was wondering if anyone could guide me to obtain a kind of document that specifically contains all syntax of CPLEX library on Python 2.7. and probably an example to show the arguments.
The syntax I am looking for is that I need to see just one or…

MOAR
- 15
- 6
0
votes
1 answer
How do I setup an objective function in CPLEX Python containing indicator functions?
The following is the objective function:
The idea is that a mean-variance optimization has already been done on a universe of securities. This gives us the weights for a target portfolio. Now suppose the investor already is holding a portfolio and…

Rick Owens
- 3
- 3
0
votes
1 answer
How to install docplex package in Anaconda?
I'm trying to install docplex on a work computer and was wondering where the error is coming from when I try to install it.
I'm using Anaconda3-5.2.0 and Python 3.6.5.final.0. I'm running anaconda prompt and typing in the following code:
conda…

Danny B
- 355
- 2
- 13
0
votes
1 answer
VRP heterogeneous site-dependency
In my code, I managed to implement different vehicle types (I think) and to indicate the site-dependency. However, it seems that in the output of my optimization, vehicles can drive more then one route. I would like to implement that my vehicle,…

Anne-Fleur
- 1
- 1
0
votes
1 answer
Indicators constraints (object of type 'generator' has no len())
I'm working in a VRP optimization problem based in a tutorial.
When I add the subtours constraint I get an error.
I was following this tutorial: https://www.youtube.com/watch?v=eMsqsmftWOQ&t=2398s
from docplex.mp.model import Model
mdl =…

Godoy32
- 35
- 5
0
votes
2 answers
how to set a four dimension variable in docplex with python?
I want to set a binary four-dimensions variable, like X[a][b][c][d], bur docplex only have function binary_var_cube to set a three-dimension. How can I to create a four-dimension?
I have found that someone use this to create a three-dimension and…

zhongyao zhang
- 21
- 4
0
votes
0 answers
Binary parameter
How can I write a binary variable as a parameter using python docplex?
Y[k,m,t]=(1, if participant will have meal m in restaurant k on day t
0, otherwise)
0
votes
1 answer
How does docplex find the best bound?
I really can't understand how does CPLEX compute the best bound in the first place. From my understanding CPLEX needs to explore all the nodes in order to find the best bound or the objective value that maximises or minimizes all feasible solutions.…

sel
- 942
- 1
- 12
- 25
0
votes
0 answers
Is it better to have one constraint or multiple?
If I have multiple positive decision variables that I want to constrain based on some factor to be == 0, is it better to add one constraint or multiple?
Here is a greatly simplified example:
var1 == 0
var5 == 0
var7 == 0
or
var1 + var5 + var7 == 0
I…

webe3
- 103
- 1
- 8
0
votes
2 answers
How to interpret the log output of docplex optimisation library
I am having a problem interpreting this log that I get after trying to maximise an objective function using docplex:
Nodes Cuts/
Node Left Objective IInf Best Integer Best Bound ItCnt …

sel
- 942
- 1
- 12
- 25
0
votes
1 answer
Error creating job on cplex enterprise server with REST API
I am trying to create a new job using the REST API on CPLEX Enterprise Server.
I am using curl and this is my command
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d "{\"attachments\": [{ \"name\":…

O. Escobedo
- 3
- 5
0
votes
1 answer
Why IBM optimizer studio OPL gives different results than docplex?
Here is the optimization-problem, I am trying to solve (with a little twist, with the opl code I use.
The opl code gives me two solutions namely: {Product12,Product31}
When I translate this to the python language using docplex using this code:
from…

sel
- 942
- 1
- 12
- 25
0
votes
1 answer
Cplex(Python), is it normal that model.solution is giving different results than model.print_solution()?
I am actually having a problem accessing the solutions after solving an optimization problem using docplex.
Below I am posting the full code I am using, as long as the results I get (The results are commented):
The optimization problem is fully…

sel
- 942
- 1
- 12
- 25
0
votes
1 answer
To run mining_pandas.IPYNB locally
I'm using Cplex Studio Community 12.8 on Windows 64.
I've installed docplex using conda install -c ibmdecisionoptimization docplex.
To solve mining_pandas.IPYNB, the current command is:
s1 = mm.solve(url=url, key=key, log_output=print_cplex_log)
How…

Deb
- 77
- 6