0

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.

Ali
  • 56,466
  • 29
  • 168
  • 265
  • [*"We don't provide any user control over the tree traversal strategy, beyond the BranchPriority attribute and the BranchDir parameter."*](https://groups.google.com/forum/#!topic/gurobi/YZHG48FQLaU) (Mar 21, 2015) As for the custom branching rule, that doesn't look very promising. :( – Ali Mar 31 '15 at 16:08
  • Although SCIP features branching priorities for every variable individually, it is possible that you run into issues if you assign the priorities AFTER SCIP already collected the fractional LP variables at a node. Adjusting the variable branching factor which influences the branching score would be safer in such a case. A custom branching rule is then not needed, only an [event handler](http://scip.zib.de/doc/html/EVENT.php) reacting on solved LPs. – Gregor Mar 31 '15 at 16:49
  • @Gregor Could you expand on the *"adjusting the variable branching factor"* part, please? – Ali Mar 31 '15 at 16:52
  • The branching factor in SCIP represents a soft means of prioritization; the actual branching score of the variable is multiplied by its factor, which defaults to 1.0. Giving some variables a higher factor, say 10, via SCIPchgVarBranchFactor() will prioritize these variables in many, but not all situations: Variables with a low branching factor may be selected if they have an outstanding branching score themselves. I call this 'soft' because all fractionals are considered for branching.' – Gregor Mar 31 '15 at 20:40
  • @Gregor Interesting. Although it is not the answer that I was hoping for, would you consider writing it up in an answer, preferably with some code, or at least with links to the relevant functions of the API? I will certainly upvote it, but wait for other answers concerning Gurobi. In any case, thanks for the help! – Ali Mar 31 '15 at 20:51
  • 1
    Haha, thanks, but I will instead talk to my Gurobi friends tomorrow, I am not sure in how far they follow their tag here. If they have no suitable callback or answer, I will consider writing an answer. Good luck with your project! – Gregor Mar 31 '15 at 21:48

1 Answers1

0

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.

SomethingDark
  • 13,229
  • 5
  • 50
  • 55
Tobias
  • 111
  • I would like to ask you to please delete your answer. It doesn't not add any new information. – Ali Apr 01 '15 at 14:36