How is my model infeasible? The found IIS looks like 6 linear equations.
AnsweredI have a little bit complicated model of a neural network in ILP. My model is infeasible, but when I generate IIS as proposed in https://www.gurobi.com/documentation/10.0/refman/py_model_computeiis.html, the result does not seem to have any issues.
This is the output, content of the model.ilp file.
\ Model _copy
\ LP format - for model browsing. Use MPS format to capture full model detail.
Minimize
Subject To
layer0[0]: 0.0523901768028736 x_in[0] - 1.090577125549316 x_in[1]
- 3.333046913146973 x_in[2] + 1.491125702857971 x_in[3]
+ 1.703461408615112 x_in[4] + 1.466977000236511 x_in[5]
+ 1.07688581943512 x_in[6] + 0.1032520458102226 x_in[7] - x0[0]
= 1.943524360656738
layer0[1]: 0.1354961097240448 x_in[0] - 3.408795118331909 x_in[1]
- 6.388000011444092 x_in[2] - 4.904927253723145 x_in[3]
- 9.488981246948242 x_in[4] - 5.387706756591797 x_in[5]
+ 0.1015180423855782 x_in[6] - 0.0325086526572704 x_in[7] - x0[1]
= -1.159132719039917
layer0[4]: - 0.1198439598083496 x_in[0] - 3.604861259460449 x_in[1]
- 0.2500271797180176 x_in[2] + 0.2714583575725555 x_in[3]
+ 2.051778793334961 x_in[4] - 2.080660343170166 x_in[5]
- 1.41587245464325 x_in[6] + 0.0479931943118572 x_in[7] - x0[4]
= 0.3624397814273834
layer0[6]: - 0.00458212057128549 x_in[0] + 3.038036584854126 x_in[1]
- 3.21568751335144 x_in[2] - 2.080866813659668 x_in[3]
+ 0.8501386046409607 x_in[4] + 1.216349601745605 x_in[5]
+ 1.116223931312561 x_in[6] - 0.1770897656679153 x_in[7] - x0[6]
= 0.9103955626487732
layer0[7]: 0.2564927339553833 x_in[0] - 14.58760833740234 x_in[1]
+ 1.783399224281311 x_in[2] + 1.196542382240295 x_in[3]
- 1.628963351249695 x_in[4] - 2.484615802764893 x_in[5]
- 0.3548437356948853 x_in[6] - 0.026659594848752 x_in[7] - x0[7]
= -0.3091611564159393
layer0[8]: 0.0408732518553734 x_in[0] - 4.142473220825195 x_in[1]
- 2.372710227966309 x_in[2] + 1.245619058609009 x_in[3]
- 1.990143656730652 x_in[4] - 1.098648190498352 x_in[5]
- 0.1807908564805984 x_in[6] + 0.0237216893583536 x_in[7] - x0[8]
= -0.2022292166948318
Bounds
x_in[0] free
x_in[3] free
x_in[4] free
x_in[6] free
x_in[7] free
End
All present variables are continuous. To me this seems like a set of 6 linear equations, where a simple solution could be, that all for all i x_in[i] = 0 and x0[i] would just be - number on the right hand side of the relevant equation.
Is the method really showing all that is needed for determining the entire core of infeasibility?
From the definition of the problem, I can add that x_in values can get to 0, but even if they are set to any value, we can still just sum them as the constraints require us to sum them and set that as our value x0. This is actually what is supposed to happen, as this is a part of computation of the first layer, and variables x0 have no bounds on their value.
What am I missing? Thank you very much for any help or any insight.
-
Hi Jiří,
Looking at the IIS you've posted, only the following variables are free (i.e. not constrained as non-negative):
x_in[0] free
x_in[3] free
x_in[4] free
x_in[6] free
x_in[7] freeIn the LP file format, any variable without bounds listed is actually non-negative. So, the issue with the x_in[i] = 0, x0[i] = rhs[i] solution you propose is that since all x0 variables must be non-negative, it cannot satisfy the constraints for i = 0, 4, 6.
You should check whether the bounds for these variables are correct in your original problem. In a neural network model, I would expect all variables need to be free?
0 -
Hello Simon, thank you very much for your reply. Somehow I didn't realize that all variables have a default lower bound set to 0.
You've helped me a lot. Setting the lower bound to -infinity made the variables free and the model feasible.
0
Please sign in to leave a comment.
Comments
2 comments