Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  No getBestObjValue() in C#???

    Posted 06/11/10 06:50 AM

    Originally posted by: StefanRopke


    I have some students working with CPLEX in C#, through the .Net interface. They would like to get the best bound (lower bound for a minimization problem) for their MIP when CPLEX terminates because of a time limit.

    In C++/Concert I know you can get the best bound using the getBestObjValue() method on the CPLEX object, but that method does not seem to exists in the .Net interface. So my question is simply: what is the C#/.net equivalent of getBestObjValue()?

    Best regards,
    Stefan
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: No getBestObjValue() in C#???

    Posted 06/11/10 11:08 AM

    Originally posted by: SystemAdmin


    I don't use C#/.NET, so I'm guessing here, but if you poke around with the GetQuality method, you should be able to recover the objective gap (ObjGap is a field of Cplex.QualityType).

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: No getBestObjValue() in C#???

    Posted 06/11/10 05:30 PM

    Originally posted by: StefanRopke


    Thanks Paul, reading the CPLEX manual this seems like a solution to our problem. We'll try it out!

    Best regards,
    Stefan
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: No getBestObjValue() in C#???

    Posted 06/11/10 09:00 PM

    Originally posted by: GuangFeng


    How about property BestObjValue? I have not verified it, but I think most, if not all, getYYY() methods should have corresponding YYY properties in .NET interface.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: No getBestObjValue() in C#???

    Posted 06/14/10 01:20 AM

    Originally posted by: SystemAdmin


    The BestObjValue property does indeed exist and reading it is how you get the dual bound in C#.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: No getBestObjValue() in C#???

    Posted 06/14/10 03:55 AM

    Originally posted by: StefanRopke


    Thanks for all the answers. My students used the BestObjValue property and it works perfectly!

    Best regards,
    Stefan
    #CPLEXOptimizers
    #DecisionOptimization