[Scip] update constraint

Stefan Vigerske stefan at math.hu-berlin.de
Fri Jul 16 11:11:22 MEST 2010


Hi,

Mattia Barbieri wrote:
> Hi Stefan,
>  I am developing a Branch&Price application, togheter with a 5-piecewise
> linear penalty function to avoid tail off degenerancy. I want quickly ask
> you: how can I update the coefficients of a linear constraint? I need this
> to update the penalty values (boxstep). This have to be done any time the
> execution enter SCIP_DECL_CONSACTIVE (at any node of the tree). 

I don't think that constraints are allowed to change their meaning
during the solving process. There are some good reasons why one is not
allowed to change the feasible area or the objective function during the
optimization process... :-)

> I try to use
> the static function chgCoefPos
> (SCIP<http://scip.zib.de/doc/html/structScip.html>*scip,
> SCIP_CONS <http://scip.zib.de/doc/html/structSCIP__Cons.html> *cons, int
> pos, SCIP_Real newval) but the compiler tell me
>   In function `consActiveStoreData':
>  ~/localSVN/gse1/src/cons_store_gse2.c:678: undefined reference to
> `chgCoefPos'
>  collect2: ld returned 1 exit status

Yes, chgCoefPos is a "private" function, that's why it is declared static.

> I could try to remove the entire constraint, and create it again. In this
> case, how can I remove permanently a constraint from the LP?

Normally, rows can leave the LP if they become inactive for a while, or
get dominated by another row.

If I understand correctly, then you want SCIP to not use its LP
relaxation as it is, but a modified version where you add a penalty term
in the objective.
The cleanest way I can think of is to write a relaxator plugin that
takes the LP, adds the penalty term, solves this problem, and passes the
corresponding solution to SCIP. This does not sound much efficient.
A dirty way could be to construct your penalty term as an SCIP_ROW, add
this one to the LP with the flag that it should not be removed, and then
modify this row as you like. Changes in the row should be passed to the
LP. (You could even ask your row for its position in the LP by using
SCIProwGetLPPos, get access to the LP via SCIPgetLPI, and then modify
the LP there, but that is something one should really not do...)

Stefan

-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan


More information about the Scip mailing list