The following are the examples located in the example directory.
- The “Hello world” of constraint programming. Shows the basic usage with some linear and distinct constraints.
- Similar to the above, but also shows an example of optimization search.
- The popular puzzle solved using constraint programming. Shows how to use matrices and set propagation strengths.
- Sudoku with sets
- The sudoku puzzle again, but this time using sets and a different viewpoint. Shows how to use set operations.
- Shows how to use distinct with offsets.
- Magic sequence
- Uses the count constraint and some implied constraints.
- Nonograms – a.k.a. Paint by Numbers
- Uses regular
expression constraints to solve the popular logic puzzle.
- Square tiling
- Uses symmetry breaking and implied constraints to speed up the search.
- Minesweeper solved using constraint programming.
- Survo puzzle
- The Survo puzzle solved using constraint programming.
Additionally, the following websites may be of interest:
- hakank’s Constraint Programming Blog
- A blog containing several example models along with the author’s accounts of Gecode/R.
- Gecode’s example models
- Gecode/R is a Ruby interface to Gecode. Hence Gecode’s example models can typically be translated constraint by constraint into Ruby.