All Questions
16 questions
0
votes
1
answer
28
views
Docplex use for timeseries based variables
I am trying to model an optimisation problem where each item in a list is essentially power generated at that hour. I am trying to minimise the amount of energy stored while still getting the same ...
0
votes
1
answer
43
views
Limit the memory used when solving using docplex
I am implementing a mathematical model using docplex and the academic version of CPLEX.
I am attempting to solve very big problem instances.
I faced a MemoryError.
Is there a way to overcome this? I ...
10
votes
3
answers
25k
views
How to resolve `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead error from docplex?
I'm trying to rerun an older code (about a year old). I have installed academic version of CPLEX 22.1.1 version and Python API and docplex in python.
However, the dependencies have changed and ...
0
votes
2
answers
651
views
docplex.mp.utils.DOcplexException: Expecting sequence of linear constraints, got: docplex.mp.QuadraticConstraint[]
Please pardon my ignorance. I was trying my understanding on Docplex. I produce this code to model optimization equations as shown in the picture below. My main concentration is constraint 2c, I can't ...
1
vote
1
answer
962
views
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/...
0
votes
1
answer
671
views
Is there a bug with using timelimit within pulp in python using CPLEX?
I am currently writing my thesis, where I want to implement an algorithm to converges towards a good solution using a large OR model.
I can include the model, if you will need it to answer my question ...
0
votes
1
answer
165
views
My cplex script does not work on python with no error
I have been using Cplex and docplex (on python) on my PC for a long time and it was working fine. But lately when I run my script it starts the engine but it sticks at the beginning for a very long ...
0
votes
1
answer
568
views
Obtaining different solutions on solving a cplex model many times
I have an MIP model written with docplex and a solution pool written with cplex. My model has billions of solutions in reality. I need to solve this model several times (10 for example) with a certain ...
1
vote
1
answer
189
views
How to change Cplex model during solution generation?
I have a Cplex model with several constraints and a solution pool. One of my constraint is :
R_alt=[i for i in R if i not in SetAlt]
model.add_constraints((model.sum(x[i, j] for j in R2 ) == ...
1
vote
1
answer
308
views
Getting unique solutions with python cplex solution pool
I have an MILP model that I try to solve with cplex python API. I need to get more than one solution. The problem is that when I get for example 50 solutions from my cplex pool, these solutions are ...
0
votes
2
answers
195
views
Issue with accessing different types of variable values in cplex solution pool
I have this MILP model that I am solving by cplex python API:
def CModel():
mdl=Model('Generate')
#variable declaration
y=mdl.binary_var_dict(ijk,name='y')
Sum=mdl....
0
votes
2
answers
2k
views
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 ...
1
vote
1
answer
894
views
Select a specific python version for CPLEX installation (Windows 10)
I'd like to install IBM ILOG CPLEX Optimization Studio 12.9.0 (by double-clicking on its ".exe" executable file) on my PC which runs Windows 10.
In this link there's a brief installation guide, which ...
0
votes
1
answer
752
views
how to define an indicator constraint in docplex python API?
I want to model an integer programming example with docplex in python. for an indicator constraint I have this equation (X is a binary variable):
I wrote this code :
for i1,i2,i3 in P:
mdl....
5
votes
1
answer
2k
views
how to get value of elapsed time after using CPLEX Python API
I'm using CPLEX python API to solve an optimization problem. The model is named DOT. When I run DOT.solve(), many information occur in the python console:
Iteration log ...
...
Network - Optimal: ...