I have a feasible base Integer LP model with roughly 2000 variables & 3000 constraints.
Given a small set of variables with some particular intervals, (e.g. a in 1:6, b in 2:7, c in -3:5), I would like to query how many combinations are feasible with the base model.
At the moment, I have to try each combination, with
- add constraints to base model (either by constraint like a = 2, or by fixing the lower/upper bound of the variable )
- solve it, see if it is feasible.
- Reset the modified model to the original state.
In this particular case, I have to run solver 6 * 6 * 9 times.
It takes on average about 0.02 sec on each solve. So if there are 10000 feasible combinations, it takes at least 10000 * 0.02 = 3 mins.
Is there any way I can speed it up? What's the best way to tackle such problems?
I noticed that for each solve, Gurobi has to do a presolve which takes at least 80% of the total solving time.
Is there any way I can reuse the presolved model, (i.e. modify the bounds / add constraints upon the presolved model)?
The following is a typical presolve.
Optimize a model with 2077 rows, 2016 columns and 5581 nonzeros
Coefficient statistics:
Matrix range [1e+00, 2e+04]
Objective range [0e+00, 0e+00]
Bounds range [1e+00, 1e+04]
RHS range [5e-01, 2e+04]
Presolve removed 1772 rows and 1797 columns
Presolve time: 0.01s
Presolved: 305 rows, 219 columns, 879 nonzeros