[gecode-users] GECODE: Crosswords with two constraints, set letters and black cells

Andrea Sacconi andreasacconi at hotmail.co.uk
Sun Sep 23 21:49:04 CEST 2018


I think I am making the definition of the space flawed somehow, because it seems strange that setting three letters only out of 105 would cause a failure after 158 milliseconds, without retrying .....
________________________________
From: users-bounces at gecode.org <users-bounces at gecode.org> on behalf of Andrea Sacconi <andreasacconi at hotmail.co.uk>
Sent: 23 September 2018 20:02
To: Christian Schulte; users at gecode.org
Subject: Re: [gecode-users] GECODE: Crosswords with two constraints, set letters and black cells

I just tried again with the command you mentioned, unfortunately with already three constrained letters everything fails. Why failures 1?! This is not trying many times though ... I am perplexed.

[cid:a2c91763-1b0d-421c-9808-be6f0947e583]

Seems strange to me, because I have reduced the size of the grid to be 12x7, so smaller for testing purposes. I would expect with such a huge dictionary to be able to find a solution!

Cheers,
Andrea

________________________________
From: Christian Schulte <cschulte at kth.se>
Sent: 23 September 2018 19:55
To: Andrea Sacconi; users at gecode.org
Subject: RE: [gecode-users] GECODE: Crosswords with two constraints, set letters and black cells


I wouldn’t know. Cheers Christian



--

Christian Schulte, https://chschulte.github.io/

Professor of Computer Science

Software and  Computer Systems

School of Electrical Engineering and Computer Science

KTH Royal Institute of Technology, Sweden



From: Andrea Sacconi <andreasacconi at hotmail.co.uk>
Sent: Sunday, September 23, 2018 8:53 PM
To: Christian Schulte <cschulte at kth.se>; users at gecode.org
Subject: Re: [gecode-users] GECODE: Crosswords with two constraints, set letters and black cells



Hi,



I am using the example in the documentation, where the list of words is explicitly provided:



const int n_words[] = {

1, 26, 66, 633, 2443, 4763, 7585, 10380, 10974

};



so hopefully a dictionary big enough.



I will try to use the command suggested. Do you think that imposing 20 or 30 letter constraints like that is a problem?



Cheers,

Andrea





________________________________

From: Christian Schulte <cschulte at kth.se<mailto:cschulte at kth.se>>
Sent: 23 September 2018 19:37
To: Andrea Sacconi; users at gecode.org<mailto:users at gecode.org>
Subject: RE: [gecode-users] GECODE: Crosswords with two constraints, set letters and black cells



This might depend on the dictionary you are using. Check whether it contains words with the corresponding letters. Note that you can give your own dictionary as a file, check examples/crossword.cpp that comes with Gecode.



Anyway, I would not overwrite the variables but constraint them such as in

  rel(*this, ml(10,5) == ‘f’);

and so on.



Cheers

Christian



--

Christian Schulte, https://chschulte.github.io/

Professor of Computer Science

Software and  Computer Systems

School of Electrical Engineering and Computer Science

KTH Royal Institute of Technology, Sweden



From: users-bounces at gecode.org<mailto:users-bounces at gecode.org> <users-bounces at gecode.org<mailto:users-bounces at gecode.org>> On Behalf Of Andrea Sacconi
Sent: Sunday, September 23, 2018 8:31 PM
To: users at gecode.org<mailto:users at gecode.org>
Subject: [gecode-users] GECODE: Crosswords with two constraints, set letters and black cells



Hi all,



I am having a look at the examples of crosswords in Gecode. I am doing this for a gift. So the satisfaction of getting it done would be even greater!



I would like to add another set of constraints, not just black cells but also specific letters on the grid (which I would like to use to arrange a secret message that the receiver will read after having solved the crossword).



I tried this (just an example):



IntVar letter1(*this, 'f', 'f');

ml(10, 5) = letter1;

IntVar letter2(*this, 'i', 'i');

ml(9, 4) = letter2;



Running the example of Figure 22.2 of the documentation (Chapter 22) works fine if I impose only two constraints like the above, but everything already collapses if I try to set three letters.



Do you think what I am thinking of is feasible? I mean, I would like to fix 20 or 30 letters on a 22x15 grid, but it seems that I am not even close to getting a solution.



I am trying to read through the documentation but by scarcity of time I am not sure if I am trying the impossible or simply I have to tweak other parameters.



Could you please help me?



Cheers,

Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20180923/f556d061/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 32707 bytes
Desc: image.png
URL: <http://www.gecode.org/pipermail/users/attachments/20180923/f556d061/attachment-0001.png>


More information about the users mailing list