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
0 votes
0 answers
72 views

Can I call a function which depends on the decison variables in an objective function when using docplex?

I have a math model as shown below, which I want to solve with cplex via docplex. In my model, the decision variables represent an assignment to different places. In my objective function, I call a ...
flix01's user avatar
  • 1
1 vote
1 answer
85 views

How to obtain nodes count and nodes left in docplex (using CPLEX 12.20 and Python 3.8)

I solving a MILP problem as given below using Python 3.8 and CPLEX 12.20. I want to obtain the number of nodes and nodes left. The details of the codes are as follows: n_xvars=2 n_yvars=2 #Create ...
Mohammad Samiullah's user avatar
1 vote
2 answers
61 views

Evaluation of linear expression with docplex based on a solution

For a CpModel using docplex, is there any function to evaluate a linear expression based on the variables values in the final solution? For example, for ...
Nara's user avatar
  • 11
2 votes
1 answer
89 views

Can a logical expression be added to the objective function of a model in docplex?

I'm working on an optimization problem using Docplex and wonder if it's possible to incorporate a logical expression into the objective function of my model. Specifically, I have three variables x, y, ...
Nada.S's user avatar
  • 409
1 vote
1 answer
120 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
274 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
174 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
220 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
230 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
180 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
156 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
255 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
189 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
241 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
50 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
272 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
224 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
  • 615
3 votes
1 answer
203 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
405 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.S's user avatar
  • 409
-1 votes
1 answer
351 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
139 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
132 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
123 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
40 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
344 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
252 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
  • 615
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
206 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
234 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
528 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
302 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
601 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
446 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
404 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
76 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.S's user avatar
  • 409
4 votes
1 answer
3k 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
  • 8,642
3 votes
1 answer
305 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.S's user avatar
  • 409
1 vote
1 answer
122 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.S's user avatar
  • 409
2 votes
1 answer
333 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.S's user avatar
  • 409
-3 votes
2 answers
1k 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.S's user avatar
  • 409
4 votes
1 answer
565 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
67 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
603 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's user avatar
  • 63
1 vote
0 answers
491 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
271 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.S's user avatar
  • 409
0 votes
1 answer
210 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.S's user avatar
  • 409
0 votes
1 answer
203 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
128 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
27 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
1k 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