Model infeasible but not sure why, formulation is sound
AnsweredCould someone help me pinpoint the issue of the model with this error result:
"
Gurobi Optimizer version 9.0.3 build v9.0.3rc0 (win64) Optimize a model with 2922876 rows, 3868200 columns and 58611564 nonzeros Model fingerprint: 0x2f72d501 Variable types: 600 continuous, 3867600 integer (3867600 binary) Coefficient statistics: Matrix range [9e-03, 6e+03] Objective range [1e+00, 2e+04] Bounds range [1e+00, 1e+00] RHS range [1e+00, 6e+03] Presolve removed 0 rows and 61500 columns Presolve time: 7.48s Explored 0 nodes (0 simplex iterations) in 8.03 seconds Thread count was 1 (of 8 available processors) Solution count 0 Model is infeasible Best objective -, best bound -, gap -"
-
You can run the Model.computeIIS() method on your model to examine why your model is infeasible. It will provide a minimal subset of constraints and variable bounds that, if isolated from the rest of the model, is still infeasible. You can obtain information about these constraints and variable bounds by writing an
.ilp
format file.model.compteIIS()
model.write("model.ilp")Please refer to the article How do I determine why my model is infeasible for more details.
0 -
This is the result I got:
which based on my understanding to IIS means none of the constraints is causing infeasibility
IIS computed: 0 constraints, 2 bounds IIS runtime: 0.04 seconds
0 -
This means that there are two variables whose bounds are causing the infeasibility in your model. You can get information about these variables by writing the results in an
.ilp
format file.model.write("model.ilp")
0 -
You can open this file using any text editor and check the variables that have conflicting bounds.
0 -
So, I got the following:
Minimize
0 CostPattern[T0] + 1.1283033680279922e+10 Constant
Subject To
Bounds
CostPattern[T0] >= 1e+100
Constant = 1
EndI think when I was defining the variable CostPattern, I added lower bound as lb=GRB.INFINITY,, which apparently corresponds to the positive infinity only.
How can I update this variable only without constructing the whole model again?
I tried using model.update()
then adding the variable again and objective function and corresponding constraints, didn't work.
Does it overwrite the old variables or constraints or add them on top of each other? because I did notice that my variables numbers increased.
0 -
There is no need to add a new variable, you can simply update the lower bound of the existing variable. For instance,
x.lb = 1
will set the lower bound of variable x to 1. The next model.optimize() call will pick up the change.
0
Please sign in to leave a comment.
Comments
6 comments