[Scip] problems with customized branching rule which adds constraints

Gerald Gamrath gamrath at zib.de
Mon Apr 16 13:37:56 MEST 2012


Dear Grit,

you should set the inital flag of the constraint to TRUE when creating 
it, it will then be added to the LP before solving the initial LP of the 
child node. This should fix your problem.

Best,
Gerald

Am 16.04.2012 13:14, schrieb Grit Claßen:
> Hello,
>
> we would like to implement a customized branching rule in SCIP 2.1.1.
> This rule "branches" on constraints instead of variables. This means,
> the rule creates to child nodes with a new constraint each. These
> constraints cut off the current LP solution.
>
> The problem is that the constraints never occur in the current LP (which
> we get calling SCIPwriteLP(scip,fname) ) and also the LP solution does
> not change. Hence, we end up in a loop adding the same constraints to
> new child nodes again and again.
>
> Here are the relevant parts of our code:
>
> SCIP_NODE* child_less_than;
> SCIP_CONS* cons_less_than = NULL;
>
> SCIPcreateChild(scip,&child_less_than, 0.0,
> SCIPgetLocalTransEstimate(scip));
>
>    SCIPcreateConsLinear
>                        ( scip,
> &cons_less_than,
>                          cut_less_than->get_name().c_str(),
>                          int( num_vars ),
>                          scip_vars_less,
>                          scip_coeffs_less,
>                          lhs,
>                          rhs,
>                          FALSE,
>                          FAlSE,
>                          FALSE,
>                          FALSE,
>                          TRUE,
>                          TRUE,
>                          FALSE,
>                          FALSE,
>                          FALSE,
>                          TRUE
>                         ) ;
>
>    SCIPaddConsNode(scip, child_less_than, cons_less_than, NULL);
>
>    SCIPreleaseCons(scip,&cons_less_than);
>
>
> Does anybody have an idea what goes wrong? We mainly followed the
> binpacking example of SCIP but we do not use an extra constraint handler
> to create the (linear) constraints.
>
> Any suggestions/hints are appreciated!
>
>
> Best wishes
> Grit Claßen
>



More information about the Scip mailing list