[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Modifying the column statuses to make a valid LP basis a
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Modifying the column statuses to make a valid LP basis after some column bounds have been modified. |
Date: |
Mon, 02 May 2011 14:48:46 +0400 |
> After I solve either a primal or dual simplex LP successively I then
> use glp_get_col_stat() to recover the statuses. Then based on the
> solution values I modify some of the variables by using
> glp_set_col_bnds() with either GLP_DB or GLB_FX attributes.
> When I try to re-solve by first calling glp_set_col_stat() and
> glp_set_row_stat() the return from glp_simplex() (i.e., glp_warm_up()
> called internally) is usually that the LP basis is invalid.
> Therefore I am wondering how I can modify the statuses apriori given
> the new column bounds if that is even possible?
If you have changed column types/bounds, you don't need to change
row/column statuses, because changing bounds does not affect the basis.
You may just call glp_simplex to re-optimize.
To save the basis at some point, you should obtain current statuses of
all rows and columns with glp_get_row/col_stat and store them somewhere
(in an array, for example). Then to restore (at any point) the basis
saved you should use glp_set_row/col_stat to assign statuses to all rows
and columns.