Questions tagged [cplex]
Questions related to the commercial solver IBM ILOG CPLEX Optimization Studio.
232
questions
3
votes
1
answer
119
views
Dual problem in IBM CPLEX
Im solving n-dimensional Knapsack problem as LP problem.
I noticed that sometimes dual LP problem may be solved much faster than primal.
My test problem contains 500k variables and 50k constraints, ...
4
votes
1
answer
200
views
MIP Model with relaxed integer constraints takes longer to solve than normal model, why?
I am currently working on my undergrad thesis which is a mathematical optimization problem of the territory design family of problems. I am using the mathematical formulation of the problem to solve ...
1
vote
0
answers
55
views
Information about number of simplex and barrier iterations in OPL CPLEX
I would like to know how can I obtain the exact number of simplex and barrier iterations used by CPLEX in OPL. The solution reports the total number of iterations but I want them to be separated (...
0
votes
1
answer
35
views
Array of string in OPL
how to make 2d array of strings in Cplex
//indics
{string} cluster=...;
setof(string) darkstore =...;
setof(string)demandpoint =...;
//data
cluster={chav,sree};
demandpoint=[{tsnami,adholokam,...
3
votes
1
answer
112
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 ...
3
votes
3
answers
185
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. ...
2
votes
1
answer
102
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 ...
2
votes
3
answers
328
views
"Re-optimize" feature in Commercial Optimization
How does the "re-optimize" feature work in commercial optimization solvers such as IBM CPLEX and Gurobi? I recently experienced a considerable performance boost by re-solving a model with ...
2
votes
0
answers
51
views
Automated Benders Using Annotations
I'm trying to solve an optimization model using Automated Benders with annotations using CPLEX library in C++. I've defined a master problem and N (number of supply nodes in my model's network) ...
2
votes
1
answer
83
views
How should I implement Benders Decomposition with annotations in C++ using CPLEX library
I'm a beginner in C++ and want to implement Benders decomposition in C++ using CPLEX. I'm gonna use it for a special case study, so I need to customize the cuts to minimize the optimality gap. However,...
3
votes
1
answer
120
views
How to remove a callback that was previously registered in Julia?
I'm coding in Julia, how can I do the same as "Remove(Cplex.Callback)" function does in C++ ?
5
votes
1
answer
121
views
Two-Stage Stochastic Optimization: How to deal with Infeasible scenario while calculating EEV (Expected result of using the EV solution)
I am trying to solve some of the stochastic optimization proposed problems for an Optimization course I joined.
One of the exercices asks to solve the Expected Value problem. I already made it.
Next ...
2
votes
0
answers
61
views
Discrepancy between CPLEX interface solution and C API
I have a C API program uploaded here in Dropbox that is an LP. Here is the problem: When I compile the C file it gives me "1017 Not available for mixed-integer problems" while the problem is ...
7
votes
2
answers
418
views
Implementing Heuristic Callback in CPLEX C++ API for MILP
I am trying to implement a heuristic callback to a MILP with BOTH integer variables and continuous variables. After finding a feasible solution, I tried to use setSolution() to send the solution to ...
3
votes
2
answers
174
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/...
2
votes
1
answer
41
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 ...
2
votes
1
answer
90
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 ...
2
votes
2
answers
64
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}...
2
votes
1
answer
186
views
gams syntax issue - "set identifier or quoted element expected"
Writing some GAMS code, getting some syntax errors:
Anyone recognize the problem?
2
votes
1
answer
169
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 ...
2
votes
1
answer
114
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 ...
0
votes
1
answer
130
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?
3
votes
1
answer
152
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 ...
3
votes
2
answers
285
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 ...
2
votes
1
answer
189
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 ...
2
votes
1
answer
135
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, ...
1
vote
0
answers
173
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 (...
2
votes
0
answers
72
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) ...
4
votes
2
answers
201
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 ...
2
votes
1
answer
106
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 ...
2
votes
1
answer
182
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 ...
3
votes
0
answers
60
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
...
1
vote
0
answers
44
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 ...
4
votes
1
answer
153
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
96
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 ...
4
votes
3
answers
200
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
43
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 (...
4
votes
0
answers
96
views
2
votes
0
answers
58
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
255
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 ...
2
votes
1
answer
325
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 ...
1
vote
0
answers
207
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
121
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
302
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
268
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.
3
votes
1
answer
124
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 ...
5
votes
0
answers
122
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
129
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 ...
4
votes
0
answers
271
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 ...
2
votes
3
answers
902
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
...