[SCIP] Farkas pricing

Gerald Gamrath gamrath at zib.de
Fri Nov 8 09:31:56 CET 2019


Dear Lan,

that backtrace shows that the pricer_farkas() method of your pricer [#7] 
calls SCIPgetVarRedcost() [#6]. That asks the corresponding column for 
its redcost and finally calls SCIPcolGetRedcost() [#4], where the assert 
comes up.

Thus, it is your pricer that triggers this, because it asks a variable 
for its reduced cost during Farkas pricing, rather than its Farkas 
coefficient via SCIPgetVarFarkasCoef().

Best,
Gerald

Am 08.11.19 um 03:43 schrieb Ngô Lan:
>
> Hi Gerald,
>
>
> Here is the backtrace:
>
>
> #0  0x00007ffff9d25428 in __GI_raise (sig=sig at entry=6) at 
> ../sysdeps/unix/sysv/linux/raise.c:54
> #1  0x00007ffff9d2702a in __GI_abort () at abort.c:89
> #2  0x00007ffff9d1dbd7 in __assert_fail_base (fmt=<optimized out>, 
> assertion=assertion at entry=0x7ffffd938b60 "lp->validsollp == 
> stat->lpcount",
>     file=file at entry=0x7ffffd936f00 
> "/mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/lp.c", 
> line=line at entry=3899,
>     function=function at entry=0x7ffffd93eed0 <__PRETTY_FUNCTION__.20094> 
> "SCIPcolGetRedcost") at assert.c:92
> #3  0x00007ffff9d1dc82 in __GI___assert_fail (assertion=0x7ffffd938b60 
> "lp->validsollp == stat->lpcount", file=0x7ffffd936f00 
> "/mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/lp.c",
>     line=3899, function=0x7ffffd93eed0 <__PRETTY_FUNCTION__.20094> 
> "SCIPcolGetRedcost") at assert.c:101
> #4  0x00007ffffbe19d57 in SCIPcolGetRedcost (col=0x62b0000084f0, 
> stat=0x61b00001ea80, lp=0x61600000cf80) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/lp.c:3899
> #5  0x00007ffffc002e48 in SCIPgetColRedcost (scip=0x611000002c00, 
> col=0x62b0000084f0) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/scip_lp.c:1079
> #6  0x00007ffffc067e80 in SCIPgetVarRedcost (scip=0x611000002c00, 
> var=0x630000290628) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/scip_var.c:1883
> #7  0x000000000065fc3f in ObjPricerRCPSP::scip_farkas(Scip*, 
> SCIP_Pricer*, SCIP_Result*) ()
> #8  0x00007ffffc14baa6 in pricerFarkasObj (scip=0x611000002c00, 
> pricer=0x60c00001a680, result=0x7ffffffecae0) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/objscip/objpricer.cpp:199
> #9  0x00007ffffbfa703f in SCIPpricerFarkas (pricer=0x60c00001a680, 
> set=0x61d00001d680, prob=0x6110000183c0, result=0x7ffffffecae0)
>     at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/pricer.c:449
> #10 0x00007ffffbfa71fe in SCIPpricerExec (pricer=0x60c00001a680, 
> set=0x61d00001d680, prob=0x6110000183c0, lp=0x61600000cf80, 
> pricestore=0x608000366020, lowerbound=0x7ffffffecb28, 
> stopearly=0x7ffffffecae8,
>     result=0x7ffffffecae0) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/pricer.c:489
> #11 0x00007ffffc0b9d2f in SCIPpriceLoop (blkmem=0x625000007900, 
> set=0x61d00001d680, messagehdlr=0x608000005720, stat=0x61b00001ea80, 
> transprob=0x6110000183c0, origprob=0x611000018c80, primal=0x60c00001a500,
>     tree=0x61300000d240, reopt=0x0, lp=0x61600000cf80, 
> pricestore=0x608000366020, sepastore=0x60400023bd90, 
> cutpool=0x60b0001193f0, branchcand=0x60d000008c00, 
> eventqueue=0x60300001fe40,
>     eventfilter=0x619000013a80, cliquetable=0x607000027690, 
> pretendroot=0, displayinfo=0, maxpricerounds=2147483647, 
> npricedcolvars=0x7ffffffecce4, mustsepa=0x7ffffffeccdc, 
> lperror=0x7ffffffed5b4,
>     aborted=0x7ffffffed5b0) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/solve.c:2121
> #12 0x00007ffffc0bb2c3 in priceAndCutLoop (blkmem=0x625000007900, 
> set=0x61d00001d680, messagehdlr=0x608000005720, stat=0x61b00001ea80, 
> mem=0x60300000be60, transprob=0x6110000183c0, origprob=0x611000018c80,
>     primal=0x60c00001a500, tree=0x61300000d240, reopt=0x0, 
> lp=0x61600000cf80, pricestore=0x608000366020, 
> sepastore=0x60400023bd90, cutpool=0x60b0001193f0, 
> delayedcutpool=0x60b000119340,
>     branchcand=0x60d000008c00, conflict=0x61500001c000, 
> conflictstore=0x60f0000052c0, eventfilter=0x619000013a80, 
> eventqueue=0x60300001fe40, cliquetable=0x607000027690, fullseparation=1,
>     propagateagain=0x7ffffffed5a4, cutoff=0x7ffffffed84c, 
> unbounded=0x7ffffffed854, lperror=0x7ffffffed5b4, 
> pricingaborted=0x7ffffffed5b0)
>     at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/solve.c:2382
> #13 0x00007ffffc0be98b in solveNodeLP (blkmem=0x625000007900, 
> set=0x61d00001d680, messagehdlr=0x608000005720, stat=0x61b00001ea80, 
> mem=0x60300000be60, origprob=0x611000018c80, transprob=0x6110000183c0,
>     primal=0x60c00001a500, tree=0x61300000d240, reopt=0x0, 
> lp=0x61600000cf80, relaxation=0x60300001fb70, 
> pricestore=0x608000366020, sepastore=0x60400023bd90, 
> cutpool=0x60b0001193f0,
>     delayedcutpool=0x60b000119340, branchcand=0x60d000008c00, 
> conflict=0x61500001c000, conflictstore=0x60f0000052c0, 
> eventfilter=0x619000013a80, eventqueue=0x60300001fe40, 
> cliquetable=0x607000027690,
>     initiallpsolved=0, fullseparation=1, newinitconss=0, 
> propagateagain=0x7ffffffed5a4, solverelaxagain=0x7ffffffed59c, 
> cutoff=0x7ffffffed84c, unbounded=0x7ffffffed854, lperror=0x7ffffffed5b4,
>     pricingaborted=0x7ffffffed5b0) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/solve.c:3086
> #14 0x00007ffffc0c1ebc in propAndSolve (blkmem=0x625000007900, 
> set=0x61d00001d680, messagehdlr=0x608000005720, stat=0x61b00001ea80, 
> mem=0x60300000be60, origprob=0x611000018c80, transprob=0x6110000183c0,
>     primal=0x60c00001a500, tree=0x61300000d240, reopt=0x0, 
> lp=0x61600000cf80, relaxation=0x60300001fb70, 
> pricestore=0x608000366020, sepastore=0x60400023bd90, 
> branchcand=0x60d000008c00, cutpool=0x60b0001193f0,
>     delayedcutpool=0x60b000119340, conflict=0x61500001c000, 
> conflictstore=0x60f0000052c0, eventfilter=0x619000013a80, 
> eventqueue=0x60300001fe40, cliquetable=0x607000027690, 
> focusnode=0x6290002695d8,
>     actdepth=5, propagate=1, solvelp=1, solverelax=1, forcedlpsolve=0, 
> initiallpsolved=0, fullseparation=1, afterlpproplps=0x7ffffffed650, 
> heurtiming=0x7ffffffed58c, nlperrors=0x7ffffffed590,
>     fullpropagation=0x7ffffffed5a8, propagateagain=0x7ffffffed5a4, 
> lpsolved=0x7ffffffed598, relaxcalled=0x7ffffffed5bc, 
> solvelpagain=0x7ffffffed5a0, solverelaxagain=0x7ffffffed59c, 
> cutoff=0x7ffffffed84c,
>     postpone=0x7ffffffed850, unbounded=0x7ffffffed854, 
> stopped=0x7ffffffed864, lperror=0x7ffffffed5b4, 
> pricingaborted=0x7ffffffed5b0, forcedenforcement=0x7ffffffed5b8)
>     at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/solve.c:3890
> #15 0x00007ffffc0c3245 in solveNode (blkmem=0x625000007900, 
> set=0x61d00001d680, messagehdlr=0x608000005720, stat=0x61b00001ea80, 
> mem=0x60300000be60, origprob=0x611000018c80, transprob=0x6110000183c0,
>     primal=0x60c00001a500, tree=0x61300000d240, reopt=0x0, 
> lp=0x61600000cf80, relaxation=0x60300001fb70, 
> pricestore=0x608000366020, sepastore=0x60400023bd90, 
> branchcand=0x60d000008c00, cutpool=0x60b0001193f0,
>     delayedcutpool=0x60b000119340, conflict=0x61500001c000, 
> conflictstore=0x60f0000052c0, eventfilter=0x619000013a80, 
> eventqueue=0x60300001fe40, cliquetable=0x607000027690, 
> cutoff=0x7ffffffed84c,
>     postpone=0x7ffffffed850, unbounded=0x7ffffffed854, 
> infeasible=0x7ffffffed858, restart=0x7ffffffeda8c, 
> afternodeheur=0x7ffffffed860, stopped=0x7ffffffed864)
>     at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/solve.c:4190
> #16 0x00007ffffc0c6f6d in SCIPsolveCIP (blkmem=0x625000007900, 
> set=0x61d00001d680, messagehdlr=0x608000005720, stat=0x61b00001ea80, 
> mem=0x60300000be60, origprob=0x611000018c80, transprob=0x6110000183c0,
>     primal=0x60c00001a500, tree=0x61300000d240, reopt=0x0, 
> lp=0x61600000cf80, relaxation=0x60300001fb70, 
> pricestore=0x608000366020, sepastore=0x60400023bd90, 
> cutpool=0x60b0001193f0,
>     delayedcutpool=0x60b000119340, branchcand=0x60d000008c00, 
> conflict=0x61500001c000, conflictstore=0x60f0000052c0, 
> eventfilter=0x619000013a80, eventqueue=0x60300001fe40, 
> cliquetable=0x607000027690,
>     restart=0x7ffffffeda8c) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/solve.c:4974
> #17 0x00007ffffc04ff0e in SCIPsolve (scip=0x611000002c00) at 
> /mnt/c/Users/hp/Documents/GitHub/scipoptsuite-6.0.2/scip/src/scip/scip_solve.c:2648
> #18 0x000000000061838b in RCPSP::solve(int) ()
> #19 0x00000000006a95fb in main ()
>
>
> Thank you for your time.
>
>
> Best,
>
> Lan
>
> ------------------------------------------------------------------------
> *From:* Gerald Gamrath <gamrath at zib.de>
> *Sent:* 07 November 2019 12:24:52
> *To:* Ngô Lan; Scip at zib.de
> *Subject:* Re: [SCIP] Farkas pricing
> Dear Lan,
>
> you are right, SCIPcolGetRedcost should not be called in that case. 
> The assertion alone does not help too much for pinning down the reason 
> for the issue, could you run your code with gdb and send me the 
> complete backtrace?
>
> Best,
> Gerald
>
> Am 07.11.19 um 02:14 schrieb Ngô Lan:
>>
>> Hi Gerald,
>>
>>
>> Thank you for your fast reply. In my implementation, I do not 
>> implement the Farkas pricing but a heuristic in the farkas 
>> callback to generate more columns. So I didn't call SCIPcolGetRedcost 
>> directly but it was called when the master is resolved after the new 
>> column is added. The error I got is "lp.c:3899: SCIPcolGetRedcost: 
>> Assertion `lp->validsollp == stat->lpcount' failed."
>>
>> I was wondering why this error occurred since the master is 
>> infeasible so when it is solved again after farkas, it should not 
>> call SCIPcolGetRedcost. Or did I do something wrong that leads 
>> to that SCIPcolGetRedcost call?
>>
>>
>> Best,
>>
>> Lan
>>
>> ------------------------------------------------------------------------
>> *From:* Scip <scip-bounces at zib.de> on behalf of Gerald Gamrath 
>> <gamrath at zib.de>
>> *Sent:* 06 November 2019 12:02:40
>> *To:* scip at zib.de
>> *Subject:* Re: [SCIP] Farkas pricing
>> Dear Lan,
>>
>> sorry, the documentation is a bit misleading in this case. Similar to 
>> constraints, there is a separate method to get the Farkas coefficient 
>> for variables. Please use SCIPgetVarFarkasCoef() for this.
>>
>> Best,
>> Gerald
>>
>> On 06.11.19 02:10, Ngô Lan wrote:
>>>
>>> Hi all,
>>>
>>>
>>> I am implementing BPC and after some branchings, my master will 
>>> become infeasible due to not having enough columns in the pool. 
>>> Instead of Farkas pricing, I implement a heuristic to add more 
>>> columns into the problem inside the SCIP_DECL_PRICERFARKAS callback. 
>>> However I ran into the assertion error "lp->validsollp == 
>>> stat->lpcount" in function SCIPcolGetRedcost. I can understand that 
>>> this is due to the lastest solution being infeasible but then how 
>>> Farkas works normally? It would be great if someone can give me 
>>> insight into this. Thank you for your time.
>>>
>>>
>>> Best,
>>>
>>> Lan
>>>
>>>
>>> _______________________________________________
>>> Scip mailing list
>>> Scip at zib.de
>>> https://listserv.zib.de/mailman/listinfo/scip
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20191108/4efebfc1/attachment.html>


More information about the Scip mailing list