Decision Optimization

Decision Optimization

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

 View Only
  • 1.  obtain dual variables from primal subproblem

    Posted Wed October 12, 2011 06:24 AM

    Originally posted by: dbaena


    Hi,
    I am solving a MIP problem using Benders Decomposition. But, I would like to solve the original problem using Local Branching and each time I obtain a feasible solution, add a optimality cut a Master of Benders.
    My doubt is how can I obtain the dual values from primal solution (feasible solution of Local Branching) in order to add the optimality cut (classical Brnders uses dual values from dual subproblem).
    I use Cplex.

    Thanks a lot.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: obtain dual variables from primal subproblem

    Posted Wed October 12, 2011 01:24 PM

    Originally posted by: SystemAdmin


    If your sub-problem is an LP, this is simple. Just use CPXgetpi() and CPXgetdj() in the C API and similar methods in the other APIs.

    If your sub-problem is a MIP, then there are no duals for you to query. This is because a MIP does not have a (simple straight-forward) dual.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: obtain dual variables from primal subproblem

    Posted Sat December 15, 2012 04:34 PM

    Originally posted by: JDalal


    I am working on a similar implementation project. My subproblem is LP. However, I use c++/concert and not much familiar to C API. Can anyone point me to the relevant resource for concert? I want to extract primal(dual) variable values from the dual(primal) solution. If there is any small code snippet available, that would be great. Thanks in advance.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: obtain dual variables from primal subproblem

    Posted Wed January 02, 2013 12:01 PM

    Originally posted by: SystemAdmin


    IloCplex::getValues() gets the primal values for variables.
    IloCplex::getReducedCosts() and IloCplex::getDuals() get the dual values for variables and constraints (they are what CPXgetdj() and CPXgetpi() are in the callable library).
    Please also refer to the reference documentation for further details about those functions. You may also look at some of the examples that come with the CPLEX distribution, in particular lpex1.cpp, lpex4.cpp and lpex6.cpp.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: obtain dual variables from primal subproblem

    Posted Wed January 02, 2013 02:14 PM

    Originally posted by: JDalal


    Thanks a lot. This will be helpful.
    #CPLEXOptimizers
    #DecisionOptimization