Questions tagged [cplex]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
18 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,...
1 vote
0 answers
143 views
+100

Manual Benders Algorithm on CPLEX

I am using a manual Benders implementation for a problem. For that, I need to store certain variables since I need to transfer them to sub or master problems. However, as the size of the problem gets ...
0 votes
0 answers
68 views

Cplex solution and dual of a problem

I have the following problem: I took its dual as follows: However, when I solve it on CPLEX, I somehow do not get the same objective value. Do you think there is something wrong? Also, do you know ...
3 votes
1 answer
72 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
142 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
79 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
323 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 ...
  • 372
2 votes
0 answers
47 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) ...
  • 41
2 votes
1 answer
65 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,...
  • 41
3 votes
1 answer
109 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++ ?
  • 173
5 votes
1 answer
106 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
56 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 ...
  • 27
7 votes
2 answers
382 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
150 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/...
  • 372
2 votes
1 answer
37 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 ...
  • 173
1 vote
1 answer
48 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 ...
  • 372
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}...
  • 31
2 votes
1 answer
149 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
117 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 ...
  • 372
2 votes
1 answer
97 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 ...
  • 21
0 votes
1 answer
108 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
149 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
252 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
158 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
122 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
125 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
56 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
189 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 ...
  • 61
2 votes
1 answer
99 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
2 votes
1 answer
149 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 ...
  • 61
3 votes
0 answers
57 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
42 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
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
77 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
197 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
42 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
83 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
54 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
223 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
284 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
171 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
120 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
274 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
244 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
113 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
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
126 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
237 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
712 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
245 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. ...
  • 2,028

1
2 3 4 5