[Scip] Calling SCIPreleaseCons() before terminating the program

Gerald Gamrath gamrath at zib.de
Tue Oct 29 13:01:33 CET 2013


Dear Hélène,

first, I would recommend that you also set the stickingatnode flag for
the constraints to TRUE, because they should stay at the node where you
add them and not be moved to more global nodes (even though I'm not sure
this could happen with your constraints).

Then, the problem you run into is the following: The constraints are
captured once when you create them (to ensure that you can store
pointers to them) and then the second time when you add them to the
problem or (in your case) to a local node. In the queens example, the
first capture is released by the user before calling SCIPfree(), where
then the problem is free'd and also the internal captures to all
globally valid constraints are released. In your case, the internal
capture is already released when the node to which a constraint was
added is freed during the branch-and-bound search and you have the last
remaining pointer to the constraint. When you release it now, the
constraint itself is deleted (because its number of captures goes down
to 0) and this also frees the row corresponding to the constraint.
However, this is currently not allowed in the problem solved stage.

Normally, releasing constraints should be done by the same plugin which
created or stored the constraints. In your case, probably your branching
rule created these local constraints and perhaps stored the pointers to
them in the problem data? Both of them have an exitsol-callback:
SCIP_DECL_BRANCHEXITSOL and SCIP_DECL_PROBEXITSOL. In there, you could
release the pointers to the locally valid constraints.

Alternatively, you could try whether everything works fine if you change
the fourth-last argument of the checkStage() method call in
SCIPreleaseRow() from FALSE to TRUE. This method is used to make sure
that methods are only called in certain stages, however, we mostly start
with strict restrictions and allow  new stages only when needed. This
could be a case where it would make sense to allow a new stage.

Best,
Gerald

On 29.10.2013 10:22, Hélène Toussaint wrote:
>
> Dear SCIP team,
>
> I solve a problem using a Branch and Price in which I add some
> constraints at each node besides the branching constraints. These
> constraints are valid in the current node and its children only. I
> create them using SCIPcreateCons() with:
> initial =separate = enforce = check = propagate = local = modifiable =
> TRUE and
> dynamic = removable =stickingatnode = FALSE.
> and I store the SCIP_Cons pointer.
>
>  
>
> I don't call SCIPreleaseCons() right after adding a constraint but
> just before terminating the program ( before SCIPfree( ) ) as it is
> done in the queens example. I have the following errors in debug mode:
>
> [src/scip/scip.c:390] ERROR: cannot call method <SCIPreleaseRow> in
> problem solved stage
>
> [src/scip/scip.c:22911] ERROR: Error <-8> in function call
>
> [src/scip/cons_linear.c:927] ERROR: Error <-8> in function call
>
> [src/scip/cons_linear.c:9855] ERROR: Error <-8> in function call
>
>  
>
> Could you please tell me if I set the flags  properly? and How can I
> release these constraints?
>
>  
>
> Best regards,
>
>  
>
> Hélène
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20131029/b77f061c/attachment.html>


More information about the Scip mailing list