Questions tagged [cplex]

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

Filter by
Sorted by
Tagged with
2 votes
0 answers
35 views

MIP start in cplex using Java

When I am reading an "lp" file for the problem and using a MIP start reading from a "sol" file it works. But when I pass on the same model directly to cplex (without writing lp) ...
  • 21
4 votes
2 answers
162 views

Attempting to define dual crossover for barrier optimization in CPLEX

I am exploring what the tradeoffs are between no crossover, crossover w/ default settings, and crossover with just dual for barrier optimization. When I attempt to define my solver settings for the ...
  • 51
2 votes
1 answer
81 views

Reproducing the CPLEX Output

I would like to reproduce the output of CPLEX, when it solves an MIP problem. That is, I would like to get the entries of the following example output, so that I can work with them. I am especially ...
  • 75
1 vote
1 answer
90 views

CPLEX solver, parallelism, solver parameter settings

CPLEX settings LPMethod: Barrier Threads: 4 Issue: When I run my model, the barrier method will solve using the 4 threads (as expected). I noticed in the log file that the solver then follows up with ...
  • 51
3 votes
0 answers
42 views

cplex callbacks: getting the branching variable

I would like to obtain the number of the variable cplex branches on at the current node during B&B. I try this by using the callback ...
  • 75
1 vote
0 answers
26 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
4 votes
1 answer
144 views

Solution time of different formulation

In MIP, what's the difference of solving time between the following two formulations? $x_i = 0$ for $i\in I$, and $\sum_{i\in I} x_i = 0$. Suppose that $x_i, \forall i\in I$ are all binary variables....
1 vote
0 answers
50 views

User callback doing nothing slows down Cplex

I am trying to do something with user callbacks in Cplex using Python API. For instance, I will need a callback that only counts the number of explored nodes. While testing something I noticed that ...
  • 251
4 votes
3 answers
178 views

Is this ILP formulation for Group Closeness Centrality a column generation approach?

I want to solve the Group Closeness Centrality problem where the input is a graph $G=(V,E)$ and integer $k$ and we want to find a vertex set $S$ of size $k$ minimizing the total distance of the ...
2 votes
1 answer
34 views

Objective value estimate for branches I create in Cplex

I' implementing custom branching heuristics for Cplex in python. I have a way to choose a (binary) variable to branch on, so use the following code to create two branches from BranchCallback (...
  • 251
4 votes
0 answers
40 views

How to invoke a solution pool and access all the solutions in cplex using PYOMO ? this is the structure of my pyomo code

...
2 votes
0 answers
52 views

Where is the relative gap from cplexbilp?

I am invoking cplexbilp (CPLEX 12.9) from Matlab R2022a. I request all 4 return arguments: ...
2 votes
2 answers
114 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
2 votes
1 answer
111 views

Getting all active constraints of an LP from Cplex

I was wondering if it is possible to get the active constraints of a linear program from the Python API of Cplex? Or do I have to go through the constraints one by one and check if they bind with ...
  • 251
1 vote
0 answers
75 views

How to make unconstrained variables non-negative (as in excel solver) in AMPL?

This is a sequencing problem. I've got this variables ...
2 votes
0 answers
115 views

Defining a highly non-linear function of integer variables

I have a complicated non-linear objective function of positive integer variables subject to linear constraints: $\mathop {Min}\limits_{\underline x} f(\underline x)$ s.t. $A\underline x\leq \underline ...
2 votes
2 answers
212 views

How to model Max-Cut as ILP

I want to model Max-Cut in IBM's CPLEX, but I fail at modeling the objective function. My attempt is to use is to sum the XOR of inclusion for vertices of each edge, as exactly then an edge is ...
-1 votes
1 answer
104 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
3 votes
1 answer
77 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
5 votes
0 answers
116 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?
2 votes
1 answer
117 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 ...
's user avatar
4 votes
0 answers
133 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
2 votes
3 answers
292 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 ...
  • 21
2 votes
1 answer
138 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. ...
  • 1,946
0 votes
1 answer
92 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
7 votes
1 answer
159 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 ...
  • 450
2 votes
1 answer
248 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
4 votes
2 answers
206 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 ...
2 votes
0 answers
71 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 ...
5 votes
1 answer
187 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-...
  • 213
2 votes
0 answers
48 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 ...
2 votes
0 answers
138 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 ...
  • 414
7 votes
5 answers
891 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, ...
  • 131
0 votes
0 answers
175 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 ...
5 votes
1 answer
438 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 ...
1 vote
1 answer
188 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 ...
3 votes
1 answer
288 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. ...
  • 141
2 votes
1 answer
265 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 ...
2 votes
1 answer
62 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$ ...
3 votes
1 answer
132 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 ...
  • 143
2 votes
1 answer
74 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. ...
0 votes
0 answers
30 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: ...
  • 11
2 votes
0 answers
146 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 ...
3 votes
1 answer
609 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 ...
3 votes
1 answer
133 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? ...
1 vote
1 answer
179 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: ...
2 votes
2 answers
105 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 ...
  • 21
5 votes
1 answer
275 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). ...
  • 217
4 votes
1 answer
273 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 ...
  • 43
2 votes
1 answer
194 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 ...

1
2 3 4 5