Guroubi decides not to apply usercuts during the search?


#1

** Same question posted on Github at: https://github.com/JuliaOpt/JuMP.jl/issues/1391#issuecomment-410490319

Hello,

I have an MILP which I solve through a branch-and-cut procedure (hence using a callback function). I am printing out the violated valid inequalities and the number of explored nodes during the tree search. I have noticed that often times the console returns the same inequality for a different number of explored nodes, which leads me to suppose that the same usercut is being produced twice and at different nodes (hence affecting performance!).

Is it possible that Gurobi didn’t apply the usercut for a “low” violation but it is applying it later for a “higher” violation? If so, is there any way to “impose” a usercut as soon as it is encountered the first time?

For example, say the constraint is the following:
@usercut(cb, sum(x[path[h],path[h+1]] for h=collect(1:length(path)-1)) <= (length(path)-3)
Where path is a vector containing some node ids.
Then, using node = MathProgBase.cbgetexplorednodes(cb), the console prints out:

Num explored nodes 14.0: the constraint is produced for path [10, 13, 19, 42, 26, 34] with
x_val 3.1328960560421835
Num explored nodes 15.0: the constraint is produced for path [10, 13, 19, 42, 26, 34] with x_val 3.14372170874214