In many practical applications, linear programming (LP) models are modified and solved iteratively. This could involve adding or removing constraints, changing matrix coefficients, changing the objective, or updating variable bounds.
Gurobi can use basis information from the previous solve to construct a warm start for the modified model. However, the effectiveness of the warm start depends on how the model is modified between solves. The table below outlines the types of model changes that allow Gurobi to reuse a prior optimal LP basis and those that do not.
| Modification Type | Warm Start Possible | Algorithm Used for Warm Start | |
| 1 | Add constraint | ✅ Yes | Dual Simplex |
| 2 | Remove constraint | ✅ Conditional† | Depends† |
| 3 | Add variable | ✅ Yes | Primal Simplex |
| 4 | Remove variable | ✅ Conditional‡ | Depends‡ |
| 5 | Change objective coefficient | ✅ Yes | Primal Simplex |
| 6 | Change right-hand side value | ✅ Yes | Dual Simplex |
| 7 | Adjust variable bound | ✅ Yes | Dual Simplex |
| 8 | Change constraint coefficient | ❌ Generally, no | Cold start required |
If the warm-start basis is optimal, then:
- Adding a constraint to the primal model corresponds to adding a variable in the dual. Treating the new dual variable as nonbasic at zero preserves dual feasibility of the basis, but the associated primal solution may violate the new constraint. The warm start can therefore always be used in the dual space.
- Removing a constraint relaxes the primal problem. If the constraint was non-binding at optimality, the previous basis remains primal-feasible, and the warm start is valid in the primal space. †If the constraint was basic (i.e., active in the optimal solution), removing it invalidates the basis as is. However, the basis is typically repaired quickly (by dropping the deleted row's basic variable and choosing a replacement) and continued with a primal warm start.
- Adding a variable (whose domain contains zero) leaves the basic solution primal-feasible by taking the new variable nonbasic at zero. This supports warm starting in the primal space.
- Removing a variable from the primal problem corresponds to removing a constraint from the dual problem. If the variable was nonbasic, the previous basis remains dual-feasible, and the warm start is valid in the dual space. ‡If the variable was basic, its removal invalidates the basis as is, but the basis is typically repaired quickly.
- Changing an objective coefficient does not affect primal feasibility, so the basis remains primal-feasible. However, dual feasibility may change. The warm start can therefore still be used in the primal space.
- Changing a right-hand side value can render the current basis primal-infeasible, while dual feasibility of the basis is preserved. The warm start can therefore still be used in the dual space.
- Changing a variable bound can similarly destroy primal feasibility (if the current solution violates the new bound) while leaving dual feasibility intact. The warm start can therefore still be used in the dual space.
- Changing matrix coefficients (entries of the constraint matrix) is not guaranteed to preserve either primal or dual feasibility of the current basis. In this case, Gurobi does not reuse the previous warm-start basis and effectively reoptimizes the LP without advanced-start information.
If the original model is infeasible and some constraints are removed, Gurobi will start from scratch. If the model is an LP and the user wants to compute an IIS, Gurobi will use the information contained in the last basis to guide the search.
Further Information: