Ali
Ali

Reputation: 58461

Resetting priorities just before branching or customized branching rule

Given the node where the MIP solver is just about to pick a variable to branch, I would like to suggest a small subset of variables to chose from but leave breaking ties to the solver's heuristics. I have good reasons to believe that this can significantly reduce the time needed to solve my integer programming problems. I prefer Gurobi (Python API) but I would be willing to switch to another solver (SCIP, CPLEX) if that is necessary.


Issues:

  1. I failed to figure out which Gurobi callback code tells me that the solver is just about to branch. As for CPLEX, I have found the BranchCallback and a detailed example; the corresponding SCIP doc is: How to add branching rules.

  2. The subset of variables that I want to suggest to the solver is computed on the fly, given the solution to the relaxation at the node. In other words, the branching priorities change from node to node, depending on the solution to the relaxed problem. It is unclear to me whether resetting the branching priorities in a callback is allowed and works as expected. The Gurobi doc of BranchPriority does not say, and I cannot "reverse engineer" it myself until issue #1 is not resolved.

  3. If necessary, I can break the ties myself too, and write my own complete branching rule instead of just suggesting a subset of variables; however this was not possible 5 years ago in Gurobi, and the doc of Callback suggests that the situation is still the same. Since implementing my own branching rule seems easier than changing my code to use SCIP or CPLEX, I would give the "custom fractional cuts via callback" mentioned in that Google Groups post a shot. Unfortunately, it is not clear to me how to do this. If that is any help: All my coefficients are integers, and all my variables are binary variables.

Upvotes: 0

Views: 888

Answers (1)

Tobias
Tobias

Reputation: 111

Except for the BranchDir parameter, there is no way in Gurobi to adjust the branching decisions. You can add cutting planes via a callback, but I guess this is not what you are looking for.

Upvotes: 0

Related Questions