help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] enable/disable rows/cols for a problem


From: Andrew Makhorin
Subject: Re: [Help-glpk] enable/disable rows/cols for a problem
Date: Fri, 15 Feb 2002 21:56:28 +0300

>I would like to temporarly delete a row/column in a LP problem, solve it,
>and add the row/column again.
>I could do it with
>       - glp_delete_cols/rows
>       - solve
>       - add back the col/row
>However, this is tricky (numbering scheme is changed, must add the col/row
>multiple time with the same information)
>Is there a function that apply a kind of mask over activity of cols/rows ?

There is no such function. However instead "physically" removing a row
from the problem you can just make it unbounded by using the routine
glp_set_row_bnds as follows:

   glp_set_row_bnds(lp, i, 'F', 0.0, 0.0);

and then restore the original row type and bounds after the problem has
been solved (if necessary). Similarly, instead removing a column you can
fix it at zero as follows:

   glp_set_col_bnds(lp, j, 'S', 0.0, 0.0);

and then restore its type and bounds (if necessary).

Probably this way of "removing" rows and columns is unusual for ordinary
programmers, but it is very natural for linear programmers :+)

Note also that restoring row bounds is equivalent to introducing the
corresponding constraint, so the solution may become primal infeasible;
analogously, restoring column bounds is the same as introducing an
additional degree of freedom, which may involve dual infeasibility
(i.e. non-optimality).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]