Skip to main content

Questions tagged [cplex]

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

Filter by
Sorted by
Tagged with
3 votes
2 answers
278 views

Modifying and re-optimizing a model using CPLEX Python API

I came across the following functionality that is offered by CPLEX for modifying and re-optimizing a model based on previous computations: https://perso.ensta-paris.fr/~diam/ro/online/cplex/cplex1271/...
Pia MiA's user avatar
  • 390
2 votes
1 answer
74 views

How to get the fractional solution of a node in a MIP model using JuMP package?

I'm coding in Julia and use the JuMP package. My IP solver stops by a fixed node limitation. I noticed that I can only get the feasible primal and dual solution if has any, however I would like to get ...
Brown's user avatar
  • 173
2 votes
1 answer
402 views

Difference between cplex_direct and cplex in Pyomo SolverFactory

I noticed some people specify the solver as "cplex_direct" whereas others as "cplex" when passing the option to SolverFactory in Pyomo. Is there ...
Pia MiA's user avatar
  • 390
2 votes
2 answers
67 views

Disjoint Paths and Minimum Total Cost Disjoint Paths Problem in CPLEX

So I have this constraint to write in CPLEX: \begin{align}\min&\quad Z=\sum_{(i,j)\in A}c_{ij}x_{ij}\tag1\\\text{s.t.}&\quad\sum_{j:(s,j)\in A}x_{sj}=K\tag{2.2}\\&\quad\sum_{i:(i,t)\in A}...
DvD's user avatar
  • 31
2 votes
1 answer
307 views

gams syntax issue - "set identifier or quoted element expected"

Writing some GAMS code, getting some syntax errors: Anyone recognize the problem?
Alexander Mills's user avatar
2 votes
1 answer
557 views

Re-optimizing pyomo model based on previous computation

I am currently new to pyomo and modelling techniques but I came across information mentioning that the CPLEX and Gurobi APIs offer a functionality where you can re-use already computed values and feed ...
Pia MiA's user avatar
  • 390
2 votes
1 answer
200 views

How to solve infeasible cplex model in GAMS?

I am facing this kind of error "Row 'eq1(14)' infeasible, all entries at implied bounds" in a problem that a GAMS script gets data from MATLAB. I have seen some posts about conflict ...
Panos S's user avatar
  • 21
1 vote
1 answer
188 views

How to code this constraint in CPLEX?

$$\sum_{j\in M}\sum_{k=i}^{\rm until}x_{aijk}\cdot b_{kj}=d_{ai},\quad\forall i\in N,\forall a\in B\cap A_1;{\rm until}=\min(i+v_a,n)$$ How to code this linear program in CPLEX?
Trí Vũ's user avatar
3 votes
1 answer
186 views

Where to find "MIP Emphasis" parameter in the CPLEX IDE?

I am also looking to solve a MIP with heuristic algorithms and read in the guide that I need to modify the "MIP emphasis" parameter. Is there a way of doing this in the CPLEX IDE? All I can ...
twaits791's user avatar
3 votes
2 answers
486 views

How to view pause and view current solution in CPLEX Optimization Studio?

I am solving my first model in CPLEX 22.1. I have setup a quadratic MIP with 100 variables and the model has been running for a day already with the best integer and best bound solutions barely ...
twaits791's user avatar
2 votes
1 answer
383 views

CPLEX stuck in solve method - dual simplex solved model

I am solving a (rather large) MILP in CPLEX in Java. I also wrote a solution extractor method, which works most of the time. However, when CPLEX tries to solve my problem with the dual simplex method ...
Juul9191's user avatar
2 votes
1 answer
196 views

Dantzig-Wolfe decomposition and optimal integer solutions

It is well known that applying the Dantzig-Wolfe Decomposition in the one period cutting stock problem with trim loss minimization leads to an optimal real solution that shares the round up property, ...
Eduardo Silva's user avatar
1 vote
2 answers
341 views

Apply Benders decomposition approach in CPLEX with python while using docplex class

I am new to cplex with python. I want to solve a problem using the Benders decomposition approach. Where I want to use UserCutCallback and LazyConstraintCallback. I am writing code in script format (...
Mohammad Samiullah's user avatar
2 votes
0 answers
93 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) ...
Suman's user avatar
  • 21
4 votes
2 answers
266 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 ...
JBH_84's user avatar
  • 61
2 votes
1 answer
141 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 ...
Nikou's user avatar
  • 75
2 votes
1 answer
425 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 ...
JBH_84's user avatar
  • 61
3 votes
0 answers
97 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 ...
Nikou's user avatar
  • 75
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
4 votes
1 answer
155 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....
nousername's user avatar
1 vote
0 answers
144 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 ...
Elena's user avatar
  • 251
4 votes
3 answers
207 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 ...
Christian Komusiewicz's user avatar
2 votes
1 answer
50 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 (...
Elena's user avatar
  • 251
4 votes
0 answers
156 views

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

...
Prachi Patki's user avatar
2 votes
0 answers
63 views

Where is the relative gap from cplexbilp?

I am invoking cplexbilp (CPLEX 12.9) from Matlab R2022a. I request all 4 return arguments: ...
user2153235's user avatar
2 votes
2 answers
467 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
  • 429
2 votes
1 answer
506 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 ...
Elena's user avatar
  • 251
1 vote
0 answers
381 views

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

This is a sequencing problem. I've got this variables ...
Don Quijote's user avatar
2 votes
0 answers
134 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 ...
Johnthemathematician's user avatar
2 votes
2 answers
605 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 ...
Moritz Groß's user avatar
-1 votes
1 answer
360 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
144 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
5 votes
0 answers
124 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
2 votes
1 answer
164 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
380 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
3 answers
2k 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 ...
MIN's user avatar
  • 21
2 votes
1 answer
343 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. ...
Clement's user avatar
  • 2,252
0 votes
1 answer
257 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
8 votes
1 answer
382 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 ...
pqrz's user avatar
  • 470
2 votes
1 answer
561 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
321 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
2 votes
0 answers
116 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 ...
Daniele 's user avatar
5 votes
1 answer
471 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-...
sascha's user avatar
  • 537
2 votes
0 answers
77 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 ...
ShraddhaBG's user avatar
2 votes
0 answers
271 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 ...
Meth's user avatar
  • 424
7 votes
5 answers
2k 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, ...
Zach Lee's user avatar
  • 131
0 votes
0 answers
502 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
5 votes
1 answer
939 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 ...
errenmike1806's user avatar
1 vote
1 answer
528 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 ...
Sofia Saturn's user avatar
3 votes
1 answer
740 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. ...
Davi Doro's user avatar
  • 141