Questions tagged [docplex]

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.

316 questions
1
vote
1 answer

Cplex Python API intermediate LB and UB printout

I wish to solve a TSP in python using docplex, and would like to develop something resembles the Statistics plot in CPLEX Optimisation Studio and print out lower and upper bounds for each feasible solution found. The results I wish to receive from…
LuciaEv
  • 13
  • 4
1
vote
1 answer

doopl parameter setting in python

I'm playing with doopl in python. And I would like to set minimal gap tolerance with opl.cplex_stats.MiPRelativeGap()=5 which doesn't work. If possible, I want to make run-time limit. But I couldn't find and resources that has does parameter…
1
vote
1 answer

Is it possible to solve mixed-integer non-linear programming (MINLP) problem with CPLEX?

I am trying to solve a mixed integer non-linear programming (MINLP) problem. I am aware that CPLEX can solve a mixed integer quadratic programming (MIQP) problem where the objective function contains a quadratic formula (the product of at most two…
1
vote
1 answer

Implementing TSP with Lazy constraint callback

I am trying to TSP with Lazy constraint callback. From Answer given here and here, I have tried to use the code from the links and was able to add the call back function. Now I am struggling with add_lazy_constraints. Here is my current code: It is…
ooo
  • 512
  • 1
  • 7
  • 27
1
vote
1 answer

TSP implementation in docplex python

Is there any python implementation available of TSP using the IBM cplex tool, with Dantzig-Fulkerson-Johnson formulation. If there is any can I get the link for it?
ooo
  • 512
  • 1
  • 7
  • 27
1
vote
2 answers

Python + CPLEX : No module named 'docplex'

I have the following problem after having installed matplotlib and seaborn : from docplex.mp.model import Model Traceback (most recent call last): File "", line 1, in from docplex.mp.model import…
robintux
  • 93
  • 1
  • 9
1
vote
2 answers

What is the efficient way to add new variables using docplex python API?

I have a basic question about docplex library. Does anyone know what is the best way to add/delete variables from existing model? I am using the following code to create decision variables self.model.continuous_var_dict(self.N, lb=0) Can I run this…
Aaron_Geng
  • 189
  • 1
  • 1
  • 14
1
vote
1 answer

Using CVXPY with IBM's CLEX Cloud

How can one use IBM's CPLEX Decision Optimization Cloud[1] with CVXPY? If I have CPLEX installed locally, I can have cvxpy output an LP, SAV, or MPS file which I can then send to IBM's cloud service. However, this requires a local cplex install plus…
jerenrich
  • 113
  • 4
1
vote
2 answers

Docplex adding constraint is too slow

This is a same question as follows, but the difference is I'm using docplex. cplex.linear_constraints.add too slow for large models How can I add constraints using indices with docplex? My code is something like below. x =…
nemy
  • 519
  • 5
  • 16
1
vote
2 answers

Using Python Ray With CPLEX Model Object

I am trying to parallelize an interaction with a Python object that is computationally expensive. I would like to use Ray to do this but so far my best efforts have failed. The object is a CPLEX model object and I'm trying to add a set of…
Sledge
  • 1,245
  • 1
  • 23
  • 47
1
vote
3 answers

cplex executable not found

i am trying to implement a simple optimization problem in pyomo using cplex solver in UBUNTU. My program runs fine with glpk solver. Now i installed cplex, docplex using conda but got following error warning while solving. it couldnot locate cplex…
1
vote
1 answer

CVRP without visiting each node

I have a linear model for a capacity vehicle routing model. Now I want to put in a constraint on the maximum number of active edges which will result in the fact that not each node can be visited. However each route should start and end at the depot…
1
vote
2 answers

How to implement slicing in docplex?

I'm transferring some code from OPL to docplex and I'm having troubles with the syntax for slicing. I'm attempting to create a set of constraints with a summation over all values with connection to another decision variable. I've tried both…
1
vote
0 answers

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 and solar power as well as electricity market…
anat
  • 11
  • 3
1
vote
1 answer

How to expand and print non-global constraints in DOcplex?

I have recently migrated from AMPL/CPLEX-CP to Python/DOcplex.CP-MP. In AMPL, one can display the expanded version of the constraints using 'expand _constraint_name' command, which is helpful when debugging the model. Is there such functionality in…
S_R
  • 13
  • 3