My Google or-tools / CP Solver page

Google or-tools (Operations Research Tools developed at Google), a.k.a. Google CP Solver consists of support for constraint programming and LP/MIP (and support for local support which I have yet to look into).

Project group: or-tools-discuss

The solver is available via SVN:, and is obtained by the SVN command:
svn checkout or-tools-read-only
Please see AGettingStarted on how to install, required libraries etc.

Documentation: or-tools Wiki

Examples (SVN repository). Many of my models are placed here as well (except for the C++ examples).


See Full Reference Manual for a Doxy version of the C++ code.

There is not yet any tutorial or complete reference of the Python or Java interfaces to the constraints. The Wiki page UsingCPSolverCppAPI lists the C++ version of the methods with some comments. The Python and Java methods are (almost) always the C++ version minus the leading Make. E.g. the Python version of the C++ method MakeAllDifferent is AllDifferent (in the models: solver.AllDifferent), and the Java version is makeAllDifferent.

See below for my Java models.

See below for my LP/MIP models.

See further below for my C# models.

My Google CP Solver / Python models

Here are my Google CP Solver / Python models. All program files contains more information about the problem as well as references to other implementations of the same problem. The first blog posts about these models are
A first look at Google CP Solver/Python (Google or-tools), Improvements of some Google CP Solver models, and Some new Google CP Solver/Python models.

My Google CP Solver / Java models

2011-03-17: Google released a Java interface to the CP Solver, and I have just started to implement models for this, which is basically a port of some Python models.
2011-03-29: Blogged about it in
A first look at Google or-tools' Java interface

To simplify my life, all examples has been placed in the package Some (if not all) models is also available at the SVN repository .

My Google or-tools LP/MIP models in Python

2011-03-31: Blogged
Google or-tools has released support for LP/IP

My Google or-tools C# models

2012-02-05: Blogged about this in
A first look at Google or-tools C# interface

Please note that I'm developing these programs in Mono (under Ubuntu Linux 11.10, 64-bit); they will hopefully also run on other .NET/Mono platforms. Quite a few are rather faitful ports from the Java versions, and some (but not that faithful ports) from the Python models.

Many (if not all) of these models has been pushed to the or-tools SVN

For compiling and running these models using Mono, something like this should work:
  $ export OR_TOOLS=../or-tools/svn/or-tools-read-only
  $ mono-csc -lib:$OR_TOOLS /r:Google.OrTools.ConstraintSolver.dll model.cs
  $ ./model.exe

Also, see my other pages about constraint programming systems:
* My Constraint Programming Blog, especially the Google CP Solver category
* Constraint Programming
* Common constraint programming problems
* My MiniZinc page
* My Zinc page
* My JaCoP page
* My JaCoP/Scala page
* My Choco page
* My Gecode/R page
* My Comet page
* My Gecode page
* My ECLiPSe page
* My Tailor/Essence' page
* My SICStus Prolog page
* My OscaR page
* My JSR-331 page
* My Numberjack page
* My AIMMS+CP page
* My B-Prolog page
* My Choco3 page
* My Picat page

Back to my homepage
Created by Hakan Kjellerstrand