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
2 votes
2 answers
72 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 ...
user avatar
  • 367
-1 votes
1 answer
57 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.
user avatar
  • 307
3 votes
1 answer
62 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 ...
user avatar
  • 307
0 votes
1 answer
58 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? ...
user avatar
  • 307
5 votes
0 answers
112 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?
user avatar
1 vote
0 answers
36 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 ...
user avatar
  • 307
4 votes
0 answers
93 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 ...
user avatar
  • 221
2 votes
1 answer
88 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 ...
user avatar
  • 293
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 ...
user avatar
  • 307
2 votes
1 answer
104 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 -...
user avatar
0 votes
1 answer
66 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.
user avatar
  • 307
2 votes
1 answer
186 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 ...
user avatar
  • 307
4 votes
2 answers
181 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 ...
user avatar
1 vote
0 answers
173 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 ...
user avatar
0 votes
0 answers
136 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 ...
user avatar
0 votes
2 answers
165 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. ...
user avatar
  • 17
1 vote
0 answers
53 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 ...
user avatar
  • 367
3 votes
1 answer
616 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: ...
user avatar
  • 5,833
3 votes
1 answer
130 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 ...
user avatar
  • 367
1 vote
1 answer
57 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 ...
user avatar
  • 367
2 votes
1 answer
130 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.
user avatar
  • 367
-3 votes
2 answers
344 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.
user avatar
  • 367
4 votes
1 answer
230 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 ...
user avatar
  • 43
2 votes
1 answer
46 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 ...
user avatar
  • 121
3 votes
2 answers
274 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, ...
user avatar
1 vote
0 answers
185 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$...
user avatar
  • 11
2 votes
2 answers
148 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? ...
user avatar
  • 367
-1 votes
1 answer
132 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 ...
user avatar
  • 367
0 votes
1 answer
162 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 ...
user avatar
  • 1,123
2 votes
2 answers
120 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 ...
user avatar
  • 1,123
1 vote
0 answers
23 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 ...
user avatar
  • 11
1 vote
2 answers
493 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 ...
user avatar
  • 147
2 votes
2 answers
267 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: ...
user avatar
  • 5,661
3 votes
2 answers
226 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 ...
user avatar
3 votes
2 answers
265 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 ...
user avatar
  • 1,229
3 votes
1 answer
378 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. ...
user avatar
  • 1,579
9 votes
1 answer
525 views

Integrating genetic algorithm (or other heuristic methods) with CPLEX

[Topic to discuss GA and CPLEX] I've seen some papers trying to integrate genetic algorithm with CPLEX, such as here and here. Although they integrated both, it is done in 2 different steps; that ...
user avatar
  • 1,123
7 votes
3 answers
761 views

Constraint programming using solver: how to state the time limit of search?

Could someone give additional explanations about the TimeLimit of CPLEX for CPO? I am using CPLEX to solve a problem of assignment and scheduling in which each task needs to be assigned to a worker, ...
user avatar
  • 1,123
5 votes
1 answer
272 views

Precedence constraints using binary variables - DOCPLEX

I would like to establish a precedence constraint to ensure the precedence relation of tasks. I have a set of tasks available, but required tasks are not always the same. It means, the tasks executed ...
user avatar
  • 1,123
5 votes
1 answer
266 views

Scheduling with transition costs - DOCPLEX

I am dealing with a kind of scheduling problem. I have a set of tasks to be executed by a set of machines. It is known that different machines are able to execute the same task, but each machine can ...
user avatar
  • 1,123
7 votes
1 answer
491 views

When using docplex.cp is it possible to get all feasible solutions?

I would like to solve an ILP and get all feasible solutions (even the worst one). How could I do that using docplex.cp? I've seen a similar question in: Using CPLEX "solution pool" to count ...
user avatar
  • 1,123
5 votes
0 answers
104 views

How to handle constraints in docplex to states the relation between two variables?

I am using docplex.cp and I need to state the following constraint: $$\sum_{c}(X_p{_w}_{cj}+X_{p+1}{_{w'}}_{cj+1})\leqslant T_w{_{w'}}_{,jj+1} + 1$$ Knowing that the binary variables are: $X_p{_w}_{...
user avatar
  • 1,123
7 votes
1 answer
159 views

DOCPLEX: tips to manipulate data input (binary parameter)

I am coding a MIP problem in docplex and I would like to ask for some tips. I would like to input a binary parameter that states a compatibility relation: I have a set of characteristics $H$ to be ...
user avatar
  • 1,123
5 votes
2 answers
717 views

How to establish constraint between variables with multiple indexes using CPLEX in Python

I am new in CPLEX and I am using docplex in Python to solve an ILP. I would like to translate the following constraint in docplex: $$\sum_{c}(X_p{_w}_{cj}+X_{p+1}{_{w'}}_{cj+1})\leqslant T_w{_{w'}}_{,...
user avatar
  • 1,123
10 votes
1 answer
224 views

DOCplex adding columns

When using DOCplex to implement column generation, is it possible to add columns as an object, as opposed to creating a variable and then modifying the coefficients in the constraints? Edit: In ...
user avatar
  • 1,335