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
BrokenProcessPool error while trying to run docplex example
I am trying to run some cplex models in parallel with python process pool. I tried to run this as an example of process pool with docplex on my windows 10 -spyder 3.6.9.
When I run I get this error :
File…

Sana.Nz
- 81
- 11
0
votes
1 answer
Issue with running multiple cplex models in parallel using multiprocessing
I want to solve multiple cplex models simultaneously using python multiprocessing. I understand that the basic example of multiprocessing in python is something like:
from multiprocessing import Process
def func1():
'''some code'''
def…

Sana.Nz
- 81
- 11
0
votes
1 answer
Print docplex solve() results in a dataframe
I have created a optimization model using docplex package.
This is how I have defined the decission variable.
x = {(i.supply,i.demand,i.product): tm.integer_var(name='x_{0}_{1}_{2}'.format(i.supply,i.demand,i.product),ub=10000000) for i in…

suresh_chinthy
- 377
- 2
- 12
0
votes
1 answer
How to output the final tableau of simplex method in docplex?
Is there a way to output the final tableau in python with docplex library? If not, is there a work around?
I want to use dual simplex method to solve linear programming problem with newly added constraints. So, I would need to access the final…

Aaron_Geng
- 189
- 1
- 1
- 14
0
votes
1 answer
How to output simplex multiplier with Cplex (docplex)?
I am using python with docplex library to solve a linear programming problem. I want to get its simplex multipliers, or coefficients (of slack variables) in the final tableau.

Aaron_Geng
- 189
- 1
- 1
- 14
0
votes
2 answers
how to write a conditional constraint in CPLEX python?
I have a model that has one binary variable x [i] [j] [k]. I need to add a constraint that fullfils this condition:
if x[i][j][k1]==1 and x[j][i][k2]==1
Then:
k2-k1>8
I have this code but I assum it is not correct :
…

Sana.Nz
- 81
- 11
0
votes
1 answer
How to speed up cplex solution pool?
I have a MIP model that I need to generate its solution pool. Generating this pool takes around 5 minutes but I need to do this pool generation for 100k model, so I need this pool to run at least 8 times faster but unfortunately I don't have any…

Sana.Nz
- 81
- 11
0
votes
2 answers
Using the piecewise function of the IBM CPLEX python API, but the problem cannot be solved
I try to use MILP (Mixed Integer Linear Programming) to calculate the unit commitment problem. (unit commitment: An optimization problem trying to find the best scheduling of generator)
Because the relationship between generator power and cost is a…

JJZ
- 13
- 1
0
votes
1 answer
'or' within a constraint :docplex
Using OPL I could do the write below constraint.Mainly I used or(||) within a constraint and successfully get the results.na_supply_component is 2d decision variable
// MOQ (Minimum Order Quantity)
con2: forall(i in 1..12,j in…

suresh_chinthy
- 377
- 2
- 12
0
votes
3 answers
Completing binary matrix with cplex constraint programming
I want to generate a 20x38 binary matrix based on some constraints that I have using a dpcplex model. Some of the matrix cells are predefind as below (row,col,parameter):…

Sana.Nz
- 81
- 11
0
votes
1 answer
How do I bypass the 1000 variable limit in Cplex
I've created a MILP model to test using the Docplex library in python but I get this error message :
CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016.
How do I bypass this limitation? Is there…

TheGuardian
- 1
- 2
0
votes
1 answer
Bass model in DoCplex: how to assign variables in constraints
I am trying to build an optimisation program based on Bass model (see below):
Decision variables: p, m, q
Problem: min RMSE
Constraints:
Ft = (p + q(C(t-1)/m)(m - C(t-1))
Et = Ft - St
with C(t) being the cumulative sum of sales, St being the…

Sonia Grunenwald
- 21
- 3
0
votes
1 answer
How to increase number of Cplex solutions?
I have this cplex model that has 1 binay variable (x_i). Now I have 2 questions regarding its cplex solutions (I put them in one post because they are related).
First: For my model I get 26 solutions but I know in reality there are much more…

Sana.Nz
- 81
- 11
0
votes
1 answer
docplex with callback in dropsolve
Is it possible to solve a model that has a callback using model.solve(url=url, key=api)? I am trying an example similar to this but callback has no effect when called on dropsolve.

ooo
- 512
- 1
- 7
- 27
0
votes
1 answer
TypeError: can't multiply sequence by non-int of type 'list_iterator' in docplex
Solving 0-1 integer programming problem using docplex solver in python.
T_1_d = int((180+8*15-lon-math.acos(math.tan(10547*(math.pi)/81000*math.cos(2*(math.pi)*(date+9)/365))*math.tan(lat*(math.pi)/180))*180/(math.pi))/15)
T_1_d1 =…

Zhang
- 1