Bug with "presolve"
AnsweredI found that presolving is sometimes buggy.
For example, in the following problem, the presolved model has objective 0.0, and all its variables/constraints are removed, which is clearly not true.
A, b, c = np.ones((10, 5)), 10 * np.ones(10), np.ones(5)
ip = gp.Model()
x_var = ip.addMVar(n, lb = 0.0, ub = float('inf'), vtype = GRB.BINARY, name = 'x')
ip.addConstr(A @ x_var <= b)
ip.setObjective(c @ x_var, GRB.MAXIMIZE)
presolved = ip.presolve()
print(presolved.getObjective())
ip.optimize()
This problem is reproducible on both my PC and colab versions.

Hi,
The model you construct hold redundant constraints only, they all state
\[\sum_{i=1}^5 b_i \leq 10\\
b_i \in \{0,1\}\]When these constraints are removed, the objective function is trivial as well.
Thus, Gurobi can provide the optimal solution without actually solving it. Therefore, the presolved model is a trivial one. Please also note that as described in How does presolve work?, it is not always possible to reproduce the original model from the presolved model. In this extreme example, the only information you get from the presolved model is that your model is indeed a trivial one.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment