
Example: Crossword puzzle More...
Public Types | |
| enum | { BRANCH_WORDS, BRANCH_LETTERS, BRANCH_LETTERS_ALL } |
| Branching to use for model. More... | |
Public Member Functions | |
| Crossword (const SizeOptions &opt) | |
| Actual model. More... | |
| bool | master (const CRI &cri) |
| Do not perform a restart when a solution is found. More... | |
| Crossword (bool share, Crossword &s) | |
| Constructor for cloning s. More... | |
| virtual Space * | copy (bool share) |
| Copy during cloning. More... | |
| virtual void | print (std::ostream &os) const |
| Print solution. More... | |
Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace > | |
| ScriptBase (const Options &opt) | |
| Constructor. More... | |
| ScriptBase (bool share, ScriptBase &e) | |
| Constructor used for cloning. More... | |
| virtual void | compare (const Space &home, std::ostream &os) const |
| Compare with s. More... | |
Static Public Member Functions | |
| static void | printletters (const Space &home, const BrancherHandle &, unsigned int a, IntVar, int i, const int &n, std::ostream &o) |
| Print brancher information when branching on letters. More... | |
| static void | printwords (const Space &, const BrancherHandle &, unsigned int a, IntVar, int i, const int &n, std::ostream &o) |
| Print brancher information when branching on words. More... | |
Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace > | |
| static std::ostream & | select_ostream (const char *name, std::ofstream &ofs) |
| Choose output stream according to name. More... | |
| template<class Script , template< class > class Engine, class Options > | |
| static void | run (const Options &opt, Script *s=NULL) |
Protected Attributes | |
| const int | w |
| Width of crossword grid. More... | |
| const int | h |
| Height of crossword grid. More... | |
| IntVarArray | letters |
| Letters for grid. More... | |
Example: Crossword puzzle
Fill crossword grids with words, that is construct a crossword puzzle. For a recent paper on this classical problem, see: Crossword Puzzles as a Constraint Problem, Anbulagan and Adi Botea, CP 2008, pages 550-554, Springer Verlag.
Note that "Modeling and Programming with Gecode" uses this example as a case study.
Definition at line 70 of file crossword.cpp.
|
inline |
Actual model.
Definition at line 86 of file crossword.cpp.
|
inline |
Constructor for cloning s.
Definition at line 195 of file crossword.cpp.
|
inlinestatic |
Print brancher information when branching on letters.
Definition at line 167 of file crossword.cpp.
|
inlinestatic |
Print brancher information when branching on words.
Definition at line 178 of file crossword.cpp.
|
inline |
Do not perform a restart when a solution is found.
Definition at line 187 of file crossword.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 201 of file crossword.cpp.
|
inlinevirtual |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 206 of file crossword.cpp.
|
protected |
Width of crossword grid.
Definition at line 73 of file crossword.cpp.
|
protected |
Height of crossword grid.
Definition at line 75 of file crossword.cpp.
|
protected |
Letters for grid.
Definition at line 77 of file crossword.cpp.