Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Getting dual variables from IloRange

    Posted 12/29/14 09:32 AM

    Originally posted by: JorisK


    To implement the constraints of the following LP in cplex:
    minimize ...
    ax <= c 
    ax >= b
    x >= 0
     
    One can use the addRange command:
    IloRange ir=cplex.addRange(b,ax,c)
     
    Associate dual variables y and z with resp. the first (ax <= c) and second (ax >= b) constraint.
     
    If I now want to obtain the dual variables associated with the first and second constraint, I can invoke:
    double d = cplex.getDual(ir)
    This however is only a single value whereas there are actually 2 dual variables. What would be the best way to obtain the dual variables y and z? I could do something like this:
     
    If |c-b| > 0 holds, then one of the constraints must slack so its dual variable must be zero. Hence:
    if(d < 0){
     y=d;
     z=0
    }else{
      y=0;
      z=d;
    }
     
    But what if |c-b|=0, that is, if b and c are equal? Then both constraints will hold with equality and both dual variables can be non-zero? I'm probably missing something very obvious here.

    Edit: when |c-b|=0 then both primal constraints can be replaced by a single constraint: ax=b, resulting in a single dual variable for that constraint. 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Getting dual variables from IloRange

    Posted 12/29/14 05:49 PM

    If you specify two separate constraints with |c-b| = 0 (which would make sense if they are "coincidentally" equal but free to deviate from each other in some sensitivity analysis), then you have a degenerate solution; so, barring a huge coincidence, the dual value will apply at most in one direction. (I say "at most" because if there is more than one redundant binding constraint -- you've guaranteed at least one -- the dual value might not apply to changes in either direction.) Increasing b or decreasing c makes the problem infeasible, so (hopefully) d applies either to decreases in b or increases in c. Both would be beneficial to the objective (loosening the constraints), so if d < 0 then I would expect it to apply to c, while if d > 0 I would expect it to apply to b. If d = 0, the best I can suggest is perturbing either b or c slightly (in the direction of feasibility).


    #CPLEXOptimizers
    #DecisionOptimization