[Scip] SCIPgetTransformedCons

Jose Walteros jl.walteros at gmail.com
Thu May 17 02:17:42 MEST 2012


Hi all, 

I managed to solve the problem that I had before and now the code is working. Although, there is a bug in my constraint handler for the branching rule (most probably a dumb thing). I am trying to compile the file using the option OPT=dbg. But when I run it, I am getting the following assertion failure right before the problem begins to be solved:

Assertion failed: (SCIPbufferGetNUsed(scip->set->buffer) == 0), function initPresolve, file src/scip/scip.c, line 6309.

This is a list of the stack collected using dbg debugger. Do you have any idea why this is happening? 


Program received signal SIGABRT, Aborted.
0x00007fff91a0d82a in __kill ()
(gdb) backtrace 
#0  0x00007fff91a0d82a in __kill ()
#1  0x00007fff8c76fa9c in abort ()
#2  0x00007fff8c7a25de in __assert_rtn ()
#3  0x0000000100624c6f in initPresolve (scip=0x100d00860, unbounded=0x7fff5fbff1d0, infeasible=0x7fff5fbff1cc)
    at scip.c:6309
#4  0x0000000100628249 in presolve (scip=0x100d00860, unbounded=0x7fff5fbff1d0, infeasible=0x7fff5fbff1cc) at scip.c:6855
#5  0x000000010062b353 in SCIPpresolve (scip=0x100d00860) at scip.c:7357
#6  0x000000010062bf7a in SCIPsolve (scip=0x100d00860) at scip.c:7542
#7  0x000000010068cbf2 in fromCommandLine (scip=0x100d00860, filename=0x7fff5fbffc43 "../data/test4.dat")
    at scipshell.c:135
#8  0x000000010068d6fd in SCIPprocessShellArguments (scip=0x100d00860, argc=3, argv=0x7fff5fbffa80, 
    defaultsetname=0x1008531ac "scip.set") at scipshell.c:341
#9  0x0000000100001a01 in runShell (argc=3, argv=0x7fff5fbffa80, defaultsetname=0x1008531ac "scip.set") at cmain.c:80
#10 0x0000000100001ae7 in main (argc=3, argv=0x7fff5fbffa80) at cmain.c:101

Thanks a lot.

-Jose

On May 16, 2012, at 2:12 AM, Stefan Heinz wrote:

> 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