Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Ranged constraints and CPXgetrhs

    Posted Sat February 07, 2015 08:13 PM

    Originally posted by: gtoptimizer


    For a "ranged constraint", i.e. a constraint whose type as returned by CPXgetsense is 'R', what does CPXgetrhs return?

    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Ranged constraints and CPXgetrhs

    Posted Sun February 08, 2015 05:18 AM

    Originally posted by: T_O


    I think it will return the lower bound of the constraint if the range value (CPXXgetrngval) is positive and the upper bound if the range value is negative (don't know whether this will ever happen).

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Ranged constraints and CPXgetrhs

    Posted Sun February 08, 2015 07:10 AM

    It just returns the right-hand side that you set for this range constraint. You may want to take a look at the reference documentation of CPXXnewrows to understand how a range constraint is defined by means of the rhs and rngval properties.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Ranged constraints and CPXgetrhs

    Posted Sun February 08, 2015 07:44 AM

    Originally posted by: T_O


    Daniel,

    I think the documentation is a little imprecise here. CPXnewrows says:

    "the value of constraint i can be between rhs[i] and rhsi[i]+rngval[i]"

    CPXcopylp says:

    "If rngval[i] > 0, then row i activity is in [rhs[i],rhs[i]+rngval[i]], and if rngval[i] <= 0,then row i activity is in [rhs[i]+rngval[i],rhs[i]]."

    While mathematically both mean the same, the first one could imply that rngval[i] is always positive. Can you say a few words concerning negative values?

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Ranged constraints and CPXgetrhs

    Posted Mon February 09, 2015 09:33 AM

    rngval[i] is explicitly allowed to be negative.

    If rngval[i] is negative, then rhs[i] is the upper bound of the constraint and rhs[i]+rngval[i] is the lower bound.

    If rngval[i] is positive, then rhs[i] is the lower bound of the constraint and rhs[i]+rngval[i] is the upper bound.

    This implies that there are always two ways to specify the bounds of a range constraint L <= ax <= U. Either rhs=L and rngval=U-L or rhs=U and rngval=L-U.

    We will try to make this crystal clear in the docs.


    #CPLEXOptimizers
    #DecisionOptimization