[SCIP] Constraint Handler is not adding the cuts as expected

Naga Venkata Chaitanya Gudapati - nagavenkata.gudapati@studio.unibo.it nagavenkata.gudapati at studio.unibo.it
Wed Aug 5 20:55:19 CEST 2020


Thanks a lot Ambros for the detailed explanation. I was not implementing all the call back methods properly. I still have to test on some larger instances but a smaller instance's issues seems to have been fixed.

________________________________________
From: Scip <scip-bounces at zib.de> on behalf of Ambros Gleixner <gleixner at zib.de>
Sent: Wednesday, August 5, 2020 8:07 PM
To: scip at zib.de
Subject: Re: [SCIP] Constraint Handler is not adding the cuts as expected

Hi Naga,

Short answer: You should get a correct implementation if you call your
code from scip_sepalp in scip_enfolp() and scip_enfops(); if your
separation procedure does not automatically yield a feasibility check,
then call the code from scip_check() first.  If your separation
procedure cannot handle fractional solutions, then simply leave
scip_sepalp() empty.

Longer answer:  The sepalp callback is called during the cut loop of the
LP, so it always receives a fractional solution.

With negative enfopriority, SCIP branches as long as the LP solution is
fractional; your enforcement callbacks are only called at nodes where
the LP relaxation is integer feasible to check and add subtour
elimination constraints.

This is correct, but may result in more branching than necessary.  So in
a second step, it would be better if your separation algorithm could
handle fractional solutions.

Best,
Ambros


Am 05.08.20 um 16:43 schrieb Naga Venkata Chaitanya Gudapati -
nagavenkata.gudapati at studio.unibo.it:
> Hello,
>
> I have a very simple min-max routing problem and I seem to have hit a small snag. I think I am missing something very simple in my understanding of the constraint handler inner mechanisms.
>
> The constructor of my constraint handler is as follows:
>
> ObjConshdlr(scip, "sub-tour", "sub-tour elimination constraints",
>                       1000000, -20000, -25000, 1, -1, 1, 0,
>                       FALSE, FALSE, TRUE, SCIP_PROPTIMING_BEFORELP, SCIP_PRESOLTIMING_FAST)
>
> 1) the checkpriority flag is -25000 which I assume is just gonna only run the scip_check function  when the feasible solutions are integeral.
>
> 2) in my scip_check I have a function which tells us whether there is a subtour or not and if there is a subtour, it sets the *result to SCIP_INFEASIBLE;
>
> 3) Then in the scip_sepalp function , I call another function sepaSubtour which will add the cut.
>
> But the issue is that the solution values in scip_check and sepaSubtour seem to be different. I find a sub-tour using the scip_check but there is no correspondence with the solution in sepaSubtour function as the arc variables have different values (the objective function value is same in both cases).
>
>
> I am just prototyping here and I assumed the solution values in both the scip_check and sepa_lp (thus in sepaSubtour)  would be same but the solution value in subTour seems to be fractional (objective values are the same but the arc variables are fractional in sepaSubtour whereas they are integral in scip_check).
>
> Maybe I am missing something very trivial here. Is there a way to get the same solution in the sepa_lp as scip_check?
>
> Regards,
> Nag
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
>

--
Ambros Gleixner, Research Group Mathematical Optimization Methods at
Zuse Institute Berlin, http://www.zib.de/gleixner
_______________________________________________
Scip mailing list
Scip at zib.de
https://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list