FarkasDual and FarkasProof
回答済みI am trying to apply benders decomposition for a specific problem, I have to add a cut constraint in each iteration, if the subproblem feasible I am adding an optimality cut by using Pi values of the subproblems constraints, if it's InfeasibleI am adding feasibility cut by using the FarkasDual values of the subproblems constraints, but actually FarkasDual is not giving me right value since I have the code on AMPL and it's giving different values, I read that if the problem is Infeasible I have to use FarkasProof, is that true?
I have tried to use the FarkasProof as follow
SP_model.getConstrByName ( 'one' ).FarkasProof
but I for the following error :
in gurobipy.__getattr
AttributeError: 'gurobipy.Constr' object has no attribute 'FarkasProof'
although I have set the InfUnbdInfo to be one
SP_model.setParam ( "InfUnbdInfo", 1 )
-
正式なコメント
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 Ahmad,
FarkasProof is a model attribute. Thus, you have to access it via
SP_model.FarkasProof
Best regards,
Jaromił1 -
Hi Jaromil
Thanks for your help, so what I don't understand how I can get the dual unbounded of a specific constraint for an infeasible model??
in AMPL it is simply :
constraint.dunbdd
but it is not clear in python
0 -
Hi Ahmad,
I was not able to find a documentation on AMPL's \(\texttt{dunbdd}\) attribute.
You can get the Farkas Dual for infeasibility certificate by
SP_model.getConstrByName('one').FarkasDual
Is this what you are looking for?
Or are you looking for an unbounded ray? This can be obtained from the variable attribute UnbdRay
SP_model.getVarByName('x').UnbdRay
Best regards,
Jaromił1 -
Hi Jaromil
No, I am searching for Farkas Dual because the problem is infeasible, this unbdd is used to get the dual of the constraints if the problem infeasible(called "unbounded dual"):
in AMPL if the problem is infeasible you can simply specify
suffix dunbdd
then for the constraint
constraint.dunbdd
but this dubdd(in AMPL) and FarkasDual(in python) gave totally different values although the constraint exactly the same !!
0 -
Hi Ahmad,
Farkas certificate is not unique. Thus, it is very well possible that two different softwares return different certificates. As long as both are valid, there is no reason to worry.
Best regards,
Jaromił1 -
Hi Jaromil
That is totally true, moreover, I found that FarkasDual is giving good values but the difference was the sign, I mean if the
constraint.FarkasDual
is positive
constraint.dunbdd
is negative, so I just changed the sign and everything seems to be fine.
Thanks a lot for your help
0
投稿コメントは受け付けていません。
コメント
7件のコメント