The "infeasible" model is feasible with pen and paper.
回答済みHi
I am getting "Model is infeasible" error on my optimization integer model.
I simplified the model to be able to verify it. Here is the simplified version:
(The goal is to choose either of Q_HI_0_0 or Q_HI_0_1 binaries while holding all equations. )
Subject To
C_Q_HI_0: Q_HI_0_0 + Q_HI_0_1 = 1
S0_HI: S_HI_0 = 50
D_HI_0: - 17 Q_HI_0_0 + D_HI_0 = 0
A22_HI_cnst_0: A22_HI_0 - D_HI_0 = -50
E_HI_0: - R_HI_0 + E_HI_0 - B_HI_0 + D_HI_0 = 0
R0_HI: R_HI_0 - S_HI_0 = 0
C_EH_HI_0: - R_HI_0 + D_HI_0 <= 0
A1_HI_1: - E_HI_0 + A1_HI_1 = 50
D_HI_1: - 17 Q_HI_0_1 + D_HI_1 = 0
A22_HI_cnst_1: - B_HI_0 + A22_HI_1 - D_HI_1 = -50
E_HI_1: - R_HI_1 + E_HI_1 - B_HI_1 + D_HI_1 = 0
R_HI_1: B_HI_0 + R_HI_1 - S_HI_1 = 0
C_EH_HI_1: - R_HI_1 + D_HI_1 <= 0
Bounds
Binaries
Q_HI_0_0 Q_HI_0_1
Generals
R_HI_0 E_HI_0 S_HI_0 A1_HI_0 A22_HI_0 B_HI_0 A_HI_0 D_HI_0 R_HI_1 E_HI_1
S_HI_1 A1_HI_1 A22_HI_1 B_HI_1 A_HI_1 D_HI_1
General Constraints
GC0: B_HI_0 = MAX ( A22_HI_0 , 0 )
GC1: S_HI_1 = MIN ( A1_HI_1 , 30 )
GC2: B_HI_1 = MAX ( A22_HI_1 , 0 )
End
With a pen and a paper, I put Q_HI_0_0 == 1 and everything is fine. but on Gurobi I get this IIS:
The following constraint(s) cannot be satisfied:
D_HI_0
A22_HI_cnst_0
I am new Gurobi user and I don't have any clue about the possible cause of this error.
Thanks in advance for any help or hint.
Regards
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Ehsan,
Q_HI_0_0 is a binary variable, and A22_HI_0 is a nonnegative integer variable. The two constraints in question are:
D_HI_0: - 17 Q_HI_0_0 + D_HI_0 = 0
A22_HI_cnst_0: A22_HI_0 - D_HI_0 = -50If we add these together, we have the new (valid) constraint
- 17 Q_HI_0_0 + A22_HI_0 = -50
This constraint cannot be satisfied, because A22_HI_0 is nonnegative.
How are you adding these variables to the model? For example, in the Python API, variables added with Model.addVar() are nonnegative by default, though a different lower bound can be specified using the lb keyword argument (e.g., lb=-GRB.INFINITY).
Does this help? Thanks!
Eli
0 -
Thanks Eli for your time.
That's exactly answered my problem! I use python and addVar. Also A22_HI_0 values are always negative.
Thanks again.
Ehsan
0 -
Thanks Eli for this suggestion:
"
in the Python API, variables added with Model.addVar() are nonnegative by default, though a different lower bound can be specified using the lb keyword argument (e.g., lb=-GRB.INFINITY).
"
This solved a "model is infeasible" problem for me :)
0
投稿コメントは受け付けていません。
コメント
4件のコメント