[Scip] priority of a constraint handler

Stefan Vigerske stefan at math.hu-berlin.de
Sun Feb 5 16:26:38 MET 2012


Hi,

> I’d like to use a constraint handler to handle a non linear constraint
> (!=). I'd like to check this constraint only if all linear constraints
> defined in my LP are satisfied and if the solution is integer. I use the
> C++ class ObjConshdlr and put the property like this:
> sepapriority = -2000000
> enfopriority = -2000000
> checkpriority = -2000000
> sepafreq = -1
> propfreq = -1
> eagerfreq = 1
> maxprerounds = 0
> delaysepa = FALSE
> delayprop = FALSE
> delaypresol = FALSE
> needscons = FALSE
>
> I have implemented only the five pure virtual functions of this base
> class. When I enter scip_check the solution is not always integer and
> not always satisfies the linear constraints yet my checkpriority flag is
> very small. I see that the integrality constraint handler has a check
> priority of zero so I don’t understand why my solution is not integer
> when I enter scip_check. Could you say me what happens?

The only way I could imagine this happens is if the solution check 
(e.g., SCIPcheckSol) has been called with checkintegrality = FALSE by 
mistake. However, if SCIP has been compiled in debug mode, then an 
assert in cons_integral should pop up.
If that happens for you, gdb should be able to tell you who called 
SCIPcheckSol.

Note, that integrality is enforced by SCIP only within a tolerance of 
feastol (default=1e-6).

> Moreover I’d like to stop when I find a solution good enough (w.r.t.
> heuristic criteria) but not necessary optimal. How can I do?

If a gap limit is not sufficient, I think an elegant way would be to 
implement a small event handler that reacts on the event that a new 
incumbent is found. You could then check if the new solution satisfies 
your "heuristic criteria" and interrupt the solving process by calling 
SCIPinterruptSolve(). SCIP then terminates after the current node is 
finished with a user-interrupt termination status.
You can find the code for an example event handler that should be easy 
to adapt in examples/Eventhdlr/src/event_bestsol.*

Stefan

>
> Best regards,
> Hélène
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
>



More information about the Scip mailing list