[Scip] add constraints while solver is running?

Yuji Shinano shinano at zib.de
Tue Apr 2 12:27:22 MEST 2013


Hi Sandy,

(13/03/29 22:24), Sandy Ryza wrote:
 > Thanks for the help Ambros,
 >
 > Are you saying that I can use SCIPsetRealParam(scip, "limits/objective", value)

First, it is even better to use SCIPsetObjLimit(scip, value) here because it performs additional checks.

 > from a separate
 > thread after I have started the solving?  Or does your second email mean that to accomplish this I
 > need to use an event handler?

No, it is probably necessary that the thread itself, within a call back, asks for the new objective 
limit.

If you use event handler, you have to be careful because the event handler is also called within 
subSCIPs, for example, for heuristic solving. Therefore,
you have to manage it and check whether the current call is for original
scip or not. In this case, it is better to see the UG code.

I rather recommend you to use primal heuristic plug-in to set the objective limit.
Then, you do not have to care about subscip. Since the heuristic plug-in is called less
frequently, the update could be slightly delayed.

Hope this helps,
Yuji


(13/03/29 22:24), Sandy Ryza wrote:
> Thanks for the help Ambros,
>
> Are you saying that I can use SCIPsetRealParam(scip, "limits/objective", value) from a separate
> thread after I have started the solving?  Or does your second email mean that to accomplish this I
> need to use an event handler?
>
> -Sandy
>
> On Fri, Mar 29, 2013 at 1:28 PM, Ambros Gleixner <gleixner at zib.de <mailto:gleixner at zib.de>> wrote:
>
>     I just realized: Maybe your question was more about how to interrupt the
>     solving process in order to communicate the new upper bound.
>
>     For this, using the event handler system of SCIP is probably best, see
>
>     http://scip.zib.de/doc/html/EVENT.shtml
>
>     Maybe check out how it's done in the code of our parallelization
>     framework UG, which is included in the SCIP Optimization Suite.
>
>     - Ambros
>
>
>
>     Am 29.03.2013 21:23, schrieb Ambros Gleixner:
>      > Hi Sandy,
>      >
>      > both local and global constraints can be created and added during the
>      > solution process as usual via SCIPcreateCons...() and SCIPaddCons().
>      >
>      > However, you do not have to/should not add the upper bound as a
>      > constraint, but can use the parameter "limits/objective"; this can be
>      > changed at any time during the solution process via
>      >
>      >     SCIP_CALL( SCIPsetRealParam(scip, "limits/objective", value) );
>      >
>      > Also, you might consider transferring the solutions themselves via
>      > SCIPtrySol() or SCIPaddSol() because this can improve the performance of
>      > some primal heuristics; but then again the solution from one subproblem
>      > may not be feasible for the others and hence be rejected.
>      >
>      > Hope this helps,
>      >
>      > Ambros
>      >
>      >
>      >
>      >
>      > Am 29.03.2013 19:25, schrieb Sandy Ryza:
>      >> Hi All,
>      >>
>      >> Is there an easy way in SCIP to add constraints while the solver is
>      >> running?  My use case is that I want to try running multiple solvers in
>      >> parallel on different subproblems, and if one of the solvers comes
>      >> across a good solution I want to be able to set the upper bound on the
>      >> other ones for better pruning.
>      >>
>      >> thanks for any guidance,
>      >> Sandy
>      >>
>      >>
>      >> _______________________________________________
>      >> Scip mailing list
>      >> Scip at zib.de <mailto:Scip at zib.de>
>      >> http://listserv.zib.de/mailman/listinfo/scip
>      >>
>      >
>
>     --
>     ____________________________________________________________
>     Ambros M. Gleixner
>     Zuse Institute Berlin - Matheon - Berlin Mathematical School
>     http://www.zib.de/gleixner
>     _______________________________________________
>     Scip mailing list
>     Scip at zib.de <mailto:Scip at zib.de>
>     http://listserv.zib.de/mailman/listinfo/scip
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip


More information about the Scip mailing list