Questions tagged [cplex-python-api]
The cplex-python-api tag has no summary.
31 questions
0
votes
2
answers
63
views
Markowitz Portfolio : Solution differs between Lingo and Cplex
I am working on the Markowitz Quadratic Portfolio optimization.
I have this Lingo code :
...
2
votes
1
answer
95
views
Docplex CP Model Solution Found but Can't Retrieve Decision Variable Values
I'm using Docplex's Constraint Programming model with two 4-dimensional binary decision variables:
...
2
votes
1
answer
873
views
CPLEX 20.1.0.0 and python version 3.10
I am trying to develop in python 3.10, and locally I have cplex 20.1.0.0 installed. It appears to me that the python interface cplex only supports python version 3....
2
votes
1
answer
173
views
Can a logical expression be added to the objective function of a model in docplex?
I'm working on an optimization problem using Docplex and wonder if it's possible to incorporate a logical expression into the objective function of my model.
Specifically, I have three variables x, y, ...
3
votes
1
answer
350
views
Dual problem in IBM CPLEX
Im solving n-dimensional Knapsack problem as LP problem.
I noticed that sometimes dual LP problem may be solved much faster than primal.
My test problem contains 500k variables and 50k constraints, ...
2
votes
1
answer
338
views
Updating constraint set rhs in docplex
I am trying to update the rhs of a constraint iteratively under a while loop in docplex, however, it does not work properly. As I analyze the output text file, while some constraints are updated as I ...
3
votes
2
answers
368
views
Modifying and re-optimizing a model using CPLEX Python API
I came across the following functionality that is offered by CPLEX for modifying and re-optimizing a model based on previous computations: https://perso.ensta-paris.fr/~diam/ro/online/cplex/cplex1271/...
4
votes
0
answers
2k
views
Google-OR tools vs Pyomo and other commercial Solvers for solving a simple maximum flow problem
I have implemented a Pyomo model for solving maximum flow problem as a subroutine of an algorithm. However, the approach does not scale very well because Pyomo does not provide a very good way to re-...
3
votes
1
answer
254
views
Sensitivity analysis for specific sets of constraints on DoCplex
I am working on DoCplex to run a large model with several variables and constraints. I used the following link from sensitivity analysis in python + Docplex to run the sensitivity analysis. In that ...
2
votes
2
answers
449
views
Using CPLEX academic version with Pyomo on MacOS
I have recently tried to use the CPLEX solver to solve one of my Pyomo models. I first installed the community version that is available:https://pypi.org/project/cplex/ using ...
2
votes
1
answer
384
views
How to do matrix multiplication in docplex in python?
Here's an applicative problem I'm trying to solve. Imagine there is a road that can be classified in 5 states. Can be something from good to bad etc. There are 4 maintenance actions possible. And the ...
1
vote
0
answers
187
views
User callback doing nothing slows down Cplex
I am trying to do something with user callbacks in Cplex using Python API. For instance, I will need a callback that only counts the number of explored nodes.
While testing something I noticed that ...
2
votes
1
answer
77
views
Objective value estimate for branches I create in Cplex
I' implementing custom branching heuristics for Cplex in python. I have a way to choose a (binary) variable to branch on, so use the following code to create two branches from BranchCallback (...
4
votes
0
answers
235
views
2
votes
1
answer
690
views
Getting all active constraints of an LP from Cplex
I was wondering if it is possible to get the active constraints of a linear program from the Python API of Cplex? Or do I have to go through the constraints one by one and check if they bind with ...