Generated on Wed Nov 1 15:04:51 2006 for Gecode by doxygen 1.4.5

PicturePuzzle Class Reference
[Example scripts (models)]

Inherits Example.

List of all members.


Detailed Description

Example: Picture puzzles

This example solves picture-puzzles. A picture-puzzle is composed of a matrix of markers. For each row/column there is a specification on how many groups of markers (separated by one or more unmarked spots) and their length. The objective is to find a valid assignment, which incidentally may also produce a pretty picture.

Picture puzzles are also called Nonograms.

Problem 12 at http://www.csplib.org/.

Definition at line 44 of file picture-puzzle.cc.

Picture specifications

A specification is given by a list of integers. The first two integers (w and h) specify the number of columns and rows respectively. Then w + h groups of integers follows. Each group is started by the number of integers it contains (n), followed by n integers specifying the sizes of the stretches of markers in that row/column.

const int * specs []
 List of specifications.
const unsigned n_examples
 Number of specifications.

Public Member Functions

 PicturePuzzle (const Options &o)
 Construction of the model.
 PicturePuzzle (bool share, PicturePuzzle &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Copy space during cloning.
virtual void print (void)
 Print solution.


Constructor & Destructor Documentation

PicturePuzzle::PicturePuzzle const Options o  )  [inline]
 

Construction of the model.

Definition at line 76 of file picture-puzzle.cc.

PicturePuzzle::PicturePuzzle bool  share,
PicturePuzzle s
[inline]
 

Constructor for cloning s.

Definition at line 103 of file picture-puzzle.cc.


Member Function Documentation

virtual Space* PicturePuzzle::copy bool  share  )  [inline, virtual]
 

Copy space during cloning.

Implements Gecode::Space.

Definition at line 110 of file picture-puzzle.cc.

virtual void PicturePuzzle::print void   )  [inline, virtual]
 

Print solution.

Reimplemented from Example.

Definition at line 116 of file picture-puzzle.cc.


Friends And Related Function Documentation

const int * specs  )  [related]
 

List of specifications.

Definition at line 475 of file picture-puzzle.cc.

const unsigned n_examples [related]
 

Number of specifications.

Definition at line 478 of file picture-puzzle.cc.


The documentation for this class was generated from the following file: