Decision Optimization

Decision Optimization

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

 View Only
  • 1.  From GLPK to CPLEX C API: range coefficients?

    Posted Mon September 20, 2010 09:13 AM

    Originally posted by: tavs


    GLPK allows to set a row's bounds by use of function
    void glp_set_row_bnds(glp_prob *lp, int i, int type, double lb, double ub);
    

    if type is GLP_DB, i.e. a "double-bound", the routine sets the i-th row's lower and upper bounds to lb and ub respectively

    In CPLEX's C API I found the functions CPXchgrhs and CPXchgrngval, but I couldn't figure out how to use them to achieve the same functionality. What should I do ?

    TIA
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: From GLPK to CPLEX C API: range coefficients?

    Posted Mon September 20, 2010 09:21 AM

    Originally posted by: SystemAdmin


    Quoted from the documentation of CPXcopylpwnames (I agree, this is not the first place I would look for that):
    If rngval>0, then row activity is in [rhs,rhs+rngval]
    and if rngval<0, then row activity is in [rhs+rngval,rhs]
    

    Does that answer your question?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: From GLPK to CPLEX C API: range coefficients?

    Posted Mon September 20, 2010 09:27 AM

    Originally posted by: SystemAdmin


    At least in CPLEX 8 or 9 there was a bug in presolve with handling negative range values. I don't know if this bug is still there, bug you should probably prefer non-negative range values.

    So, given a linear constraint
    lb <= a*x <= ub
    

    you should set the regular right hand side to lb, and the range value to ub-lb.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: From GLPK to CPLEX C API: range coefficients?

    Posted Tue September 21, 2010 06:47 AM

    Originally posted by: tavs


    Thanks, it worked!
    #CPLEXOptimizers
    #DecisionOptimization