[Scip] failure to free feasible primal CIP solutions

James Cussens james.cussens at york.ac.uk
Mon Aug 6 17:03:55 MEST 2012


Dear Stefan,

Thanks, that helped me track down the problem. I was failing to free
the solution my heuristic was working on when giving up early
on finding a good solution.

All fixed now.

James

On 2 August 2012 17:42, Stefan Vigerske <stefan at math.hu-berlin.de> wrote:
> 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
>>
>



-- 
James Cussens
Dept of Computer Science &
York Centre for Complex Systems Analysis
Room 326, The Hub, Deramore Lane            Tel    +44 (0)1904 325371
University of York                                        Fax  +44
(0)1904 500159
York YO10 5GE, UK                               http://www.cs.york.ac.uk/~jc


More information about the Scip mailing list