メインコンテンツへスキップ

FarkasDual and FarkasProof

回答済み

コメント

7件のコメント

  • 正式なコメント
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    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?.
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Ahmad,

    FarkasProof is a model attribute. Thus, you have to access it via

    SP_model.FarkasProof

    Best regards,
    Jaromił

    1
  • ahmad alanaqreh
    Gurobi-versary
    Conversationalist
    Investigator

    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
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    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
  • ahmad alanaqreh
    Gurobi-versary
    Conversationalist
    Investigator

    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
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    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
  • ahmad alanaqreh
    Gurobi-versary
    Conversationalist
    Investigator

    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

投稿コメントは受け付けていません。