[Scip] SCIPgetTransformedCons

Stefan Heinz heinz at zib.de
Tue May 15 17:29:26 MEST 2012


Hi Jose,

we do not see an obvious issue. The next thing you should do, is to 
compile SCIP and your code in debug mode. If you used the Binpacking 
example as starting point including the Makefile, do the following:

make OPT=dbg scip
make OPT=dbg

and run your program again and hopefully some assertion comes up which 
helps (us) to find the bug.

Besides that, did you check if the code passes the PROBTRANS methods 
before the PRICERINIT (which should be the case)?

What happens if you replace:

SCIP_CALL( SCIPgetTransformedCons(scip, cons, &pricerdata->budCon) );

with

   SCIP_CALL( SCIPtransformCons(scip, cons, &pricerdata->budCon) );

Best Stefan



On 05/14/12 22:45, Jose Walteros wrote:
>
> Hi all,
>
> I am coding a branch and price using SCIP and I have a question about 
> a segmentation problem within  the pricer. I was wondering if you guys 
> can help me with it.
>
> I used the bin packing example that you have, and so far everything 
> has been working very smoothly (the branching, the constraint handler, 
> etc), Although, I am experiencing a problem with the pricer. The 
> problem is as follows:
>
> I have two kinds of constraints that I require to get the duals from, 
> to solve the pricer problem. The first kind are a set of constraints 
> that I named parCons. For those constraints, I have been able to catch 
> the transformed version of the constraints and obtain the duals 
> without any problem.
>
> The second  kind  is a single constraint, some sort of a budget/ 
> knapsack constraint. I defined it as follows:
>
> /* create set budget constraint */
>     (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "BudgetCon");
>     SCIP_CALL( SCIPcreateConsLinear(scip, &budCons, name, 0, NULL, NULL,
>                                     -num_B, /* lhs */
>                                     SCIPinfinity(scip), /* rhs */
> TRUE, /* initial */
> TRUE, /* separate */
> TRUE, /* enforce */
> TRUE, /* check */
> TRUE, /* propagate */
> FALSE, /* local */
> TRUE, /* modifiable */
> FALSE, /* dynamic */
> FALSE, /* removable */
> FALSE) ); /* stickingatnode */
>     SCIP_CALL( SCIPaddCons(scip, budCons) );
>
> As I mentioned before, I used the bin packing example as a guide.
>
> Now, in the code of the pricer, within function 
> SCIP_DECL_PRICERINIT(pricerInitCCP),As you can see in the code below, 
> I am trying to get the transformed version of this constraint but I am 
> getting a segmentation problem. Apparently SCIP is not able to get the 
> transformed constraint, it returns null. I tried to comment that line 
> to see what happens, and the code starts working. However, when I call 
> for the dual of budCon, it always returns 0 (which in my opinion is 
> expected as is not the transformed constraint).
>
> The following is the code that I have
>
>
> /* get transformed constraints */
> for( c = 0; c < pricerdata->nodes; ++c )
>     {
>         cons = pricerdata->parCons[c];
>
>
> /* release original constraint */
>         SCIP_CALL( SCIPreleaseCons(scip, &pricerdata->parCons[c]) );
>
>
> /* get transformed constraint */
>         SCIP_CALL( SCIPgetTransformedCons(scip, cons, 
> &pricerdata->parCons[c]) );
>
>
> /* capture transformed constraint */
>         SCIP_CALL( SCIPcaptureCons(scip, pricerdata->parCons[c]) );
>     }
>
>
>     cons = pricerdata->budCon;
>
>
> /* get transformed constraint */
>     SCIP_CALL( SCIPgetTransformedCons(scip, cons, &pricerdata->budCon) );
>
>
> /* capture transformed constraint */
>     /* THE SEGMENTATION PROBLEM OCCURS IN THIS LINE. APPARENTLY SCIP 
> IS NOT ABLE TO CAPTURE THE TRANSFORMED CONSTRAINT (I.E., THE 
> SCIPgetTransformedCon IS RETURNING NULL)*/
>     /* I FIND THIS WEIRD BECAUSE IT WORKS PERFECTLY FOR THE STATEMENT 
> WITHIN THE FOR LOOP ABOVE. I.E., IT WORKS FOR THE parCons but not for 
> the budCon/*
>     SCIP_CALL( SCIPcaptureCons(scip, pricerdata->budCon) );
>
> At first I thought that the problem was happening because maybe I was 
> not not transforming the constraint somewhere else in the code. 
> However, I the function SCIP_DECL_PROBTRANS(probtransCcp) in 
> prob_data, I have the following code:
>
> /* transform all constraints */
>     SCIP_CALL( SCIPtransformCons(scip, (*targetdata)->budCons, 
> &(*targetdata)->budCons) );
>     SCIP_CALL( SCIPtransformConss(scip, (*targetdata)->num_nodes, 
> (*targetdata)->parCons, (*targetdata)->parCons) );
>
> I ran out of ideas. Could you please help me with this?
>
> Thanks for your time and sorry for the long email.
>
> Jose L. Walteros
> Ph.D. Student
> Dept. of Industrial & Systems Engineering.
> 401 Weil Hall
> University of Florida
> Gainesville, FL 32611-6595, USA
>
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list