Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  using CPXgetpi() for a bound

    Posted 07/13/16 10:20 AM

    Originally posted by: Zele


    Hi all!

    I'm trying using CPXgetpi() function for getting  the dual price (shadow price) for an equality bound, (I have a code in c++ for fixing some variable to a value, this is the equality bound). I've seen that these function is used taking into account the number or rows.The problem is that I'm not very sure which is the number of row of that bound.  I don't known if I'm right: the number of the row for a equality bound is number of total constraints (I can calculate it with CPXgetnumrows) plus position of the variable, right??

     

    Thanks in advance.

    María C.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: using CPXgetpi() for a bound

    Posted 07/15/16 11:51 AM

    How exactly do you fix the variables? Do you add an explicit equality row or do you change the lower and upper bound of the variable to the fixed value?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: using CPXgetpi() for a bound

    Posted 07/15/16 03:24 PM

    Originally posted by: Zele


    Yes! Changing the lower bound. Maybe, adding An equality row is a better way?

    thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: using CPXgetpi() for a bound

    Posted 07/19/16 07:25 AM

    I may be missing something but shouldn't you use CPXgetdj() instead of CPXgetpi() to get the dual multiplier for a bound constraint?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: using CPXgetpi() for a bound

    Posted 07/19/16 07:56 AM

    Originally posted by: Zele


    No, because, if I'm not wrong, CPXgetdj() give you reduced cost, and this is an information about variables that has 0 value (if it is positive, by definition, reduced cost is 0), and I want to know information about all variables, included positive variables...


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: using CPXgetpi() for a bound

    Posted 07/19/16 11:03 AM

    I think you are wrong. What you say is true only for variables with bounds [0, inf[.

    Look at this simple example:

    Minimize
     obj: x1
    Subject to
     c1: x1 >= 4
    End

    If you solve this and display the dual for c1 this is 1 (and the reduced cost for x1 is 0 since x1 is not at its bound). Now if you change the constraint into a bound

    Minimize
     obj: x1
    Subject to
    Bounds
     4 <= x1
    End

    and solve again then you will see that the reduced cost for x1 is 1.

    Also, if you look at the reference documentation of CPXgetdj() you see that it returns the "... dual multipliers for bound constraints on the specified variables". As far as I understand this is exactly what you want.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: using CPXgetpi() for a bound

    Posted 07/19/16 12:26 PM

    Originally posted by: Zele


    Great! In that case is that I was looking for.

    Thanks

    María C.


    #CPLEXOptimizers
    #DecisionOptimization