Questions tagged [cplex]

Questions related to the commercial solver IBM ILOG CPLEX Optimization Studio.

Filter by
Sorted by
Tagged with
2 votes
1 answer
88 views

Coding some parameters with index zero in Julia

As part of our constraints, we have \begin{align*} &\sum_{i=1}^{I}c_ix_i\ge y, \\ &\sum_{i=1}^{I}c_{i-1}x_i\le y, \end{align*} where $y\ge0,x_i\in\{0,1\}, \forall i$. I am trying to code ...
user avatar
4 votes
0 answers
63 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
  • 201
2 votes
3 answers
149 views

How to use condition in cplex?

I want to use conditions to my variable. dvar boolean x[I][J][K][L] dvar in h[i] my code is ...
user avatar
  • 21
2 votes
1 answer
85 views

Strong branching

Within B&B when it comes to select variables to branch on, I can use the concept of "strong branching". The optimizer, in my case CPLEX, then performs branching on variables it selects. ...
user avatar
  • 1,936
0 votes
1 answer
54 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
  • 149
7 votes
1 answer
116 views

Translate LP format to Numpy matrices

We have a large-scale optimization problem (~10K vars and ~10K constraints) in the form of LP format file (generated using Cplex ...
user avatar
  • 430
2 votes
1 answer
141 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
  • 149
4 votes
2 answers
167 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
2 votes
0 answers
59 views

Achieve true determinism in CPLEX

I'm unable to achieve true determinism in CPLEX (I'm using the DOCplex python API). Even if the best integer optimal solution is found without going to timeout (so it is expected to be unique), two ...
user avatar
5 votes
1 answer
137 views

Lazy-Constraints for modelling soft-constraints (CPLEX + rejectCandidate semantics)

I basically have a (somewhat bloated) assignment-problem on a boolean-matrix: (N_WORKERS, N_TASKS). Let's assume, we only look at one specific worker and therefore we have a 1d boolean assignment-...
user avatar
  • 213
2 votes
0 answers
42 views

Making multiple branches in make_branch function of Cplex

In my current python code, I have used MyBranch call back of Cplex to make 2 branches and solve my model. However, I now need to generate 4 branches after the first incumbent is generated. I need ...
user avatar
2 votes
0 answers
88 views

Pyomo + Cplex - OSError: [Errno 22] Invalid argument

I am trying to get Cplex working with pyomo. I have followed Cplex installation instructions has explained here: Downloading and setting up CPLEX for Pyomo However when calling Cplex via pyomo I get ...
user avatar
  • 414
7 votes
5 answers
695 views

Fast way to repeatedly solve many similar LPs/QPs in parallel

I am running a simulation where I need to repeatedly solve a set of LPs or QPs with slightly different input parameters for a Model Predictive Control application. The problem is I need it to be fast, ...
user avatar
  • 131
0 votes
0 answers
114 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
5 votes
1 answer
333 views

CPLEX gives different solutions of MILP every run

I am solving a mixed-integer (binary) linear problem using CPLEX as a solver (branch-and-bound method). But I encountered the following issue. Each run I get a different solution at a different node ...
user avatar
1 vote
1 answer
117 views

Tuples OPL in VRP

I am trying to build a constraint of the form x[i j] +x[j i] <y[i][j] where x is a decision variable if arc ...
user avatar
3 votes
1 answer
165 views

CPLEX oplrun says the problem size has exceeded, but then proceeds to solve the problem anyway

I have downloaded and installed the CPLEX Studio Community Edition 20.1.0.0 on my Linux machine (KUbuntu). I want to use the oplrun tool directly from the terminal. ...
user avatar
  • 141
2 votes
1 answer
226 views

CPLEX solver for quadratic problems with barrier algorithm

I'm writing a convex minimization model with a quadratic objective function and linear constraints in C#. I set CPLEX to solve the problem with the barrier algorithm. The interesting thing is when I ...
user avatar
2 votes
1 answer
56 views

