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.

177 questions
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
  • 61
  • 4
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
  • 985
  • 1
  • 16
  • 36
1
vote
2 answers

How to implement refining conflict in constraint programming

I use Docplex with python 3.7 to implement constraints programming. when it was infeasible, how can i proceed to list constraints those was to source of the conflict? mdl.export_as_cpo(out="/home/..../MCP3.lp") msol = mdl.solve(FailLimit=700000,…
Issouf
  • 118
  • 10
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
  • 2
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
1
vote
1 answer

how does docplex use local solver?

I want to use docplex to solve a MIP model locally but error. mdl = Model('name', agent='local') docplex.mp.utils.DOcplexException: No CPLEX DLL and no DOcplexcloud credentials: model cannot be solved! my python version is 3.6.6, the version of…
1
vote
1 answer

Where can I find the documentation of docplex automatic tuning tool?

I was able to find the documentation of the CPLEX automatic tuning tool, namely (the IBM Studio) but I couldn't find any for the docplex one (the cplex python api). Does the tuning tool exist for python? if yes is there any documentation to use this…
sel
  • 828
  • 1
  • 11
  • 23
1
vote
0 answers

Variable removal in docplex

I am trying to implement Column Generation using docplex. Is there any way to remove variables that have been already added to the model?
1
vote
2 answers

What are the limits of docplex (the cplex version of python) in terms of the number of variables and constraints?

I am solving an optimization problem in python using docplex(not docplex cloud API) with only 2 constraints and 92 variables (dvar in OPL). But even though I get this error: docplex.mp.utils.DOcplexLimitsExceeded: **** Promotional version. Problem…
sel
  • 828
  • 1
  • 11
  • 23
1
vote
1 answer

How to model constraints in optimization problems using docplex (python)?

I need to solve an optimization problem that is similar to the knapsack problem. I have detailed the optimization problem in this post: knapsack optimization with dynamic variables I actually need to tu use python instead of OPL, so I have installed…
sel
  • 828
  • 1
  • 11
  • 23
1
vote
1 answer

Create an integer variable that can only takes values from a list with the cplex python api

from docplex.cp.model import CpoModel mdl = CpoModel() To create an integer variable between [0,10]: variable = mdl.integer_var(min=0, max=10, name="variable") How can I create a variable that only can take an integer value from a list? For…
1 2
3
11 12