[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] solve, add rows, resolve
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] solve, add rows, resolve |
Date: |
Thu, 18 May 2006 12:06:06 +0400 |
> I agree with your evaluation. Removing a basic column is not
> intelligent behavior for a user, so you should not have to go to great
> lengths to support it.
>
> However, it would be nice if GLPK would resolve from scratch in this
> case rather than aborting with an error (perhaps with a message
> indicating that it is making a new basis).
>
> Would you be willing to make that change? If you would like, I can try
> to submit a patch.
I think the patch is not needed. The application program only needs
to check the basis and repair it if necessary:
ret = lpx_simplex(lp);
if (ret == LPX_E_FAULT)
{ ret = lpx_warm_up(lp);
if (ret == LPX_E_BADB)
{ /* the basis is invalid; build some valid basis */
lpx_adv_basis(lp);
ret = lpx_simplex(lp);
}
}
However, using lpx_adv_basis (or lpx_cpx_basis) is not a good
idea to repair the basis, because these routines do not take into
consideration current row and column statuses. There should be a
more specialized routine which, for example, adjusts the basis
to make the number of basic variables be equal to the number of
rows, calls lpx_warm_up, and if the basis matrix is singular,
replaces linearly dependent basic columns by unity columns of
auxiliary (i.e. slack/artificial) variables.
Andrew Makhorin