Forum Discussion

FICO's avatar
FICO
Community Manager
5 years ago

How to fix the basis after removing non-basic rows.

I am working on an algorithm in which I need to remove some redundant constraints.

I know they are redundant because each one is dominated by one other constraint that I have generated. The problem is that some of these redundant constraints are non-basic, so removing them directly will invalidate my basis.

The Xpress manual says "You can avoid losing the basis by only deleting basic rows (see XPRSgetbasis), bringing a non-basic row into the basis first if necessary (see XPRSgetpivots and XPRSpivot)". I understand that we want to make non-basic constraints basic before removing them so that number of constraints = number of basic variables. My question is: how do I select which basic variable must leave basis when I bring my nonbasic redundant constraint into the basis?

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    Hi,

    Assuming you have a valid factorisation at this point, you can ask the optimizer what variable is basic in the row you are removing using XPRSgetpivotorder: https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/XPRSgetpivotorder.html

    If you do not have a valid factorization (changing the problem after postsolve), to make sure you have a valid factorization may need to call XPRSinvert ('int XPRS_CC XPRSinvert(XPRSprob prob);') before asking for the pivot order. This can be relatively expensive, so please make sure to remove all redundant rows in a single call.

    Please le us know if this does not work,

    Zsolt Csizmadia