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

Welcome to the or-tools library main documentation hub

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.


What's new?


Here is a little summary:

v.0.2.13: (2014-10-30 00:01:40)
-------------------------------
* chapter 1: all pages are now accessible.

This is the list of changes.

Legend:


The User's Manual


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

As of September 4, 2014, the manual is NOT up to date with the new API. The tutorial code however IS up to date!

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     user_manual.v.x.y.z.mobi

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.
Manual

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.

Code

Content as of September 4, 2014:

Coding styles

Coding styles we follow:

C++
Google C++ Style Guide
Python
Google Python Style Guide

Coding styles we try to follow:

Java
Android Code Style Rules
C#
google-api-dotnet-client Coding standards

C++ tutorials

We've filled 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

We'll find a similar mechanism for the other languages soon.

Makefiles are (finally) provided. We favor the use of dynamic libraries. See Compiling libraries and running the examples on how to use these makefiles.

In short:
  1. You have to redefine the OR_TOOLS_TOP variable with the root directory of the or-tools libary:
    OR_TOOLS_TOP=/home/username/or-tools-read-only
    You can also overwrite this variable when invoking make:
    make OR_TOOLS_TOP=/home/username/or-tools-read-only
  2. If you want to play with the routing examples, the TUTORIAL variable must point to the C++ tutorial directory. By default, it is defined as:
    TUTORIAL=($OR_TOOLS_TOP)/documentation/tutorials/cplusplus
    If you deploy the tutorial examples somewhere else, update this variable accordingly.
  3. If you want to compile all examples:
    make all
  4. If you want to compile a specific example:
    • Windows:
      make my_example.exe
    • MacOS and Unix:
      make my_example
  5. To delete all generated files:
    make local_clean
    Don't use
    make clean
    as you will erase the generated files for the whole library!

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.

Python tutorials

Java tutorials

C# tutorials