[Coin-lpsolver] how to get basic variable indices

fmargot at andrew.cmu.edu fmargot at andrew.cmu.edu
Tue Oct 10 12:34:57 EDT 2006



On Mon, 9 Oct 2006, Amit Partani wrote:

> Hi,
>
> You are using getBasisStatus() which is not part of Clp package, at least its 
> not there in Clp header files. Another thing is when all of the constraints 
> are equality constraints, then adding slacks causes degeneracy. Because of 
> this, the basic indices that are returned in the specific example that I 
> dealing with, contains one of the slacks. Since, the slack variables are 
> bounded by zero(all constraints are equality type), this makes the solution 
> degenerate.
> I don't see a reason to have slack variables for equality type constraints. 
> Is there any way to retrieve a basis which contains original variables rather 
> than slack variables generated from equality type constraints.

getBasisStatus() is an OsiSolverInterface method, which, as the name 
indicates, is intended to interface with the solver. If you insist in using
Clp directly, you can look at the code of 
OsiClpSolverInterface::getBasisStatus() for inspiration.

As far as I know, all LP solvers add slack variables to equalities. This is 
necessary to handle directly problems with linearly dependent equalities.
The way the slack is handled internally to avoid needless pivoting is
solver dependent.

Francois


>
> Thanks,
> Amit
>
>> From: fmargot at andrew.cmu.edu
>> To: Amit Partani <amitpartani at hotmail.com>
>> CC: coin-lpsolver at list.coin-or.org
>> Subject: Re: [Coin-lpsolver] how to get basic variable indices
>> Date: Sun, 8 Oct 2006 13:30:49 -0400 (EDT)
>> 
>> 
>> How to get basic variables is discussed in "project 2" available
>> from
>> 
>> http://wpweb2.tepper.cmu.edu/fmargot/COIN/coin.html
>> 
>> Francois
>> 
>> 
>> On Sun, 8 Oct 2006, Amit Partani wrote:
>> 
>>> Hi,
>>> I am trying to get the indices of Basic variables in Clp. As of now I am 
>>> using pivotVariable() function. But it returns one of the index (20) which 
>>> is more than number of variables (18) in the system. All the constraints 
>>> are equality type. Is there any better way to access basic indices (e.g. 
>>> CPXgetbase in CPLEX). Some detailed answer will be really appreciated.
>>> 
>>> Thanks,
>>> Amit
>>> 
>>> 
>>> 
>>> 
>
>
>
>



More information about the Clp mailing list