The current planning is not feasible, but there is no conflict in the output conflict constraints.
AnsweredA linear programming model is established, and the solution shows that it is not feasible. The output conflict constraint discovery does not conflict. The infeasible original model is exported to the lp file, and then read in and solved. It is found that it is feasible.
-
Here are some suggestions from our newly updated Gurobi AI Assistant Gurobot; maybe it gives you some ideas on how to diagnose the issue.
This is a known issue that can occur due to several factors related to numerical precision, presolve operations, and LP file format handling. Here are the most likely causes and solutions:1. Models at the Edge of Infeasibility Your model is likely at the boundary between feasibility and infeasibility within numerical tolerances. Such models can appear both feasible and infeasible depending on the solution path taken. The fact that conflict constraint discovery finds no conflicts supports this theory - the model is so close to the feasibility boundary that different numerical paths yield different results.
2. Presolve Effects Gurobi's presolve algorithms can sometimes contribute to numerical issues. When you export to LP format and re-read, the model may be processed differently by presolve, potentially avoiding the numerical issues that caused the original infeasibility.
To test this, try disabling presolve on your original model:
python
model.Params.Presolve = 0 model.optimize()Or try disabling aggregation specifically:
python
model.Params.Aggregate = 0 model.optimize()3. LP File Format Precision The LP file format may handle numerical precision differently than the in-memory model representation. When coefficients are written to and read from the LP file, slight rounding or formatting changes might push the model from the infeasible side to the feasible side of the numerical boundary.
Recommended Solutions:
-
Adjust Numerical Parameters:
- Set
NumericFocus=2orNumericFocus=3for more careful numerical computations - Tighten feasibility tolerances:
FeasibilityTol=1e-9 - Use
Method=1(dual simplex) which is often more numerically stable than barrier
- Set
-
Test Different Presolve Settings:
- Try
Presolve=0to disable presolve entirely - Try
Aggregate=0to disable aggregation while keeping other presolve reductions
- Try
-
Use Feasibility Relaxation:
python
if model.Status == GRB.INFEASIBLE: model.feasRelax(0, False, None, None, None, None) model.optimize() - Export to MPS Format Instead: The MPS format is more standardized and may handle numerical precision more consistently than LP format.
0 -
Adjust Numerical Parameters:
Please sign in to leave a comment.
Comments
1 comment