Open source operations research tools developed at Google.
Project   |   Google+ Or-Tools   |   Blog   |   Mailing list   |   Download
or-tools doodle

Welcome to the or-tools library main documentation hub

We are in the process of rewriting the documentation in a more general setting.
Have a look at Google Optimization.

We are working hard to provide useful documentation. The documentation is distributed in several documents:

You can find more details about these documents in the foreword of the manual.

For suggestions, remarks, corrections about the documentation, please contact Thank you very much.

The or-tools documentation is covered by the Apache License 2.0.

The User's Manual

This is work in progress. Pages will be modified, moved or even removed!

The epub version is still experimental. We strongly recommend calibre (ebook-viewer) whenever possible to view the epub version. With this version, you should be able to convert the manual to the right format for your preferred hand-held device. For instance, to transform the epub version into a mobi version:

ebook-convert    user_manual.v.x.y.z.epub

We also recommend to use the epub version as it is currently the best available ebook format.

The manual

Progress at a glance:

The following percentages show you the completion status of the manual. Note that what we publish online might be not up to date.

The tutorial examples

You can download all the code at once or pick the code corresonding to your favorite language. You'll find the code here. All files are encoded in UTF-8 and we use LF (Unix) newlines. The code is cross-platform though.

The code is not well documented inside the source files as we explain it in great details in the user's manual. Some files only exist in some languages since some features do not have equivalents in all languages (for instance, the Google gflags library is missing in Java and C#).

Don't be surprised if the code in the manual is slightly different from the code in the tutorials. In the manual, we focus on the essential while the tutorials might be more functional.


Content as of September 4, 2014:

Coding styles

Coding styles we follow:

Google C++ Style Guide
Google Python Style Guide

Coding styles we try to follow:

Android Code Style Rules
google-api-dotnet-client Coding standards

C++ tutorials

We've filled most of the code with VLOG(x)s which allow to follow in real time what the programs do. x varies between 1 and 4. The higher the value of x, the more detailed informations on screen. You can trigger these logs with the log_level gflag:

./my_wonderful_program -log_level=2

Makefiles are provided. We favor the use of dynamic libraries. See Getting started on how to run the tutorial examples. For more information about our makefiles, see Compiling libraries and running the examples.

Last but not least, you might wonder why we don't use (or rather minimize the use of) streams in our examples. This is an internal requirement.

You can download all files at once here.


Chap2: First steps with or-tools: Cryptarithmetic Puzzles chap2
Chap3: Using objectives in constraint programming: the Golomb Ruler Problem chap3
Chap4: Reification
Chap5: Defining search primitives: the n-Queens Problem chap5
Chap6: Local search: the Job-Shop Problem chap6
Chap7: Meta-heuristics: several previous problems chap7
Chap8: Custom constraints: the alldifferent_except_0 constraint NOT YET
Chap9: Travelling Salesman Problems with constraints: the TSP with time windows NOT YET
Chap10: Vehicule Routing Problems with constraints: the capacitated vehicle routing problem chap10: NOT TESTED
Common: Common files common: NOT TESTED
Routing common: Routing common files routing_common: NOT TESTED

Python tutorials

Java tutorials

C# tutorials