18
votes
Accepted
Difference between lazy callbacks and using lazy constraints directly
Lazy constraints will only be checked when an MIP solution satisfying all other constraints, including integrality, is found.
If you provide all your lazy constraints in advance to CPLEX, for ...
12
votes
Accepted
How can I implement a user-written lazy constraint callback in concert CPLEX with C++?
You have it almost all right, with a few caveats. Let's say I want to implement a Foo Lazy Constraint:
...
10
votes
Accepted
When does Gurobi add cuts from callback
Assuming you are using more than a single thread, then Gurobi performs all work you code in the callbacks with a single thread. All remaining threads process the branch and bound nodes (without doing ...
8
votes
When does Gurobi add cuts from callback
While lazy constraints must be added each time a node is expanded at a branch-and-bound tree, a solver is not obligated to add user cuts at any point in time; it chooses when to add user cuts.
If ...
7
votes
Accepted
Duals in CPLEX generic callback
At the moment (CPLEX 12.10) querying duals in a relaxation context is not supported. You may want to file a request for enhancement for CPLEX to try to get this into one of the next versions.
This is ...
7
votes
Accepted
Lazy-Constraints for modelling soft-constraints (CPLEX + rejectCandidate semantics)
CPLEX does not memorize rejected solutions. When you call rejectCandidate, CPLEX adds the violated constraint to a pool of lazy constraints, applies it to the current node and re-solves the LP ...
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 ...
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, ...
5
votes
Program can't stop when using callback of usercut in CPLEX to solve a branch-and-cut problem
This question was also asked and answered on a CPLEX forum and on my blog.
Update: The gist of the answer is that when you add a cut in a callback, CPLEX updates the node solution to reflect that cut ...
5
votes
Accepted
CPLEX allows manually inserted solutions to violate lazy constraints
I think the answers to both questions are yes. The documentation for LazyConstraintCallback.getSolutionSource says the following: "Note that lazy constraint callbacks are not invoked for solutions ...
4
votes
How can I implement a user-written lazy constraint callback in concert CPLEX with C++?
I don't have any C++ code using a lazy constraint callback, although I could show you a Java example if you can't find anything better. The basic approach, IIRC, is to create an instance of class <...
4
votes
Accepted
How to determine whether the solution is integer feasible in a CPLEX heuristic callback?
Once you have gotten the values (in the node LP solution) for all variables, you can loop through the integer variables, computing the absolute difference between the value and the nearest integer. If ...
3
votes
Using callbacks in pyscipopt
You want a custom separator that doesn't actually do anything. Here's an example:
...
3
votes
Reproducing the CPLEX Output
You can get at least some of the information at every node (not just at the nodes where CPLEX decides to print a log entry) by attaching an information callback. See ...
3
votes
Custom lazy callback constraints using Google OR-Tools linear solver?
So
the routing library does not use a MIP solver to solve TSP/VRP... problems. So the assumptions of lazy callbacks is just false.
The question of goal programming is not that clear. You should look ...
3
votes
Is there any open source solver for MILP that can output the top N best results instead of the global best?
No, i am not aware of such a solver. However sequentially excluding previously optimal results comes with an additional pitfall: If the solver discovered symmetries and did cut them away you also ...
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 ...
2
votes
Implementing benders decomposition using Lazy and User cuts callback of Cplex
First, I don't understand why you extract the master model, set parameters and add the callback repeatedly inside a loop. When using a callback, the plan is to solve the master problem once, adding ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
callback × 21cplex × 14
mixed-integer-programming × 10
c++ × 3
branch-and-cut × 2
scip × 2
optimization × 1
linear-programming × 1
python × 1
solver × 1
constraint × 1
combinatorial-optimization × 1
gurobi × 1
constraint-programming × 1
pyomo × 1
vehicle-routing × 1
or-tools × 1
benders-decomposition × 1
java × 1
open-source × 1
cplex-python-api × 1
cbc × 1
coin-or × 1
opl × 1
concert × 1