All Questions
14 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
137
views
Using the piecewise function in the objective function of the IBM CPLEX python API
I can't find the piecewise attributes when using Cplex in Python.
I know with docplex this can be done for example:
from docplex.mp.model import Model
mdl = Model(name='')
f=mdl.piecewise()
Is ...
1
vote
1
answer
59
views
How to write the constraint (A + B <= 1) in DOcplex?
I am new to DOcplex. I have two binary decision variables A and B and I wish to write the constraint (A+B <=1). I tried to write the constraint using "+" operator but it does not work.
...
0
votes
1
answer
173
views
Compute objective function in CPLEX
I am trying to solve the supplier diversification problem by minimizing the costs.
I basically have a list of pricing for an item from different suppliers. The suppliers are willing to give me some ...
0
votes
0
answers
170
views
Unable to solve a LP Problem in python using docplex
from docplex.mp.model import Model
m = Model(name="LP_Problem")
x1 = m.continuous_var(name="x1")
x2 = m.continuous_var(name="x2")
c11 = m.add_constraint( x1 + x2 <= ...
0
votes
2
answers
787
views
Running Docplex package in Python "docplex.mp.utils.DOcplexException: Cannot solve model: no CPLEX runtime found"
I wanted to solve my Oprimization model in Python by Cplex so I installed Cplex in my system (Windows 11) and based on Cplex help insttall setup.py with this command:
python C:\Program Files\IBM\ILOG\...
1
vote
1
answer
138
views
CPLEX solve one problem with many different inputs
I am solving a basic linear programming problem: min c*x, with an A*x = b constraint, using CPLEX with Python (DOCPLEX).
Then I run the above LP for 10k-100k different combinations of b and c (A stays ...
-1
votes
1
answer
190
views
Cplex Python Gaps
How can I print the gaps(each iteration) like OPL's engine in Python? I want to keep the gaps like this:
Nodes Cuts/
Node Left Objective IInf ...
0
votes
2
answers
217
views
Python Cplex Ceil() Function
ceil() in the constraint
Hello, I am studying a published paper. One of the constraints from this paper(which can be shown in the link) requires the ceil() function. We can use the ceil() function at ...
0
votes
1
answer
918
views
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 ...
0
votes
2
answers
397
views
How to code subtour constraint in cplex python
I am quite new in python cplex. I tried to model VRP and needed to eliminate subtours for feasible solution, but I cannot do that with the following code:
from docplex.mp.model import Model
import ...
0
votes
1
answer
318
views
DoCplex MILP problem: Running Benders & Branch and Bound Parallel
I am working on MILP model (In DoCplex) and solver reaches the solution faster with Benders Method sometime and sometimes using Branch & Bound. Is there an easy way to run both solve methods ...
2
votes
1
answer
2k
views
How to use Continuous Variables for IF-THEN constraints on DOCPLEX (Python)?
I'm using DOCPLEX to build up a Mixed Integer Linear Programming (MILP) problem which is then solved via CPLEX on Python. However, upon trying to solve the MILP problem using IF-THEN constraints, I ...
1
vote
0
answers
1k
views
cplex python model definition and variables
I recently started using CPLEX integrated in python for my master project and I have a hard time with one of my variables. I am modelling the charge and discharge of a battery in function of the wind ...