[gecode-users] Help me with Maximum density still life in Gecode

Christian Schulte cschulte at kth.se
Mon Oct 5 22:36:25 CEST 2009


Let me quote from Modeling with Gecode:

Never ask for solutions to homework. The only more

                offensive thing you could do is to provide a solution on the

                mailing list if someone has violated the no homework policy!

 

Apart from that, your question is not specific to Gecode.

 

Christian

 

--

Christian Schulte, www.ict.kth.se/~cschulte/

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of trinh cong quy
Sent: Monday, October 05, 2009 10:25 PM
To: users at gecode.org
Subject: [gecode-users] Help me with Maximum density still life in Gecode

 

Hi All,

I am stuck on this Maximum density still life problem with Gecode. I use
this constraint 
              post(*this,
tt(imp(m(i-1,j-1)+m(i-1,j)+m(i-1,j+1)+m(i,j-1)+m(i,j+1)+m(i+1,j-1)+m(i+1,j)+
m(i+1,j+1) == 3,m(i,j)==1)));
              post(*this,
tt(imp(m(i-1,j-1)+m(i-1,j)+m(i-1,j+1)+m(i,j-1)+m(i,j+1)+m(i+1,j-1)+m(i+1,j)+
m(i+1,j+1) <  2,m(i,j)==0)));
              post(*this,
tt(imp(m(i-1,j-1)+m(i-1,j)+m(i-1,j+1)+m(i,j-1)+m(i,j+1)+m(i+1,j-1)+m(i+1,j)+
m(i+1,j+1) >  3,m(i,j)==0)));

However, it is only with 7*7 board. For 8*8 board, my program run very
slowly. I am trying to improve by dividing the board into 3*3 squares but
still do not have solution

Anyone give suggestion, Thank you very much!!!! 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20091005/f76c5936/attachment.htm>


More information about the gecode-users mailing list