Instead of rebuilding the model every time we want to change the set of cuts we include, we could try "turning off" contraints by relaxing their RHS.
Since Θ ≤ α + π'x gets re-written as -∞ ≤ Θ - π'x ≤ α, we can just store the α of each constraint, and "turn off" the constraint by replacing it with some big-M (i.e. +∞). Hopefully Gurobi is smart enough to understand that it doesn't need to consider these. This changes the model rebuild from a lot of work to a change in the RHS (fast).
Enhancement 2
Another option is to check the hash of new cuts to avoid adding duplicate cuts: i.e. ask a cut oracle if it should add the cut.
It actually turns out this is only efficient for very small models. Anecdotally, >98% of cuts in a large-scale farming model are unique.
Enhancement 1
Instead of rebuilding the model every time we want to change the set of cuts we include, we could try "turning off" contraints by relaxing their RHS.
Since
Θ ≤ α + π'x
gets re-written as-∞ ≤ Θ - π'x ≤ α
, we can just store theα
of each constraint, and "turn off" the constraint by replacing it with some big-M (i.e.+∞
). Hopefully Gurobi is smart enough to understand that it doesn't need to consider these. This changes the model rebuild from a lot of work to a change in the RHS (fast).Enhancement 2
Another option is to check the hash of new cuts to avoid adding duplicate cuts: i.e. ask a cut oracle if it should add the cut.
It actually turns out this is only efficient for very small models. Anecdotally, >98% of cuts in a large-scale farming model are unique.