[Scip] Set a primal solution

Rostislav Stanek rostislav.stanek at uni-graz.at
Wed Jul 10 17:34:09 MEST 2013


Dear Michael,
I thank you for your comprehensive explanation. I think, I will try the 
second solution, but I will remember the first one for future use.
Thanks again.
Best regards,
Rostislav Stanek


Dne 10.7.2013 17:30, michael.winkler at zib.de napsal(a):
> Hi Rostislav,
>
> you can write a heuristic plugin setting the timing to
> SCIP_HEURTIMING_BEFOREPRESOL. This heuristic will then be called only
> before presolving of the whole problem (might be multiple times when a
> restart happens).
> Take a look at the heur_trivial.c for further details.
>
> When creating a solution via SCIPcreateSol() the solution vector will
> contain zero values for all variables implicitly.
>
> You then need to use SCIPsetSolVal()/SCIPsetSolVals() to set solution
> values for the variables.
>
> Afterwards please use SCIPtrySol()/SCIPtrySolFree() which will check the
> correctness of the solution and if so SCIP will store the solution and
> also update the primalbound and cutoffbound. (So, there is no need to add
> you extra "bound constraint" anymore, when adding a solution.)
>
> Please take a look at:
> http://scip.zib.de/doc/html/HEUR.shtml
> http://scip.zib.de/doc/html/scip_8h.shtml#a03da404f4153d8f673e87fb28bc7d552
> http://scip.zib.de/doc/html/scip_8h.shtml#adbb9f3c0c0b462481fe5eff677463258
> http://scip.zib.de/doc/html/scip_8h.shtml#ab4007453cafad788430c2ad55129479f
> http://scip.zib.de/doc/html/scip_8h.shtml#ae4041777d638e0bcbbb592946b520f15
> http://scip.zib.de/doc/html/scip_8h.shtml#af00de2379f996445b4497db79e7449f0
>
> Best, Michael
>
>> Dear SCIP community,
>> I excuse me for this question which should be clear for me, but how
>> should I correctly set a primal solution before starting the solving
>> process? I solve an ILP using the SCIP solver and before starting the
>> process I would like to set a heuristical primal solution which would
>> also define a bound (this heuristic should not be called during the
>> solving process more). I set the bound as a global constraint, but I do
>> not know how to set the solution. Can I use “SCIPcreateSol”? And what
>> does it mean “creates a primal solution, initialized to zero”?
>> Thank you very much in advance.
>> Yours faithfully,
>> Rostislav Stanek
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> http://listserv.zib.de/mailman/listinfo/scip
>>



More information about the Scip mailing list