# Gecode/R 1.0.0

**URL:** <https://www.ruby-forum.com/t/gecode-r-1-0-0/150022>\
**Category:** Ruby\
**Created:** [October 2, 2008, 4:20pm UTC](https://www.ruby-forum.com/t/gecode-r-1-0-0/150022 "2008-10-02T16:20:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas\_l](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@andreas\_l](https://www.ruby-forum.com/u/andreas_l)\
**Post date:** [October 2, 2008, 4:20pm UTC](https://www.ruby-forum.com/t/gecode-r-1-0-0/150022/1 "2008-10-02T16:20:13Z")

</div>

Gecode/R version 1.0.0 has been released.

[http://gecoder.rubyforge.org/](http://gecoder.rubyforge.org/)

This is the first officially stable release of Gecode/R.

== What is Gecode/R?

Gecode/R is a Ruby interface to the Gecode constraint programming  
library[1]. Gecode/R is intended for people with no previous experience  
of constraint programming, aiming to be easy to pick up and use.

== Installation

Install Gecode and Gecode/R:

gem install gecoder-with-gecode

== What is Constraint Programming?

Constraint programming means that you describe the problem to the  
solver, using variables and constraints, and then let the solver find  
the solution. It is useful for solving problems where you have to do a  
search through various assignments to find the best solution (or just  
any solution). This includes problems such as scheduling and sudoku.

== Example

Examples are located at [http://gecoder.rubyforge.org/examples.html](http://gecoder.rubyforge.org/examples.html) . The  
following example solves the equation system  
x + y = z  
x = y - 3  
0 \<= x,y,z \<= 9

require ‘rubygems’  
require ‘gecoder’

solution = Gecode.solve do  
# Set up the variables, three integers with domain 0…9.  
variables\_is\_an int\_var\_array(3, 0…9)  
x,y,z = variables

```
# Describe the problem (in this case the equations).
(x + y).must == z
x.must == y - 3

# Tell it what the variables of the problem are.
branch_on variables

```

end

puts ‘x y z’  
puts solution.variables.values.join(’ ')

Output:

x y z  
0 3 3

== Thanks

A big thank you to the following people who have contributed to getting  
Gecode/R to where it is today.

- David C. - Created the initial raw bindings from Gecode to Ruby.
- Eivind E. - Provided the idea that led to the syntax used to  
specify the regular expressions used in regexp constraints.
- Google and Ruby Central - Got the project started with funding through  
Google Summer of Code 2007.
- James Edward G. II - Provided superb mentoring during Google Summer  
of Code 2007, influencing many decisions made.
- Mikael Lagerkvist - Provided support from the Gecode side.
- Andreas L. - Created the interface on top of the raw bindings and  
the website.
- Adam Rose - Suggested that Gecode/R should use a mixin rather than  
inheritance.

[1] [http://www.gecode.org/](http://www.gecode.org/)
