Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Detecting Zero rows in CPLEX

    Posted 02/09/09 08:34 PM

    Originally posted by: SystemAdmin


    [fallorz said:]

    I have designed a a cutting plane procedure that deletes variables after each LP solving. The problem is that everytime i deleted variables is possible that for a given contraints all coefficients turn in to zero (A zero row) Is there any function to detect that? Thank you for your help

    Efraín Ruiz
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Detecting Zero rows in CPLEX

    Posted 02/10/09 07:14 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    If you are making changes to the model (between calls to solve()), you can use IloRange.getExpr() to get the nonconstant part of each constraint, cast it to IloLinearNumExpr, and apply the linearIterator() method to that to get an instance of IloLinearNumExprIterator.  Then use a loop that alternately calls nextNumVar() to access the next term of the expression followed by getValue() to access the coefficient of that term, and check to see if the coefficient is nonzero (perhaps with some tolerance).  If you don't find any nonzeros, the constraint has all zero coefficients.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Detecting Zero rows in CPLEX

    Posted 02/10/09 08:51 PM

    Originally posted by: SystemAdmin


    [fallorz said:]

    Sorry i forgot  to tell i am using the API of the ILOG CPLEX Callable Library for users of C. Is there any way to do it for the callable librrary.

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Detecting Zero rows in CPLEX

    Posted 02/14/09 07:23 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    Can't you just use CPXgetrows to access the rows that intersected with the columns you deleted, and then check for nonzero coefficients?

    I'd be inclined to be a bit more proactive about it.  When you create the model, you can also create on the side an integer array that holds the number of nonzero coefficients in each row.  As you delete variables, you can decrement the nonzero count for each row in which they appear, and if an entry in the count array drops to zero, you know that row is now vacuous and should be deleted.

    /Paul

    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Detecting Zero rows in CPLEX

    Posted 02/25/09 12:58 PM

    Originally posted by: SystemAdmin


    [fallorz said:]

    Thanks Paul, i am going to do it with the array with the number of nonzeros.

    Efraín
    #CPLEXOptimizers
    #DecisionOptimization