# Questions tagged [docplex]

Questions related to the IBM Decision Optimization CPLEX (docplex) which is designed for modeling and solving optimization problems in Python.

59 questions
Filter by
Sorted by
Tagged with
1 vote
108 views

74 views

102 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 ...
1 vote
91 views

### Simple Constraint Programming Problem: docplex works but equivalent ortools model is infeasible

I have a simple constraint programming model which can be solved using the docplex library, however I am struggling to implement the same model using ...
• 145
183 views

### Simple Integer Optimization Problem: docplex CP model works but equivalent PuLP+CBC model is infeasible?

I have an integer optimization problem with one constraint per decision variable and no objective function. It can be coded and solved using docplex, however I am ...
• 145
148 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 ...
• 115
145 views

### Linearize a higher order polynomial objective function?

My question up front with context below: Is there a generalized linearization possible for a higher order polynomial (max degree 6 in my case) involving a mix of binary and real variables? If not, ...
• 23
1 vote
44 views

### CPLEX OPL - Problem of arrangements and increments

I have a problem involving work shifts and assembly stations. Work shifts have the subscript = T Workstations have the subscript = J My decision variable is X[t][j] For each turn (T) I am trying to ...
• 11
184 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 ...
211 views

### Accelerating an integer programming model

I am working on a scheduling problem, where I am solving it through column generation. The pricing problem of this algorithm is an integer programming model as follows: F_1 \Big\{V^...
• 529
155 views

### What is the default weight allocation in solving multi-objective on CPLEX?

I am currently working on a multi-objective problem where I am trying to minimize cost and time. I am using Docplex to solve it, but I did not specify any weight using the following code: ...
• 115
255 views

### Docplex : How can I get the objective value of the relaxation of an MILP?

I want to solve a relaxed version of a MILP; I am using docplex.mp. I found LinearRelaxer in docplex.mp.relax_linear , however I keep getting this error message: model model1: found 1 un-relaxable ...
• 377
268 views

### How to iterate a parameter set in docplex model?

The parameters are such as in the dataframe above. Can I iterate over this, and solve the model firstly for row 0 and then 1, ... etc.
• 307
124 views

### cpu time in docplex

mdl.print_information() sol = mdl.solve() mdl.print_solution() if sol is None: print("Infeasible") print(mdl.solve_details) At the end of ...
• 307
99 views

### calculations after the docplex solution

After solving the problem with docplex and having the decision variables' values, can I do some calculations in the code with decision variables? ...
• 307
122 views

### Scale of largest CPLEX/Gurobi execution

I am trying to understand the CO2 emission of large scale optimization using CPLEX or Gurobi. Is there a published literature which addresses the compute usage of large scale executions?
• 251
1 vote
39 views

### batch file for docplex

I have a mathematical model written in docplex python. For analysis, I have to generate different sized data with batch file which can be input for the problem. How can I generate this type of batch ...
• 307
271 views

### CPLEX Python: Current subproblem model in branch and bound

I have an MILP problem and use CPLEX (Python interface). I am working on user heuristics for branching in the branch-and-bound procedure. With HSCallback I managed to get the information about the ...
• 251
205 views

### Binary/integer variables get real values in docplex

I have an MILP model, in which I am handling all Big M constraints with add_if_then constraints (following this topic). I generate this model only once (to save time) and solve it iteratively with ...
• 529
2k views

### Python to Excel

Using DOcplex module an optimization problem is solved. There are many decision variables in the solution, for the validation of the mathematical model I want to check them. How can I write the ...
• 307
183 views

### opposite of no_overlap constraint in docplex for CP

I am using python for CP solving. I would like to know if there is constraint that does the opposite of no_overlap. This will be like overlap(interval, arr, n) interval - single interval variable arr -...
179 views

### Cplex 12.10 and python

Does cplex 12.10 support python 3.8? I cannot install setup.py file. I think only 3.7 and 3.6 are supported.
• 307
399 views

### Can docplex solve a mixed integer quadratic programming (MIQP) problem?

I am trying to solve a mixed integer quadratic programming (MIQP) problem. The objective function contains the product of two continuous decision variables, some of constraints are non-linear too. I ...
• 307
257 views

### Reformulate CPLEX optimization model of Warehouse Product Allocation

I am trying to optimize the allocation of of products inside a fictive warehouse, having a predefined number of aisles (3 in the example code below) where products ...
1 vote
459 views

### In DOcplex, how can I get value of variable for objective function before solved?

In terms of python based atypical math model as shown below, which is unlike nonlinear or quadratic form in my opinion, I have difficulty in accessing value of variable before optimization as ...
300 views

### CPLEX returns no solution with deterministic time limit

I'm working with CPLEX using the python API (Docplex). If I set the time limit in seconds with model.set_time_limit(60) the solver returns the best integer feasible ...
• 91
330 views

### sensitivity analysis in python + Docplex

I want to do a sensitivity analysis for the following problem. I know how to add new variables or constraints, but I do not know how I can change the right-hand side (RHS) of the constraint. ...
• 17
1 vote
71 views

### Meaning of zeros in the column best bound in docplex?

I am trying to solve a large-scale MIP problem in docplex(python). I give to the model a MIP start solution, I remark that after 20 hours, the best integer still the cost of the MIP start and the best ...
• 377
2k views

### How to retrieve the variable's value in DOCplex

I am trying to write a simple optimization problem by using DOCPLEX. I am pretty new on python+DO and What I have tried to do is: ...
• 7,549
240 views

### Docplex : model is infeasible

I have implemented a model in cplex and even if I give it an initial feasible solution of a heuristic programmed elsewhere, it gives me the error "the model is infeasible". Please if someone ...
• 377
1 vote
90 views

### KPIs in Docplex?

I want to add a KPI to calculate the percentage of occupancy of vehicles: the total travel time of occupied arcs (where the capacity of a vehicle is non-zero) over the total travel time. How can I ...
• 377
243 views

### How to return the last upper bound docplex?

I try to solve a model in docplex(python) the model was stopped after a specific time limit. I want when the model stop return the best upper bound was found.
• 377
815 views

### How to check infeasibility with conflict refiner (docplex mixed integer programming )?

Please, if someone can give me an example of the application of conflict refiner, I have already read the documentation but I did not understand how to use it well.
• 377
397 views

### LP solver CPLEX is 'optimal with unscaled infeasabilities'?

The problem being solved is finding the truss with the least weight, exactly done as on this website: https://www.layopt.com/truss/. This method is also called the ground structure method. I am aiming ...
• 143
55 views

### ILOG CPOptimizer soft constraints (multiple solves reusing searched space)

I'm trying to feed information retrieved from my neural network to my CP model to help narrow down the search on big instances of my problem. However, I also want to remove the additional imposed ...
• 121
492 views

### CPLEX MILP Report all solutions found

I am running a MIP using DOCPLEX that generates several feasible integer solutions during the Branch and Bound search. The node log updates every now and then based on the parameter setting. However, ...
1 vote
427 views

### How do I define multiple indices for the same set in python? (using CPLEX to solve a MILP)

I am using docplex in Python to solve a MILP and I am having some trouble defining the indices and sets of my model. I want to translate $w,v,a\in W$ into Python. In this case, $W$ is a set, and $w, v$...
• 11
215 views

### Docplex, CPLEX Warning 1036 :

I am trying to solve a large-scale MIP problem. I have the following errors, I know, it's about the data, but I can't change the data. Is there a method to deal with it? ...
• 377
167 views

### For docplex, it's possible to set the number of iterations without improvement?

When running the cplex model, I noticed that the CPLEX repeats the same gap value several times. I ask if there is a parameter in docplex that limits the number of iterations without improvements or ...
• 377
194 views

### Assignment problem with variable tasks to be done

I'm dealing with a kind of assignment problem, in which I have a set of tasks $t$ to be executed by machines $w$, but these tasks depend on the variatns $v$ of components $m$ being selected, which is ...
• 1,133
122 views

### Constraint to handle the machine-configuration's change between initial position and its first occurrence in the process

I am working with a kind of a reconfigurable process planning, meaning that the same machine can have different configurations and perform multiple operations. Each machine has an initial ...
• 1,133
1 vote
26 views

### Implement geometric constraint using DOCplex

currently I'm working on a wind farm layout optimization problem. I found an appropriate model in literature (Fischetti et al.) and now I'm trying to reproduce it using the Python API of cplex with ...
• 11
1 vote
815 views

### Docplex Error: Model has non-convex objective

My objective function is $\frac{1}{2}w^{T}Vw - P^{T}w$ with $V$ a covariance matrix (hence semidefinite positive), $P$ a column vector and $w$ a vector of semi-continuous variables. Given that the ...
• 157
326 views

### How to display the range of coefficients in docplex log?

A typical gurobi log can have a section where it shows the range of coefficients. Something like: ...
• 5,796
277 views

### Could DOcplex.CP recognize that it solves the graph coloring minimization problem?

I created a graph coloring DOcplex.CP model inspired by this example. However, I do not know the number of colors in advance. The goal is to minimize the number of colors (i.e., get as close as ...
355 views

### Rotated Second-Order Cone Constraints in docplex

I have programmed the model in here using Gurobi 9.0 in Python 3.7. To ensure playing within the boundaries of the licensing, I am trying to program it using CPLEX where we have broader flexibility ...
• 1,239