8
votes
Accepted
CPLEX violating constraints (CPLEX - version 12.10 - C++)
Your problem is that double precision arithmetic is not perfectly accurate. Consequently, CPLEX (and pretty much every other solver) has various tolerance settings for when a double precision value is ...
6
votes
Implementing Heuristic Callback in CPLEX C++ API for MILP
Disclaimer: It's been a while since I used Cplex' C++ API.
According to your question, you probably rather want to use a generic callback and inject a feasible (heuristic) solution through ...
6
votes
"Re-optimize" feature in Commercial Optimization
CPLEX has an advanced start parameter which dictates how it acts when solve is called on a previously solved/partially solved model.
For MIP models with the default setting of the parameter, if you ...
5
votes
MIP Model with relaxed integer constraints takes longer to solve than normal model, why?
First, it is risky to draw conclusions with so few data. It could just be luck.
Still, there are some possible reasons why setting some variables as integer might be beneficial:
It can trigger more ...
5
votes
Accepted
Implementing Heuristic Callback in CPLEX C++ API for MILP
As @Joni notes, there is a parameter that controls how much (if any) effort CPLEX spends checking solutions you supply.
You can freely mix integer and continuous variables in the call to setSolution, ...
4
votes
Accessing Lagrange Multipliers in CPLEX
From the official CPLEX documentation here (CPLEX 20.1): SolutionInterface.get_dual_values() does indeed return the Lagrange/dual values.
3
votes
Dual problem in IBM CPLEX
If the primal LP problem suffers from degeneracy, I believe dual simplex may be faster. You might try using the barrier method to solve the (primal) LP. In cases where the LP has degeneracy issues, I ...
3
votes
Tips for implementing Benders Decomposition in C++?
Recent versions of CPLEX (12.7 or later) have built in support for Benders. You can let CPLEX decide what to put in the master problem and what goes in the subproblems, or you can use annotations to ...
3
votes
Accepted
Can a logical expression be added to the objective function of a model in docplex?
We can use a "big M" approach, assuming that you can find a positive constant $M$ such that $\vert y_{jk}-y_{ik} \vert \le M$ for all $k\in K$ and $(i,j)\in V.$
Introduce new binary ...
3
votes
Summation of maximization terms in CPLEX
It sounds like you want to maximize $$\sum_i \sum_j c_{ij} x_{ij}$$ subject to
\begin{align}
\sum_j x_{ij} &=1 &&\text{for all $i$} \\
x_{ij} &\in\{0,1\} &&\text{for all $i$ ...
3
votes
How to remove a callback that was previously registered in Julia?
Currently there is no support for removing a callback from a model in JuMP. Your options are:
Rebuild the model
Set a new callback that does nothing
The Julia discourse forum is another platform you ...
3
votes
Two-Stage Stochastic Optimization: How to deal with Infeasible scenario while calculating EEV (Expected result of using the EV solution)
A paper here speak of scenarios for EEV that are infeasible. Alternative is to use a complete recourse model, unfix stage 1 variables for the model to adapt. I guess you may experiment by making ...
3
votes
Accepted
How to get the fractional solution of a node in a MIP model using JuMP package?
In general, JuMP does not support querying the best fractional solution of a branch and bound tree.
However, if you are using CPLEX or Gurobi, you can write a solver-specific callback to do what you ...
3
votes
Accepted
Non-proprietary (Python friendly) alternatives to Cplex and Gurobi
You can use HiGHS, SCIP and CBC solvers with using PYOMO or other Pyomo supported solvers. Also you can use google or-tools CP solver if you write CP model, google CP solver is very powerfull. PYOMO ...
2
votes
Accepted
Modifying and re-optimizing a model using CPLEX Python API
You can do incremental changes
https://github.com/AlexFleischerParis/zoodocplex/blob/master/zooincremental.py
...
2
votes
Accepted
Converting continuous variable dict to binary variables in python docplex
If you would like to convert a variable into another type, this can be possible by using ilo.conversation method. This can be invoked on DoCplex by;
...
2
votes
Which data type is best used when programming an optimization problem in C++?
There is no definitive answer and it depends on:
your background
the nature / characteristic of your problem
the nature / characteristic of your implementation (proof of concept; deployed software)
...
2
votes
How to obtain nodes count and nodes left in docplex (using CPLEX 12.20 and Python 3.8)
I think what you want can be seen in the CPLEX log as follows:
...
2
votes
Accepted
Info callback in CPLEX OPL
I am not aware of if informational callbacks can be invoked directly via OPl-CPLEX the same as the low-level programming language. For more details, you can check ...
1
vote
Linear Programming faster solver: CPLEX or Gurobi?
I think the performance for different solvers depends on your problems structure. Maybe some of specific problems will lead better performance for that solver.
In general, in my opinion, both of them ...
1
vote
Tips for implementing Benders Decomposition in C++?
For example, If your problem is two-stages stochastic programming, then you can separate your problem into master problem and sub-problem by your hands.
Then you can use CPLEX to model both stages in ...
1
vote
How to change CPLEX parameters from within CPLEX Studio IDE 22.1.1
I tried using this option in the CPLEX studio OPL-CPLEX 20.1.0. I am not aware of if, it changes in the latest version. To that you need to change ...
1
vote
Which data type is best used when programming an optimization problem in C++?
I would suggest taking a look at the C++ source code examples that ship with CPLEX Optimization Studio. Then have a look at the documentation for the C++ API, specifically for the optim.concert group. ...
1
vote
Accepted
Get objective upper bound in a callback (cplex)
I'll use Java notation, but C++ should be very similar if not the same. There is a method IloCplex.Callback.Context.getDoubleInfo() that takes an enumeration value as argument and returns a double ...
1
vote
Cplex seems to terminate early as optimal when starting solution polishing
First of all, I think you have to display the final MIP gap in your terminal, maybe that actually MIP gap is zero.
If not, in my opinion, you have to check several experiments. Using MIP solver solve ...
1
vote
Array of string in OPL
.mod
{string} cluster=...;
string darkstore [cluster][1..4]=...;
string demandpoint [cluster][1..4]=...;
.dat
...
1
vote
"Re-optimize" feature in Commercial Optimization
Probably this link from Gurobi will help. You have to call the optimize() function in gurobi after you change parameters like the rhs of a constraint, add/remove constraints, change bounds of ...
1
vote
How should I implement Benders Decomposition with annotations in C++ using CPLEX library
I think I just answered this on my blog, but for the record, CPLEX does not (as far as I know) provide access to Benders cuts when the problem is partitioned automatically using annotations. So to ...
1
vote
Summation of maximization terms in CPLEX
Wouldn't know exactly in CPLEX but referring to this answer one way is to define $\theta_i$ and binary variables $z \in \{0,1\}^{I\times J}$as
$ c_{ij}x_j \le \theta_i \le c_{ij}x_ j + M(1-z_{ij}) \ \ ...
1
vote
Updating constraint set rhs in docplex
I think the method you pointed out would be as follows:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cplex × 248mixed-integer-programming × 74
optimization × 37
python × 33
solver × 33
linear-programming × 32
gurobi × 26
docplex × 26
modeling × 22
cplex-python-api × 18
c++ × 15
pyomo × 14
callback × 14
integer-programming × 13
benders-decomposition × 12
opl × 12
constraint-programming × 9
gams × 9
constraint × 8
combinatorial-optimization × 8
quadratic-programming × 8
java × 8
scheduling × 7
linearization × 6
branch-and-bound × 6