[Scip] priority of a constraint handler
Stefan Heinz
heinz at zib.de
Sat Feb 4 21:50:03 MET 2012
Hi,
On 02/03/2012 04:08 PM, Hélène Toussaint wrote:
> 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
If you want to be after all linear constraints you need a smaller
checking priority. Something like "-800000". Within the interactive
shell you can check all the priorities of the constraint handler as follows:
SCIP> display conshdlr
Next, are you sure that you want "needscons=FALSE"? I would assume that
in your case real "non linear" constraints have to be present. If so you
need to set this boolean to TRUE.
> 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?
From the theory you are right? Do you have some heuristics
implemented? If so, how do you pass the solutions to SCIP. The reason
why I ask is, that by passing a solution to SCIP you can specify what
needs be checked. See
http://scip.zib.de/doc/html/scip_8h.html#ae4041777d638e0bcbbb592946b520f15
In any case you could run your program in a debugger and check the back
trace in case an integer variable has a fractional value. That could
give us a hint what is going on.
> 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?
Well there several options to stop the solving process. In your case I
would suggest an event handler which is called after a new solution is
found. Than you can check your "heuristic criteria" and call
SCIPinterruptSolve() to stop the solving process.
http://scip.zib.de/doc/html/scip_8h.html#ab207a6210ea634cca6fae72dde4d9a91
The event handler example does something like that:
http://scip.zib.de/doc/examples/Eventhdlr/index.html
Hope that helps
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