[Scip] failure to free feasible primal CIP solutions

Stefan Vigerske stefan at math.hu-berlin.de
Thu Aug 2 18:42:52 MEST 2012


Hi,

calling SCIPfreeSol or SCIPtrySolFree should be sufficient to free a 
primal solution.

In SCIPprimalFree, you can check for each primal->existingsols[i] 
(i=0..primal->nexistingsols-1), whether 
SCIPsolGetHeur(primal->existingsols[i]) is not NULL. If so, then you can 
get the name of the heuristic that created the solution via
SCIPheurGetName(SCIPsolGetHeur(primal->existingsols[i])).

Another way to debug this issue is to print the pointer to a solution 
created in your heuristic, together with a linenumber.
If you then also print the pointer to the solutions that are left in 
primal->existingsols in SCIPprimalFree, you may get an idea which 
solutions are not freed.

Hope this helps,
Stefan

On 07/31/2012 04:56 PM, James Cussens wrote:
> I'm solving a series of MIPs, each one with an extra constraint added.
> I call
>
> SCIP_CALL( SCIPfreeTransform(scip) );
>
> just before adding each new constraint. When running in debug mode I
> (sometimes) get:
>
> gobnilp: src/scip/primal.c:143: SCIPprimalFree: Assertion
> `(*primal)->nexistingsols == 0' failed.
>
> Looking at the code in primal.c it seems like the calls to SCIPsolFree
> should clear out existing primal
> solutions, so I can't see what's gone wrong.
>
> Some of these to-be-deleted primal solutions will have originated from
> a heuristic of mine, so perhaps I missed implementing something needed
> there.
>
> Any ideas?
>
> James
>



More information about the Scip mailing list