Getting the dual variable values when the model status is 4(INF_OR_UNBD)
AnsweredHello guys, I am running the benders algo, When my subproblem is feasible I am using the following line to get the dual variable value:
gp.quicksum(BigM*deltars2kE[r,s,k]*subproblem.getConstrByName("UE_EV_2[E,{},{},{}]".format(r,s,k)).Pi for r,s in drs.keys() for k in K)
And it works. But when my subproblem becomes infeasible or unbounded and I want to take the dual variable values I am using the exact same code but with .FarkasDual instead of .Pi
gp.quicksum(BigM*deltars2kE[r,s,k]*subproblem.getConstrByName("UE_EV_2[E,{},{},{}]".format(r,s,k)).FarkasDual for r,s in drs.keys() for k in K)
Then I get the following error:
AttributeError: Unable to retrieve attribute 'FarkasDual'.
Am I doing something wrong? Are there any specific conditions that the attribute FarkasDual works?
-
From the FarkasDual documentation:
These attributes are only available when parameter InfUnbdInfo is set to 1.
Have you set the InfUnbdInfo parameter to 1?
0 -
Thank you Eli, that was the problem, enjoy your holidays!
Kind regards
Iason0
Please sign in to leave a comment.
Comments
2 comments