Questions tagged [callback]

For questions on interfaces between a solver library and applications that allow to call user code at specific points in the solving process (e.g. on finding a new solution).

Filter by
Sorted by
Tagged with
1 vote
1 answer
42 views

custom branch and bound on cplex or GAMS

Does anyone have an idea how to create a custom B&B on CPLEX or GAMS? In my work, I need to add custom cuts on integer solutions in certain conditions by adding only one branch. Also, I need to ...
0 votes
0 answers
74 views

Can I call a function which depends on the decison variables in an objective function when using docplex?

I have a math model as shown below, which I want to solve with cplex via docplex. In my model, the decision variables represent an assignment to different places. In my objective function, I call a ...
2 votes
1 answer
49 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.
1 vote
0 answers
41 views

Why did the CONSENFOLP callback assertion fail when the problem has a primal feasible solution?

I am working on the problem that I am willing to use SCIP's conshdlr callback to check how the constraints might be added to the model. I am using the following ...
7 votes
2 answers
541 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 ...
10 votes
2 answers
995 views

How can I implement a user-written lazy constraint callback in concert CPLEX with C++?

I am trying to implement a user-written lazy constraint callback in concert CPLEX with C++. Although I know there exists a way to implement callbacks in concert CPLEX with C++ via macros, I am looking ...
3 votes
1 answer
268 views

Using callbacks in pyscipopt

How can I implement a callback-function to be executed at specific occurrences after having started to optimize? Specifically, I simply want the primal solution to be printed to the console every time ...
2 votes
1 answer
136 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 ...
3 votes
0 answers
87 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
139 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 ...
1 vote
0 answers
296 views

CPLEX callback in pyomo

I am trying to figure out what is the correct use of cplex callbacks in pyomo. In particular I am looking for the translation of the following example from gurobi to cplex: ...
5 votes
1 answer
135 views

Is there any open source solver for MILP that can output the top N best results instead of the global best?

I am working on an MILP problem, and the project needs to output the top N best results rather than the global best. I am looking for an open source solver which has a callback function. Can anyone ...
5 votes
1 answer
436 views

Lazy-Constraints for modelling soft-constraints (CPLEX + rejectCandidate semantics)

I basically have a (somewhat bloated) assignment-problem on a boolean-matrix: (N_WORKERS, N_TASKS). Let's assume, we only look at one specific worker and therefore we have a 1d boolean assignment-...
2 votes
0 answers
72 views

Making multiple branches in make_branch function of Cplex

In my current python code, I have used MyBranch call back of Cplex to make 2 branches and solve my model. However, I now need to generate 4 branches after the first incumbent is generated. I need ...
7 votes
1 answer
324 views

Duals in CPLEX generic callback

When using a generic callback in the "relaxation" context, it is fairly clear how to get values of the primal variables in the LP relaxation (along with a bunch of other stuff), but I can't ...
1 vote
1 answer
803 views

Custom lazy callback constraints using Google OR-Tools linear solver?

Is it possible to implement custom lazy callback constraints using OR-Tool's base linear solver? Through Google's docs, I've seen their TSP examples using the constraint solver ...
3 votes
0 answers
95 views

Extract/Inject Solutions (orig problem-space) during Search in MILP -> CoinOR Cbc

Task / Goal I'm considering adding some customized problem-specific local-search component on top of a general-purpose MILP solver (= improvement heuristic). The basic idea is the following: All new ...
3 votes
1 answer
915 views

Implementing benders decomposition using Lazy and User cuts callback of Cplex

I am trying to implement benders decomposition for a simple fixed charge transportation problem for the purpose of learning. I implemented the classic Benders decomposition successfully by adding ...
7 votes
1 answer
343 views

Program can't stop when using callback of usercut in CPLEX to solve a branch-and-cut problem

When I tried to use Java to call CPLEX and use callback functions to solve a VRP problem with branch-and-cut, some problems emerged. I took out the subtour elimination constraint from the original ...
2 votes
1 answer
447 views

How to determine whether the solution is integer feasible in a CPLEX heuristic callback?

I am working with a MILP formulation of a routing problem using Concert CPLEX 12.10. And I am implementing a greedy heuristic that uses the variables fractional values to attempt to construct an ...
12 votes
2 answers
749 views

When does Gurobi add cuts from callback

A while ago I used Gurobi and I added user cuts from within a callback. However, I got the feeling that my user cuts were not directly added to the model. Is it right that Gurobi can decide to ...
11 votes
1 answer
331 views

CPLEX allows manually inserted solutions to violate lazy constraints

I am using CPLEX 12.9 to solve a mixed integer linear programming problem. Some of my constraints are enforced through a legacy LazyConstraintCallback. Heuristic solutions are inserted through a ...
13 votes
1 answer
1k views

Difference between lazy callbacks and using lazy constraints directly

I'm trying to use lazy constraints to solve an optimization problem. In some software such as CPLEX or GUROBI, they have some tools to handle them directly (in the original model) or using callback ...