Skip to main content

All 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 ...
Trev's user avatar
  • 23
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 ...
Jimmy Jimmy's user avatar
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. ...
troman's user avatar
  • 13
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 ...
M Germanos's user avatar
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 <= ...
Anil's user avatar
  • 1
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\...
Paria fakhrzad's user avatar
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 ...
Vidak's user avatar
  • 1,113
-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 ...
Tunahan Bilgiç's user avatar
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 ...
Tunahan Bilgiç's user avatar
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 ...
pioneer's user avatar
  • 103
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 ...
Mustafa's user avatar
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 ...
Kartik Kaushik's user avatar
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 ...
Muhammad Ali's user avatar
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 ...
anat's user avatar
  • 11