[gecode-users] Possible Bug - Increase IntVars Range and Gecode Stalls

Navid Mohaghegh navid at navid.ca
Thu Jan 16 15:31:53 CET 2014


Hi everyone,

I tried Gist as Christian mentioned. Gist will not terminate for higher ranges (attached screenshot shows that I had to stop Gist manually for range 1535).

Could you please point me in the right direction about what I have to more efficient for this problem:
-Like bin-packing problem, we have bunch of rectangles that shouldn't overlap with each other. 
-Unlike bin-packing, the width and hight of the rectangles can be variable (e.g. if we have more space in our sheet, we don't mind a rectangle gets bigger). 
-We have bunch of constraint for the size and location of rectangles.
-In below, 15 rectangles, 4 array of variables (2 arrays for X,Y location and 2 variables for Width,Height which is for size)     


Could you please let me know?

Thank you,
Navid


On Jan 14, 2014, at 11:42 AM, Christian Schulte <cschulte at kth.se> wrote:

> The bug you refer to has been fixed. But try Gist, there you can see what happens.
>  
> Cheers
> Christian
>  
> --
> Christian Schulte, Professor of Computer Science, KTH, www.ict.kth.se/~cschulte/
>  
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Navid Mohaghegh
> Sent: Tuesday, January 14, 2014 5:39 PM
> To: cschulte at kth.se
> Cc: users at gecode.org
> Subject: Re: [gecode-users] Possible Bug - Increase IntVars Range and Gecode Stalls
>  
> Hi Christian,
>  
> Thank your for your reply. I didn't try Gist yet, I will go and look at sample code to learn Gist and I will give it a shot.
>  
> Could you kindly have a look at this comment in mailing list: "There seems to be a trivial bug in INT_VALUES_MAX: SEL_VALUES_MIN is used instead of SEL_VALUES_MAX. The attached patch fixes it."
> I am asking this as mu space get solved by Gecode almost instantly (less than 1ms on a 128 GB ram, quad CPU, 64 cores workstation) for values like 1199. And the moment it goes to 1200 it will stalls. After all it should get slow (I agree with you), but not stall/freeze for 5 days. That is the main reason I suspect a tiny bug somewhere.  
>  
> I will also look at Gist as well as you instructed.
>  
> Thank you,
> Navid
>  
>  
> On Jan 14, 2014, at 11:18 AM, Christian Schulte <cschulte at kth.se> wrote:
> 
> 
> Did you try it in Gist to see how large the search trees get or whether Gecode just hangs?
>  
> After all, you exponentially increase the search space!
>  
> Christian
>  
> --
> Christian Schulte, Professor of Computer Science, KTH, www.ict.kth.se/~cschulte/
>  
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Navid Mohaghegh
> Sent: Tuesday, January 14, 2014 5:04 PM
> To: users at gecode.org
> Subject: [gecode-users] Possible Bug - Increase IntVars Range and Gecode Stalls
> Importance: High
>  
> Hi Everyone,
>  
> My question:
> I am wondering what is happening in below and why Gecode stalls stall whenI increase the range of my IntegerVars (while its CPU utilization goes very high) despite the fact that our constraints are not changed?
>  
> Background (http://navid.ca/gecode/test.cpp):
> We are trying to solve a space. We can easily solve the space when our variable ranges are small (e.g. 0 to 800). As soon as the range goes higher (e.g. 0-1535) Gecode will stall and can not produce a solution for the space with exactly the same constraints as before.
>  
> We have 4 groups of integer_array variables. They are called vars_a, vars_b, vars_c and vars_d. And inside each of them, we have 15 integer variables.
> NavidTest(int n, int vars_a_max_, int vars_b_max_, int vars_c_max_, int vars_d_max_, int vcost_max_); 
> NavidTest* m = new NavidTest(15,  800, 500, 410, 60, 2000000000); means:
> n = 15
> vars_a[0] ... vars_a[15] can have values from zero to vars_a_max_ = 800
> vars_b[0] ... vars_b[15] can have values from zero to vars_b_max_ = 500
> vars_c[0] ... vars_c[15] can have values from zero to vars_c_max_ = 410
> vars_d[0] ... vars_d[15] can have values from zero to vars_d_max_ = 60
> our cost variable can be have values from zero to vcost_max_ = 2,000,000,000
> As we have quadratic cost functions and values can easily grow.
> lift() method is where we add our constraints. 
> For demonstration purpose, we have a method that once used, Gecode can produce solution: it is called "void the_one_works()"
> And we have another one (called: void the_one_doesnot_work) that can not be solved using Gecode (it is perfectly solvable and we test our solution in verify_answer() method)
> The only difference between the_one_works() and the_one_doesnot_work() is an increase in vars_a max range from 800 to 1535. 
>  
>  
>  
> I have found a mailing list entry stating a possible bug:
> ==========
> From: victor.zverovich at ... <victor.zverovich at ...>
> Subject: bug in INT_VALUES_MAX
> Newsgroups: gmane.comp.lib.gecode.user
> Date: 2013-06-21 22:20:18 GMT (29 weeks, 3 days, 17 hours and 17 minutes ago)
> There seems to be a trivial bug in INT_VALUES_MAX: SEL_VALUES_MIN is used instead of SEL_VALUES_MAX. The attached patch fixes it.
> Victor
> ==========
>  
> Can someone have a look and let me know?
> We are using Gecode 4.2.1 on Linux
> GCC 4.7.2 and also latest 4.9
> Debian 64bit and CentOS 64bit  
> My code and how I compile and run is here: http://navid.ca/gecode/test.cpp
>  
> Thank you,
> Navid

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20140116/0d5b6e01/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2014-01-15 at 6.33.03 PM.png
Type: image/png
Size: 138042 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20140116/0d5b6e01/attachment-0001.png>


More information about the users mailing list