[Scip] SCIPgetTransformedCons

Stefan Heinz heinz at zib.de
Wed May 16 08:12:41 MEST 2012


Hi Jose,

There is no need to copy a single pointer. Just Replace

SCIP_CALL( SCIPduplicateMemory(scip,&(*probdata)->budCons, budCons));

with

(*probdata)->budCons = budCons);


Regarding the other issue, the method SCIPgetTransformedCons() should 
then work.

Best Stefan



On 05/16/2012 03:55 AM, Jose Walteros wrote:
> Hi Stefan,
>
> 1. I try to debug it and I get an error in this line:
>
> SCIP_CALL( SCIPduplicateMemory(scip,&(*probdata)->budCons, budCons));
>
> The error is in the function probdataCreate. The error is:
>
> src/probdata_ccp.c:182: error: dereferencing pointer to incomplete type
>
> I think this may be the cause, as it is associated with the constraint that I am having problem with.
>
> Any ideas?
>
> 2. I tried the  SCIP_CALL( SCIPtransformCons(scip, cons,&pricerdata->budCon) ); trick that you suggested and it gave me the following error:
>
> [src/scip/scip.c:13265] ERROR: invalid SCIP stage<3>
> [src/scip/cons_linear.c:9226] ERROR: Error<0>  in function call
> [src/scip/cons.c:5063] ERROR: Error<0>  in function call
> [src/scip/scip.c:13534] ERROR: Error<0>  in function call
> [src/pricer_ccp.c:435] ERROR: Error<0>  in function call
> [src/scip/pricer.c:199] ERROR: Error<0>  in function call
> [src/scip/set.c:3069] ERROR: Error<0>  in function call
> [src/scip/scip.c:6252] ERROR: Error<0>  in function call
> [src/scip/scip.c:7349] ERROR: Error<0>  in function call
> [src/scip/scip.c:7542] ERROR: Error<0>  in function call
> [src/scip/scipshell.c:135] ERROR: Error<0>  in function call
> [src/scip/scipshell.c:341] ERROR: Error<0>  in function call
> [src/cmain.c:80] ERROR: Error<0>  in function call
> SCIP Error (0): unspecified error
>
> Thanks for your help.
>
> -Jose
>
>
> On May 15, 2012, at 11:29 AM, Stefan Heinz wrote:
>
>> 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