Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  binding constraints and shadow prices

    Posted 11/03/08 10:58 PM

    Originally posted by: SystemAdmin


    [agus said:]

    Hi,

    Is it possible to display the binding constraints and shadow prices of the solution? and if it is how?

    thanks

    Agus
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: binding constraints and shadow prices

    Posted 11/03/08 11:53 PM

    Originally posted by: SystemAdmin


    [Selvaprabu said:]

    Hi Agus,

    I'm not sure of how to do this in the OPL IDE but here is how I do it in OPL script.

    Name the constraint you want to check, say you name it C1. You can use "C1.slack" to check if a constraint is binding. Similarly, you can use "C1.dual" to extract the shadow price.

    I'm not sure if this is the best way, but it works.

    - Selva
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: binding constraints and shadow prices

    Posted 11/04/08 01:07 AM

    Originally posted by: SystemAdmin


    [agus said:]

    Hi Selva,

    Thanks for the response, but I still have problem with it.

    here is my constraint:

    A:
    forall (i, j in Flights: i.flightID!=j.flightID, u in (i.realNodes inter j.realNodes): u!= last(i.realNodes))
            (t[j][u] - t[i][u] >= (t[i][next(i.realNodes,u)]-t[i][u])/luv[u][next(i.realNodes,u)]*200 - (1-y[i][j][u])*1000000);


    I tried to put

    execute
    {
      writeln( A.name," ",A.UB," ",A.LB," ",A.dual," ",A.slack);
    }


    at the end of the model, but it gave me this result:

    // solution (optimal) with objective 4426.46699999603
    A undefined undefined undefined undefined

    I saw the example where it works:

    dvar float x in 5..20;
    dvar float y in 0..20;

    maximize x+y;

    subject to
    {
      ct1:2*x+y<=10;<br />  ct2:x<=7;<br /> }

    execute
    {
      writeln( ct1.name," ",ct1.UB," ",ct1.LB," ",ct1.dual," ",ct1.slack);
      writeln( ct2.name," ",ct2.UB," ",ct2.LB," ",ct2.dual," ",ct2.slack);
    }


    I just don't understand why it doesn't work with my model.

    Can someone help me with this?

    Thanks a lot

    agus

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: binding constraints and shadow prices

    Posted 11/04/08 11:59 AM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    in  your first example, A is an array of constraints.

    You should use A[i][j].LB, etc

    See another topic in this forum form today with an exmaple.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer