Questions tagged [docplex]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
108 views

Sigmoidal programming

I plan to use sigmoidal programming from the git repo https://github.com/madeleineudell/SigmoidalProgramming.jl There are some issues with the implementation of this repo. It requires me to pass $A, b,...
Meet Saiya's user avatar
1 vote
2 answers
113 views

Is there a way to obtain coefficient matrix A and RHS b of constraints equation from cplex or guribi in python?

I have a non-linear program, minimizing sum of concave functions subject to linear constraints. Hence I'm using a different solver(in Julia). However, that solver assumes we have constraints in $Ax \...
Meet Saiya's user avatar
2 votes
1 answer
74 views

Obtaining the dual ray of an infeasible lp to generate a benders feasibility cut

I am struggling to correctly interpret the meaning of a dual ray for an infeasible primal lp. Consider the following example. $$ \min z = y_1 + y_2 -2y_3 $$ s.t $$y_1 -2y_1 -y_3 \ge 3 $$ $$-2y_1 - ...
Kit Searle's user avatar
3 votes
1 answer
112 views

Converting continuous variable dict to binary variables in python docplex

I am solving a problem using linear relaxation at the initial phase. Hence, I need continuous variables at the beginning. Then I need to convert some continuous variables to binary and solve the same ...
user avatar
3 votes
3 answers
185 views

Summation of maximization terms in CPLEX

I have a problem in the following type: $$\sum_{i∈I}{\max_{j∈J}c_{ij}\cdot x_{j}}$$ For each objective, in a set of $x$ variables, the goal is to select the one with the highest cost coefficient. ...
user avatar
2 votes
1 answer
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 ...
user avatar
1 vote
1 answer
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 ...
SlowLoris's user avatar
  • 145
3 votes
2 answers
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 ...
SlowLoris's user avatar
  • 145
3 votes
1 answer
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 ...
Bree's user avatar
  • 115
2 votes
1 answer
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, ...
jpaul45's user avatar
  • 23
1 vote
0 answers
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 ...
Josafat's user avatar
  • 11
2 votes
1 answer
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 ...
Meet Saiya's user avatar
4 votes
1 answer
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: \begin{equation} F_1 \Big\{V^...
mdslt's user avatar
  • 529
3 votes
1 answer
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: ...
Bree's user avatar
  • 115
2 votes
2 answers
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 ...
Nada.M's user avatar
  • 377
-1 votes
1 answer
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.
GTek's user avatar
  • 307
3 votes
1 answer
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 ...
GTek's user avatar
  • 307
0 votes
1 answer
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? ...
GTek's user avatar
  • 307
5 votes
0 answers
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?
Omar Shehab's user avatar
1 vote
0 answers
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 ...
GTek's user avatar
  • 307
4 votes
0 answers
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 ...
Elena's user avatar
  • 251
2 votes
1 answer
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 ...
mdslt's user avatar
  • 529
3 votes
3 answers
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 ...
GTek's user avatar
  • 307
2 votes
1 answer
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 -...
prakash gawas's user avatar
0 votes
1 answer
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.
GTek's user avatar
  • 307
2 votes
1 answer
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 ...
GTek's user avatar
  • 307
4 votes
2 answers
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 ...
GuglielmoSanchini's user avatar
1 vote
0 answers
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 ...
Nam-kyoung Lee's user avatar
0 votes
0 answers
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 ...
Daniele 's user avatar
0 votes
2 answers
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. ...
Cnaz's user avatar
  • 17
1 vote
0 answers
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 ...
Nada.M's user avatar
  • 377
4 votes
1 answer
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: ...
A.Omidi's user avatar
  • 7,549
3 votes
1 answer
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 ...
Nada.M's user avatar
  • 377
1 vote
1 answer
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 ...
Nada.M's user avatar
  • 377
2 votes
1 answer
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.
Nada.M's user avatar
  • 377
-3 votes
2 answers
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.
Nada.M's user avatar
  • 377
4 votes
1 answer
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 ...
Bart's user avatar
  • 143
2 votes
1 answer
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 ...
eXPRESS's user avatar
  • 121
3 votes
2 answers
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, ...
Abilash Reznov Subbaraman's user avatar
1 vote
0 answers
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$...
mnm23's user avatar
  • 11
2 votes
2 answers
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? ...
Nada.M's user avatar
  • 377
0 votes
1 answer
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 ...
Nada.M's user avatar
  • 377
0 votes
1 answer
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 ...
campioni's user avatar
  • 1,133
2 votes
2 answers
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 ...
campioni's user avatar
  • 1,133
1 vote
0 answers
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 ...
s6nke's user avatar
  • 11
1 vote
2 answers
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 ...
FredNgu's user avatar
  • 157
2 votes
2 answers
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: ...
EhsanK's user avatar
  • 5,796
3 votes
2 answers
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 ...
Alexander Pozdneev's user avatar
3 votes
2 answers
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 ...
tcokyasar's user avatar
  • 1,239
3 votes
1 answer
551 views

Logical operation on an array in DOCplex

Here is a simple example of logical operation in docplex taken from here. Code below works fine. ...
ooo's user avatar
  • 1,589