Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Reduced Cost Calculations

    Posted 07/12/13 01:25 PM

    Originally posted by: VivekPeriaraj


    Hello,

    I have a small confusion related to how reduced cost should be computed in CPLEX. I wrote out the dual form of the LP and for one of the variables I have this as the dual constraint:

     

     XDEPOUT(d1,c1,t1):     - CONSERVDEPOT(d1,t1) - CONSERVCUSTOMER(c1,t1)

                            + CUSTONCE(c1) + DEPOTONCE(d1)

                            - 7.6 DEMANDSATISFACTION(c1)

                            + 240 TIMEDELIVERY(d1,c1,t1) + 240 PERISHABLE(d1,c1,t1)

                            + c1 + u59043 >= -0.639637549890033

     

    CONSERV* is = constraint and CPLEX reports both +ve and -ve duals. (as reported by CPXgetpi())

    *ONCE is <= constraint and CPLEX reports always -ve duals.

    DEMAND* >= constraint and CPLEX reports +ve duals.

     

    In the above constraint, I am not getting 'c - Ap' type thing used for reduced costs but 'c + Ap'?. Also, the objective coefficient for this variable in the primal is +0.639637549890033. But - is being added. Primal LP is min.

     

    Regards,
    Vivek.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Reduced Cost Calculations

    Posted 07/12/13 04:07 PM

    If the primal is a min problem, the dual is a max problem. Assuming that the primal variable is nonnegative with objective coefficient 0.63..., the corresponding dual constraint should be blah blah blah <= 0.63 ... Since the dual constraint is being expressed as a >= constraint for whatever reason, flip-flop the sides, and you get -(blah blah blah) >= -0.63... So the minus sign in front of 0.63... looks correct to me.

    As far as having c + Ap rather than c - Ap, is that still true after you take the dual <= constraint and switch everything to the opposite side?

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Reduced Cost Calculations

    Posted 07/12/13 05:24 PM

    Originally posted by: VivekPeriaraj


    Hi Paul,

     

     

    You are correct. When all the duals are negative, then I get 'c - pA'. If they are positive, then I get 'c + pA'.

     

    I think all the constraints are converted to <= type, so the duals has to be negative I believe. If so, then the above constraint makes sense. But when I solved dual LP file, all the duals turned out to be positive. 

     

    Also, I compared manually calculated 'c - pA' with the outputs from CPXgetdj() and they both matched. I think my problem might be related to the modeling of a constraint which I asked in the another thread.

     

     

    I just noticed that in interactive, if I do load the lp, then do a 'w file.dua', then read in 'file.dua' and write out 'file.dua.lp', the objective was changed to 'Min' when I was expecting 'Max'. Maybe something happened during this.

     

    Regards,
    Vivek


    #CPLEXOptimizers
    #DecisionOptimization