Infeasibility Issue with Quadratic Objective Model with a few General MAX constraints
AnsweredI'm experiencing an infeasibility issue with my Gurobi model, which includes a quadratic objective function and a mix of linear, quadratic, and general Max constraints. Despite several attempts to identify and resolve the conflicting constraints through IIS, the model remains infeasible.
Objective: Maximization of a sum over a few quadratic terms, incorporating decision variables with general bounds. I've verified the constraints and variable bounds, yet the issue persists.
Error:
"
Model is infeasible or unbounded
Best objective -, best bound -, gap -
IIS computed: 2 constraints, 2 bounds
IIS runtime: 0.01 seconds (0.00 work units)
"
Attempts:
- Reviewed the model constraint and bounds.
- Ensured no logical errors in constraint definitions.
This is my model lp file:
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
\ Model Simple-Program
\ LP format - for model browsing. Use MPS format to capture full model detail.
Maximize
- 0.375 lv[1] - 0.375 lv[2] - 0.25 lv[3] - 0.25 lv[4] - 0.25 lv[5]
+ 0 m1[5] + 0 M2[5] + 0 u[5] + 0 v[5] + 1.5 Constant + [
0.125 lv[1] * lv[3] + 0.125 lv[1] * lv[4] + 0.125 lv[1] * lv[5]
+ 0.125 lv[2] * lv[3] + 0.125 lv[2] * lv[4] + 0.125 lv[2] * lv[5] ] / 2
Subject To
R0: - 0.5545145424960141 w[0] + 1.31852223486149 w[1] + u[1] = 1
R1: - 0.5545145424960141 w[0] + 1.31852223486149 w[1] + v[1] = -1
R2: lv[1] - m1[1] + M2[1] = 0
R3: - 1.329074538363463 w[0] + 0.5703375248470628 w[1] + u[2] = 1
R4: - 1.329074538363463 w[0] + 0.5703375248470628 w[1] + v[2] = -1
R5: lv[2] - m1[2] + M2[2] = 0
R6: - 1.217584841988603 w[0] + 0.6684601097669878 w[1] + u[3] = 1
R7: - 1.217584841988603 w[0] + 0.6684601097669878 w[1] + v[3] = -1
R8: lv[3] - m1[3] + M2[3] = 0
R9: - 0.6660042388708748 w[0] + 1.220399649941565 w[1] + u[4] = 1
R10: - 0.6660042388708748 w[0] + 1.220399649941565 w[1] + v[4] = -1
R11: lv[4] - m1[4] + M2[4] = 0
qc0: [ w[0] ^2 + w[1] ^2 ] <= 1
Bounds
Constant = 1
General Constraints
GC0: m1[1] = MAX ( u[1] , 0 )
GC1: M2[1] = MAX ( v[1] , 0 )
GC2: m1[2] = MAX ( u[2] , 0 )
GC3: M2[2] = MAX ( v[2] , 0 )
GC4: m1[3] = MAX ( u[3] , 0 )
GC5: M2[3] = MAX ( v[3] , 0 )
GC6: m1[4] = MAX ( u[4] , 0 )
GC7: M2[4] = MAX ( v[4] , 0 )
End
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
and this is the computed IIS.ilp file:
******************************************************************************
\ Model Simple-Program_copy
\ LP format - for model browsing. Use MPS format to capture full model detail.
Maximize
Subject To
R1: - 0.5545145424960141 w[0] + 1.31852223486149 w[1] + v[1] = -1
qc0: [ w[0] ^2 + w[1] ^2 ] <= 1
Bounds
w[0] free
End
******************************************************************************
Could you provide insights or suggestions on resolving the infeasibility? Are there common pitfalls or best practices in formulating constraints for such models that I might have overlooked?
Thank you for your assistance.
-
Hi Mohammad,
A common mistake is not realizing that the default lower bound for variables is zero. In the .ilp file there are no bounds mentioned for w[1] or v[1], meaning that both of these variables are >= 0. Is this what you expect?
- Riley
0 -
Hi Riley,
Thank you for the swift and effective guidance. Setting the variable bounds to
lb=-GRB.INFINITY, ub=GRB.INFINITY
solved the issue perfectly.
I'm grateful for your support -Gurobi's excellence truly shines through its community.0 -
Thanks for the kind words Mohammad
- Riley
0
Please sign in to leave a comment.
Comments
3 comments