Questions tagged [cplex]
Questions related to the commercial solver IBM ILOG CPLEX Optimization Studio.
248
questions
2
votes
1
answer
36
views
Info callback in CPLEX OPL
Does CPLEX OPL provides support for info callback? By info callback I am referring to callback allowing to retrieve information of the current solution at a given step of the optimization process.
-3
votes
0
answers
30
views
-1
votes
0
answers
38
views
soft constraint has reduced run time compared to hard constraint
I have a constraint for an optimization problem where
X - slack <= stock
Slack penalty is very high 10000 .Total objective function is 108.There is decimal ...
1
vote
0
answers
78
views
Weird behavior when using Automatic Benders Decomposition in CPLEX
I've encountered some weird behavior when using the Automatic Benders Decomposition in CPLEX.
I initially solved the MIP without BD and then I compared the results against the Full, Workers and User ...
2
votes
1
answer
122
views
Non-proprietary (Python friendly) alternatives to Cplex and Gurobi
I have implemented a pure binary integer combinatorial optimization routine within a Python module (importing gurobipy), and experimented with relaxing a few ...
1
vote
1
answer
43
views
How to obtain nodes count and nodes left in docplex (using CPLEX 12.20 and Python 3.8)
I solving a MILP problem as given below using Python 3.8 and CPLEX 12.20. I want to obtain the number of nodes and nodes left. The details of the codes are as follows:
n_xvars=2
n_yvars=2
#Create ...
0
votes
1
answer
88
views
Linear Programming faster solver: CPLEX or Gurobi?
Which one is the best solver for solving large-sized problems in Linear Programming, CPLEX or Gurobi?
Which one is faster?
0
votes
2
answers
91
views
Tips for implementing Benders Decomposition in C++?
currently I am working on implementing Benders Decomposition for a large-scale stochastic MIP in C++ using the CPLEX Solver. I've been spending the last couple of months learning the programming ...
1
vote
1
answer
34
views
How to change CPLEX parameters from within CPLEX Studio IDE 22.1.1
I coded my mathematical program in CPLEX Studio IDE 22.1.1 However due to the difficulty of the problem the run takes days and then shows an out of memory error. I read that I can try to use "...
2
votes
2
answers
97
views
Which data type is best used when programming an optimization problem in C++?
Switching over from CPLEX Optimization Studio, now I want to solve problems in C++ using the CPLEX API.
Being used to the CPLEX data types, I was wondering how they best translate to C++.
For example, ...
1
vote
0
answers
94
views
Why the column generation algorithm remains stuck at the same solution?
I was trying to solve a MILP by a column generation algorithm, and I noticed that the algorithm was stuck at the same solution, I tried to diversify the pool of initial columns, but the problem I ...
1
vote
0
answers
66
views
Linearization of Conditional Constraints for MIP using Cplex
I'm currently working on a mixed-integer programming (MIP) problem and I'm trying to implement a set of conditional constraints in CPlex. These constraints involve decision variables that are indexed ...
2
votes
1
answer
73
views
Can a logical expression be added to the objective function of a model in docplex?
I'm working on an optimization problem using Docplex and wonder if it's possible to incorporate a logical expression into the objective function of my model.
Specifically, I have three variables x, y, ...
1
vote
1
answer
51
views
Get objective upper bound in a callback (cplex)
I wonder if there is a way to retrieve the global objective upper bound in a callback in Cplex (in cpp)? I tried several context/IloCplex/IloModel... methods but nothing worked.
2
votes
1
answer
347
views
CPLEX violating constraints (CPLEX - version 12.10 - C++)
I'm a researcher and I have a problem with CPLEX. The .lp file containing the model includes the following constraint:
1000000000 x(1,12,0) + T(1,0) - T(12,0) <= 999999992
where x and T are ...
0
votes
1
answer
125
views
Cplex seems to terminate early as optimal when starting solution polishing
I occasionally see this slightly strange thing happen with cplex where it jumps from a MIP gap of, say 5%, to then reporting the status as optimal. This happens when it starts solution polishing after ...
3
votes
1
answer
174
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
234
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
69
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
57
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
181
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
219
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
150
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
369
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
59
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
115
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
141
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
165
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
64
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
483
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
229
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
49
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
223
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
254
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
304
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
156
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
159
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
169
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
368
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
277
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
162
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
1
answer
254
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
88
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
227
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
119
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
281
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
78
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
49
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
154
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....