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
0
votes
1 answer

Maximize revenue with deadline

Given three interval variables say a = mdl.interval_var(name='a',start=(0,10),end=(0,10),size=5) #have revenue of 10 b = mdl.interval_var(name='b',start=(0,10),end=(0,10),size=5) #have revenue of 5 c =…
william007
  • 17,375
  • 25
  • 118
  • 194
0
votes
1 answer

Docplex ! Interrupt the execution

I execute a program in cplex python (docplex), it has arrived at a gap 48% with 41 solutions. it's already been 2 days, I ask if I can interrupt it and have a result without restarting the execution with limit gap.
Nada.M
  • 103
  • 4
0
votes
1 answer

CPU Time Limit does not work in docplex api in python

I have set up docplex api in python and I am trying to run an optimization models. Based on IBM documentation, a CPU time limit can be set for the problem using the following command: mdl.solve(TimeLimit=60) However, this attribute does not work…
0
votes
1 answer

DOCPLEX Activate and deactivate constraints

I am trying to iterate through a MIP model with my own branching algorithm. So at each iterations, I am assigning all the binaries a value (0 or 1). Based on the results, I change how I assign the values. As an efficiency step, I have defined all…
Abilash
  • 95
  • 10
0
votes
1 answer

DOcplexException: Expression xx cannot be used as divider of xxx

I am new to CPLEX and I was trying to find an example where the decision variable is in the denominator of the objective function but couldn't. My optimisation problem; I have tried the following on Python3; from docplex.mp.model import…
S.Perera
  • 874
  • 3
  • 9
  • 24
0
votes
1 answer

Checking for feasibility and unsatisfied constraints in Docplex CP solutions

When I create an mp model in docplex I can check whether or not a solution is feasible and can show the unsatisfied constraints for infeasible solutions: from docplex.cp.model import CpoModel from docplex.mp.model import Model mp_model =…
Finn
  • 2,333
  • 1
  • 10
  • 21
0
votes
1 answer

How to obtain the total number of cuts in docplex?

I'm trying to obtain the total number of cuts from a solved docplex model, so basically the sum of the following output: Implied bound cuts applied: 7 Flow cuts applied: 10 Mixed integer rounding cuts applied: 7 Zero-half cuts applied: 2 Lift…
Anonymous
  • 3
  • 1
  • 3
0
votes
3 answers

Docplex, large number of iterations ( ItCnt = 1.25e+08)

When running the cplex model "docplex(python)", I noticed that the CPLEX repeats the same gap value several times (more than 300 times). without any improvement and with a large number of nodes left to explore (even if the problem is not big enough,…
Nada.M
  • 103
  • 4
0
votes
1 answer

Get the value of resource used

Given the code below (example from:https://www.ibm.com/docs/en/icos/20.1.0?topic=f-pulse) from docplex.cp.model import CpoModel, INTERVAL_MAX import docplex.cp.utils_visu as visu mdl =…
william007
  • 17,375
  • 25
  • 118
  • 194
0
votes
1 answer

How do I implement presence_of(x) => absence_of(y)

I'm trying to solve a scheduling problem in Python using docplex.cp. In my problem I have a constraint that states that if a given optional interval variable is present, then some other optional interval variable must be absent. I have tried…
Momafa
  • 3
  • 2
0
votes
1 answer

docplex shift end in step_at_end method

I am solving a scheduling problem in python using docplex where I am assigning start/end to workorder intervals. I also have a cumul function for stock that the workorders produce/consume. I am using step_at_end method to add produced quantity to…
RMat
  • 3
  • 2
0
votes
1 answer

docplex - set an interval_var's size as a function of another variable

In IBM's docplex optimization library, can you set an interval_var's size parameter as a function of another variable? Meaning, say for this example I wanted to make the task size dependent on the skill level of the worker. If the worker has a skill…
conv3d
  • 2,668
  • 6
  • 25
  • 45
0
votes
1 answer

transfer CPLEX mathematical model from C++ to Python

I have programmed my mathematical model in C++ using CPLEX,now I want to transfer it to Python using docplex.mp.model I met some problems in adding constraints. In C++,I am used to add constraints like this for (j = NumD; j < NumDC; j++) { …
0
votes
1 answer

Single-source and multi-destination problem in CPLEX/Docplex?

Can we use the CPLEX/Docplex for single-source and multi-destination problem in a network? For example, routing a vehicle from a source to visit multiple destinations in a single trip minimizing the overall travel time.
0
votes
1 answer

Examples in docplex to use the user cut callback method technology

Please can you provide an example of how this can used in a python notebook environment with docplex. I see examples with java on ATSP problem. The point is I do not know how to create these cuts upfront. Given a LP root node, I can generate the…
pudu39
  • 15
  • 3