How to model a cumulative resource constraint with same family condition?

Assume that we have 3 tasks to schedule : $x_{a1}, x_{a2}, x_{b3}$. They all use the same cumulative resource : $r_1$. Each activity increases $r_1$ by $1$ at it starts time and decreases $r_1$ by $1$ ...
user avatar
3 votes
1 answer
119 views

Conditional constraint with a strict inequality

It's almost this question: Formulating the conditional constraint But there they have non-strict inequality. I have $x_i$ a boolean decision var and $Q_i$ as a nonnegative integer decision variable ...
user avatar
  • 143
2 votes
1 answer
55 views

Constraint raises DCP Error

I have defined a problem which will minimize the cost of to run a pump. That is defined as the objective of the problem. ...
user avatar
0 votes
0 answers
27 views

Add bunch of constraints using IRange and add to Model in Cplex C#

I am new in C#-CPLEX. In public samples, the constraints are added one by one as follows: ...
user avatar
  • 11
2 votes
0 answers
95 views

Building model takes so much time in Cplex

I am a beginner in CPLEX. I have a model with about 1 million constants and 800k rows and 1.6 million columns. I implemented in both GAMS and CPLEX (C# as the platform). The final solution for both is ...
user avatar
3 votes
1 answer
408 views

How to compare the optimality gaps between a commercial solver and Benders

Suppose I have a mixed-integer-linear programming model where the objective is maximization. I solve my model in two different ways. First, I call CPLEX (a commercial solver), and then implement ...
user avatar
3 votes
1 answer
119 views

Standard Form for LP and MPS

Is there any way I could have Gurobi/CPLEX or any other package write/export MPS and LP files in the standard LP construct loaded with slack variables and transformations required for unsigned vars? ...
user avatar
1 vote
1 answer
144 views

Operator error in operating cost model constraint

I have built a model to minimize the operating cost and when I coded a model in CPLEX, it gave an error at Cons09: ...
user avatar
2 votes
2 answers
82 views

How to use `cplexAPI` to solve quadratic programs/quadratically constrained linear programs?

I am trying to use cplexAPI to solve quadratic programs or quadratically constrained linear program. While it seems to be pretty straightforward to use ...
user avatar
  • 21
5 votes
1 answer
254 views

Why does one objective function prove feasibility faster than another?

I recently ran a MIP model with cplex specifying it should stop solving when integer feasibility was proven (mipsolutions=1). ...
user avatar
  • 217
4 votes
1 answer
200 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
163 views

How to code this with Cplex?

I have an optimization problem as below. For $g\in G$, let $\mathcal{N}_g$ be the nodes in group $g$, and let binary variable $u_g$ indicate whether group $g$ is used. The problem has this following ...
user avatar
2 votes
1 answer
43 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
4 votes
2 answers
264 views

Any transformation of constraints during Cplex's LP problem export?

We are exporting a optimization problem from matrices to LP format using Cplex. ...
user avatar
  • 430
21 votes
3 answers
2k views

Using Neural Networks For Solving Optimization Problems

Recently, I came across the below paper and found it very interesting. Solving Mixed Integer Programs Using Neural Networks; https://arxiv.org/abs/2012.13349 The idea is to use (train with neural ...
user avatar
3 votes
1 answer
214 views

The optimum is achieved only by forced "solution polishing"

I have the behavior of CPLEX during a MIP search, when it finds the optimal solution in a reasonable time during a forced "solution polishing" phase only. Otherwise, if you do not switch the ...
user avatar
  • 83
6 votes
1 answer
203 views

Why does CPLEX continue solving after finding the optimal solution?

I ran a MIP model with a max solving time of 1800 seconds. CPLEX found the optimal solution (0.00 % MIP gap) after 710 seconds, but continued processing until it was stopped by the 1800 second limit. ...
user avatar
  • 217
1 vote
0 answers
103 views

CPLEX callback in pyomo

I am trying to figure out what is the correct use of cplex callbacks in pyomo. In particular I am looking for the translation of the following example from gurobi to cplex: ...
user avatar
  • 59
2 votes
1 answer
162 views

Benders decompositions: Number of iterations does not remain the same

I am solving an LP (i.e 118-bus system economic dispatch for 130% loading) using Benders decomposition. The problem takes 26 iterations to converge. This means that the process adds 25 cuts to the ...
user avatar
3 votes
1 answer
150 views

Extracting CNF representation of my problem from SAT solver

As I know, any SAT solver such as or-tools or cplex cp optimizer converts a given problem to CNF form in the first place. Is it possible to extract the resulting CNF representation from or-tools or ...
user avatar
6 votes
1 answer
164 views

Upper and lower bounds of a variable equal

I'm working on a MILP (Mixed-Integer Linear Programming) problem with the Java API of Cplex. In order to easily exclude some variables from my problem I thought about setting both their lower and ...
user avatar
  • 307
4 votes
1 answer
311 views

CPLEX log always the same after hours ("Gap" and "Best Integer" always blanks)

I'm using the Java API of CPLEX 12.6.1 (with license) to solve a MILP (Mixed-Integer Linear Programming) maximization problem. The point is that, after 21 hours, CPLEX has consumed 32 GB of RAM and ...
user avatar
  • 307
4 votes
1 answer
36 views

behaviour of CPXsetincumbentcallbackfunc

I am using the incumbent callback CPXsetincumbentcallbackfunc to identify integral solutions that do not satisfy nonlinear constraints that are not explicitly part of the constraint set. When such a ...
user avatar
  • 43
2 votes
1 answer
108 views

CPLEX Indicator Constraints in Java API

I'm using the Java API of CPLEX (12.6.1 version) to solve a MILP problem. This is how I create 'normal' constraints: ...
user avatar
  • 307
2 votes
1 answer
180 views

The precision of the decimal number of the Cplex

I have faced a little weird problem when I use Cplex to solve my test problem. Basically, some of my data are float numbers up to three decimal numbers (For instance, 0.627). But, when I print out the ...
user avatar
  • 59
1 vote
0 answers
171 views

CPLEX ignores a feasible solution given as start one

Assume we have 100% feasible solution for the model with decision variable a[i]. Then we are changing the objective function on something similar to ...
user avatar
  • 83
1 vote
0 answers
143 views

Implement sequential formulation in TSP (Miller, Tucker, Zemlin)

I'm trying to solve a TSP in different ways. I already did it with the formulation of Dantzig, Fulkerson and Johnson und now I want to do use the Miller, Tucker, Zemlin constraint. $$u_i-u_j+nx_{ij}\...
user avatar
  • 659
0 votes
1 answer
82 views

ILOG CPLEX Overflow occurred

When I run my CPLEX model, under the Profiler tab I get the error Overflow occurred, please use oplrun -profile. How do I setup oplrun? I looked at the IBM website ...
user avatar
1 vote
1 answer
66 views

How to call Cplex.AddMIPStart method

Could you please tell where I can find a method Cplex.AddMIPStart? By that I mean in which library and how to link this library to my C# project.
user avatar
  • 83
3 votes
4 answers
289 views

Book recommendations on OPL

Are there any good books that teach how to work with OPL in CPLEX? I searched but I didn't find any.
user avatar
  • 141
1 vote
2 answers
213 views

Combinatorial Optimization Problem using IBM ILOG CPLEX

Consider the combinatorial optimization problem described as below. Let $D=(V,A)$ be a directed graph with $V$ the set of vertices and $A$ the set of arcs, i.e., $A=\{(i,j)\mid i,j\in V\}$. On each ...
user avatar
2 votes
0 answers
68 views

How to implement CPLEX user cuts using CPXaddusercuts in C API?

I am trying to use CPXaddusercuts to add cutting planes, which have not been violated yet but are likely to be violated as we go down the branch & bound tree, to the list (pool) of constraints. As ...
user avatar