OR-Tools Release Notes

This page lists changes to OR-Tools, including new features, bug fixes, and improvements to the code and installation procedures.

If you experience problems installing OR-Tools, check the Troubleshooting section in the OR-Tools installation instructions. If your problem is not listed there, check the issues on GitHub, or don't hesitate to open a new one, and we will be happy to provide you with assistance.

The following are the release notes for OR-Tools, beginning with the latest release.

March 2024

Announcing the release of OR-Tools v9.9

We have released OR-Tools v9.9. To update your version, see the appropriate section of OR-Tools Installation.

You can find the release note on github

November 2023

Announcing the release of OR-Tools v9.8

We have released OR-Tools v9.8. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Add Python 3.12.
  • Add support for Ubuntu 23.10

Linear Solver

  • Port ModelBuilder to .Net.
  • Rename LogCallback to MbLogCallback to avoid collision with SAT LogCallback.
  • Extend ModelBuilder API:
    • Add indicator constraints.
    • Add hinting support.
    • Add model cloning.

Math Opt

  • Deep rework.

Routing

  • Add ROUTING_OPTIMAL status.
  • Make RoutingModel non copyable nor movable.
  • Fix some infinite loop in local search operators.
  • Add a PickupDeliveryPosition internal struct.
  • Add IsPickup() and IsDelivery() methods.

SAT

  • Reduce memory footprint for large model.
  • Improved scheduling search.
  • add packing_precedences_lns.
  • optimize and fix feasibility jump.
  • optimize linear presolve and better presolve logging.
  • Improve presolve for int_abs, int_mod, int_prod and lin_max.
  • Improve Panda support
  • Few bug fix.

GitHub Changelog

August 2023

Announcing the release of OR-Tools v9.7

We have released OR-Tools v9.7. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Drop Centos-8 (EOL).
  • Drop Debian 10.
  • Drop Fedora [33, 36] (EOL).
  • Drop Ubuntu 18.04 LTS (EOL).
  • Drop Python 3.7 (EOL).
  • Disable netcore3.1 support in CMake (EOL).

Model Builder python

  • Allow use of Pandas dataframes and series to create variables.
  • Complete typing information

PDLP

  • various update.

CP-SAT

  • Performance improvements. (feasibility_jump, lin_max)
  • Improve cut management
  • New objective_shaving_search worker dedicated to improving the lower bound of the objective (when minimizing)
  • Typing annotations for the python cp_model.py
  • Experimental partial support for pandas in cp_model.py
  • Experimental local search violation based workers:
    • enabled with parameters: num_violation_ls:xxx
    • optimized for linear model (linear, bool_or, bool_and, at_most_one, exactly_one)
    • works correctly with lin_max, product, division
    • supports no_overlap, cumulative, circuit, routes
    • disabled with no_overlap_2d
    • recommended number of ls workers: num_workers -> num_violation_ls: (8, 1), (16, 2) (24, 3), (32, 4)

GitHub Changelog

March 2023

Announcing the release of OR-Tools v9.6

We have released OR-Tools v9.6. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Add Fedora 37, 38 support.
  • Drop Python 3.6 (not supported by protobuf).
  • Drop Python 3.7 on macOS (not supported by scipy).
  • Add net7.0 support in CMake (use -DUSE_DOTNET_7=ON)
  • Drop netcore3.1 in nuget .org packages

Dependencies

  • SCIP v801 -> v803 (note: now SCIP use an OSI compatible license)
  • abseil 20220623.1 -> 20230105.0
  • Protobuf v21.5 -> v21.12
  • SWIG 4.1.1
  • Java JNA 5.11.0 -> 5.12.1

Bazel

  • Add pybind11 support.
  • Add java wrapper support.

Solvers

  • PDLP: dd python wrapper.
  • CP-SAT: Performance improvements.
  • GLOP: Tweak presolve.
  • ModelBuilder: Python: Improve numpy support.
  • Routing: Performance improvements (local search)

Known Issues:

  • CP-SAT: Ignoring pseudo_costs subsolver returns Invalid parameters (see #3706).

November 2022

Announcing the release of OR-Tools v9.5

We have released OR-Tools v9.5. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Add Debian Sid support.
  • Add Fedora 35, 36 support.
  • Add Ubuntu 22.10 support.
  • Drop Python 3.6 on macOS.
  • Add Python 3.11 support.

Dependencies Update

  • Protobuf v19.4 -> v21.5.
  • SCIP Solver v800 -> v801.

CP-SAT

  • Presolve improvements: max(array), Boolean constraints, linear constraints.
  • Interleaved search should be deterministic in parallel.
  • Linear cuts: cleanup square and int_prod cuts; rewrite cut pipeline.
  • Fingerprint input model and solution (visible in the log).
  • Scheduling improvements.
  • The usual bunch of bugfixes (crash during presolve, crash in cuts, infeasible solutions, model infeasible in LNS).

GLOP

  • Speedup by rewriting the linear algebra, as well as the pivot selection rule.

Linear Solver

  • Add knapsack_interface.cc.
  • Move model_builder API under the linear_solver directory (headers and samples).
  • Add support for Gurobi 10.

Routing

  • Liberate few parser for various routing challenge.

August 2022

Announcing the release of OR-Tools v9.4

We have released OR-Tools v9.4. To update your version, see the appropriate section of OR-Tools Installation.

Platforms

  • Add Debian-10 support (see #3029).
  • Add Ubuntu 22.04 LTS support (see #3276). note: won't have .Net 3.1 support (see dotnet/core#7038).
  • Remove Ubuntu 21.10 support.

Misc

  • Split archive by languages and add CMake config to the C++ one (#3200).

Graph

Split ortools.graph.pywrapgraph into:

  • ortools.graph.python.linear_sum_assignment.
  • ortools.graph.python.max_flow.
  • ortools.graph.python.min_cost_flow.

This allows using numpy to speed up the setup of the problems.

CP-SAT

Some improvement on:

  • scheduling (propagation, cuts, lower bounds).
  • MaxSAT (presolve, core based heuristics).
  • MIP performance (presolve, cuts).

March 2022

Announcing the release of OR-Tools v9.3

We have released OR-Tools v9.3. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Drop Debian-10 support.
  • Drop Ubuntu-16.04 support.
  • Drop .NET Framework 4.5.2.

Dependencies Update

  • Add Eigen 3.4.0.
  • Add Google re2 2021-11-01.
  • Protobuf 3.19.1 -> 3.19.4.
  • SCIP 7.0.1 -> v800.

Python

  • Add pybind11.

Features

  • Add PDLP as experimental.
  • Add MathOpt as experimental.

CP-SAT

  • Renamed few API for consistency e.g. LinearExpr.ScalProd. -> LinearExpr.WeightedSum..
  • Add AddAtLeastOne/AddAtMostOne/AddExactlyOne methods.
  • Add AddMultiplicationConstraint(z, x, y) in all languages.
  • Add AddMultipleCircuit() in all languages.

C++

  • Explicit ctor IntVar(BoolVar).
  • Removed LinearExpr::Add* and replaced them by operator e.g. LinearExpr +=.
  • Add arithmetic operators on linear expression.
  • Removed LinearExpr::BooleanSum/BooleanScalProd, use Sum/WeightedSum.
  • Add CpModelBuilder::FixVariable() which overwrite the domain of the variable to a single value.

Java

  • Rewrite LinearExpr, add a incremental builder class: LinearExpr.newBuilder().add(x).addSum(<array of variables>).build().
  • Follow C++ API: Circuit, MultipleCircuit, Cumulative, Reservoir, AllowedAssignment and ForbiddenAssignment now return a specialized class with incremental API to add new variables, terms, demands…

C

  • Document all methods.
  • Follow C++ API: Circuit, MultipleCircuit, Cumulative, Reservoir, AllowedAssignment and ForbiddenAssignment now return a specialized class with incremental API to add new variables, terms, demands…
  • Add LinearExprBuilder class to build expressions incrementally.

Build System

CMake

  • Require at least CMake >= 3.18.

Make

  • Now use the CMake based build internally.

December 2021

Announcing the release of OR-Tools v9.2

We have released OR-Tools v9.2. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Add support for Ubuntu 21:10 (last rolling release).

Dependencies Update

  • .Net TFM update net5.0 -> net6.0 (need .Net SDK 6.0 LTS and .Net SDK 3.1 LTS).
  • abseil-cpp 20210324.2 -> 20211102.0.
  • Protobuf 3.18.0 -> 3.19.1.
  • Googletest 1.10.0 -> 1.11.0.
  • Python: add numpy >= 1.13.3.
  • On MacOS compile Coin-OR in -O1 to avoid crash in runners.

Routing

  • Improvement on filters.
  • Improve first solution heuristics.
  • Improve time break placements.

CP-SAT

Breaking changes

  • The underlying protocol buffer is incompatible with previous versions. Any stored protocol buffer will have to be re-generated with the updated builder APIs (in C++, Python, Java, and .NET)
  • In particular, the interval protobuf was clean as we removed the old fields ( start, size, and end) and renamed the new ones (using _view) to use the name of the removed fields.

New features

  • The all_different, reservoir, modulo, multiplication and division constraints accept affine expressions (a * var + b) everywhere it required integer variables.
  • The objective accepts floating point coefficients (See the DoubleLinearExpr class in C++/Java/.NET. See the knapsack_2d_sat.py example in Python).
  • The no_overlap_2d constraint supports optional intervals.
  • The C++ API implements + and * operators to build expressions.

Improvements

  • Improved presolve code.
  • Tighter model checker.
  • Rework reservoir constraint.
  • Add energetic cuts for the no_overlap_2d constraint.
  • Improved linear relaxation of encoding constraints (literal implies var == value).

Deprecated and removed methods

  • Deprecated C++ BooleanSum and BooleanScalProd. Just use Sum and ScalProd.
  • Removed C++ AddLinMinEquality and AddLinMaxEquality. Just use AddMinEquality and AddMaxEquality.

Future incompatibilities

  • At some point in the future, we will rewrite the Java modelling layer to be closer to the C++ layer.
  • In the C++ modelling layer, we will make the IntVar(BoolVar var) ctor explicit.
  • We are contemplating making the python API PEP 8 compliant (using snake_case names). If this happen, we will provide a sed file to port the code.

Build System

Bazel

  • Fix Windows build.

CMake

  • Add FETCH_PYTHON_DEPS option (default ON).
  • Add optional support for GPLK solver (default -DUSE_GLPK=OFF).

Python

  • Support numpy integers in most of the CP-SAT API.
  • Fix missing __version__.

September 2021

Announcing the release of OR-Tools v9.1

We have released OR-Tools v9.1. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Python: use manylinux2014 image (see PEP 599).
  • Python: add support for aarch64 linux using manylinux2014_aarch64 image.
  • .Net: add .Net 5.0 support.

Dependencies Update

  • abseil-cpp 20210324.1 -> 20210324.2.
  • Protobuf 3.15.8 -> 3.18.0.
  • SCIP 7.0.1 -> master.
  • Googletest 1.8.0 -> 1.10.0.
  • python: use of warning in cp_model.py (see #2530).
  • python: absl-py 0.11 -> 0.13.

CMake

  • Bump minimum version required 3.14 -> 3.15 (see #2528).
  • Python: bump minimum required version 3.14 -> 3.18 (see #2774).

Make

Make based build is deprecated, please migrate to CMake or Bazel to build from source.

Java

  • Improve robustness of the native library loader (see #2742).
  • Fix JVM Garbage Collector crash when routing model or the constraint solver were disposed (see #2091) (see #2466).
  • Fix CP-SAT logging callback crash when using multiple workers (see #2775).

CP-SAT

  • Improve robustness of the LNS code (see #2525).
  • Improve scheduling code: new factory methods to create fixed size intervals, new search heuristics, improved presolve and new linear cuts.
  • Improve routing code: new dedicated LNS.
  • Improve model checker. It is now more pedantic, especially w.r.t. potential overflows.
  • Improve MIP code: better presolve and multiple improvements to the linear relaxation of MIP and CP models.
  • Improve search diversity. When using more than 12 workers, add workers dedicated to improving the lower bound of the objective.
  • Change to the parallelism code: by default, the solver will now use all available cores. Use the num_search_parameters to specify the level of parallelism.
  • Deprecate SearchAllSolutions and SolveWithSolutionCallback.
  • Python API: more pedantic checks when using var == ... or var != ... outside a model.Add() call.

April 2021

Announcing the release of OR-Tools v9.0

We have released OR-Tools v9.0. To update your version, see the appropriate section of OR-Tools Installation.

Dependency updates

Java

Bug fixes

  • Improve multi-threading when using the CP-SAT solver (see #1588).
  • Fix Python wrapper support of std::vector&ltstd::string&gt (see #2453).
  • Rework CPLEX support (see #2470).

Known breaking change

  • Add logger access in Python, Java and .Net (see #2245).
  • Replacement of all custom Google type by the ones provided in cstdint.

CP-SAT

  • Methods SearchForAllSolutions(), SearchAllSolutions() and SolveWithSolutionCallback() are deprecated. Please use Solve() instead.
  • Improve Python standard operators support. This can break incorrect existing code.

March 2021

Announcing the release of OR-Tools v8.2

We have released OR-Tools v8.2. To update your version, see the appropriate section of OR-Tools Installation.

Dependency updates

Routing

  • Added RoutingModel.RegisterTransitMatrix() and RoutingModel.RegisterUnaryTransitVector().
  • Change return of RoutingModel.AddVectorDimension() and RoutingModel.AddMatrixDimension() to std::pair&ltint, bool&gt whose int is the transit evaluator id.

December 2020

Announcing the release of OR-Tools v8.1

We have released OR-Tools v8.1. To update your version, see the appropriate section of OR-Tools Installation.

Dependency updates

  • Abseil-cpp 20200923 updated to 20200923.2 LTS.
  • Protobuf 3.13.0 updated to 3.14.
  • Add support for Gurobi 9.1.0
  • Drop GLog dependency (replaced by a custom implementation depending on abseil-cpp flags)
  • Drop GFlag dependency (replaced by abseil-cpp flags component)

Bug fixes

  • Fix double counting of Gurobi floating license (see #2227).
  • Fix windows build (see #2200).

October 2020

Announcing the release of OR-Tools v8.0

We have released OR-Tools v8.0. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Added support for Python 3.9 (#2187)
  • Dropped support for Python 3.5 (#2186) <!-- Waiting Microsoft dotnet-sdk support, could be generated after the release is out...
    • Added support for Ubuntu 20.10 (#2188) -->
  • Dropped support for Ubuntu 16.04 LTS (#2188)
  • Dropped support for Ubuntu 19.10 (#2188)

Dependency updates

Known breaking change

  • Now, Routing and CP-SAT source code use some C++17 features. Warning: If you provide your own version of abseil-cpp please verify it is built against C++17 too.
  • The MPSolver::CreateSolver signature has been changed. The model name argument has been dropped.

CMake

  • Fix disabling SCIP support when using -DUSE_SCIP=OFF (see #2129).
  • Integrate samples and examples to the CMake build system. note: can be disable by using -DBUILD_SAMPLES=OFF and -DBUILD_EXAMPLES=OFF. note: can be disable for a specific language using -DBUILD_<LANG>_SAMPLES=OFF or -DBUILD_<LANG>_EXAMPLES=OFF.
    • With <LANG> among:
    • CXX,
    • PYTHON,
    • JAVA and
    • DOTNET.

Make

  • Require Make >= 4.3 (use of Make eval function).
  • Require CMake >= 3.14 (use of CMake --verbose option).
  • Add option to disable SCIP support using -DUSE_SCIP=OFF (see #2134).
  • Add option to disable CLP and CBC support using -DUSE_COINOR=OFF.

Java

  • OR-Tools now generate maven packages (see #202).

Bug fixes

  • Fix C++ and Python build on FreeBSD (see #2126).
  • Fix build in debug on windows (see #2077).
  • Fix long standing crash in parallel on CP-SAT on Windows (see #2001, #2019).

July 2020

Announcing the release of OR-Tools v7.8

We have released OR-Tools v7.8. To update your version, see the appropriate section of OR-Tools Installation.

Dependency updates

  • Gurobi 9.0.2 is now pre-integrated in prebuilt binaries. It will search for the gurobi 90 shared library in the default install path of the Gurobi installers on MAC OS X and Windows, or in the GUROBI_HOME directory.
  • SCIP 7.0.1 is now integrated in prebuilt binaries. Please ensure compliance with the SCIP license before using it.
  • Added support for optional Xpress Solver 8.9.0.

Linear Solver

  • Added a static LinearSolver::CreateSolver() method to simplify checking support for integrated linear solver backends. It works in all languages.

Bug fixes

  • Fixed CMake based build on FreeBSD.
  • Fixed CP-SAT sorting in cumulative cut generation.
  • Fixed linear solver memory leak in .Net wrapper.

June 2020

Announcing the release of OR-Tools v7.7

We have released OR-Tools v7.7. To update your version, see the appropriate section of OR-Tools Installation.

Dependency updates

  • Abseil-cpp b832dce updated to c51510d (LTS 20200225.2).
  • Protobuf 3.11.4 updated to 3.12.2.

New features and improvements

  • The CP-SAT solver now returns Optimal instead of Feasible in a satisfiability model (i.e. without objective).
  • Added the feasibility pump heuristic from the MIP community.

Bug fixes

Fixed CP-SAT Multi-threading crash (see #2005).

April 2020

Announcing the release of OR-Tools v7.6

We have released OR-Tools v7.6. To update your version, see the appropriate section of OR-Tools Installation.

CP-SAT new features

We have added the following new features to the CP-SAT solver:

  • Improved management of cutting planes for LPs.
  • Debugging tools.

Dependency updates

Abseil-cpp 8ba96a8 updated to b832dce (LTS 20200225).

Bug fixes

  • Fixed CP-SAT UNSAT bug in presolve (see #1908).
  • Fixed swigwin.exe url.
  • Fixed SWIG typemap management for Java and .Net.

January 2020

Announcing the release of OR-Tools v7.5

We have released OR-Tools v7.5. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • Added support for Python 3.8 (#1719)
  • Dropped support compilation from sources on Visual Studio 2017 (#1852).
  • Updated support from Centos 7 to Centos 8 (#1827).

Dependency update

Bug fixes

The following issues have been fixed in OR-Tools v7.5 (For a complete list see Milestone v7.5).

In particular:

  • Fixed Assembly loading. See #1421.
  • Exposed the GetStartIndex() and GetEndIndex() methods of RouteIndexManager (#1843).
  • Fixed SWIG to remove broken methods (#1838, #1276).

October 2019

Announcing the release of OR-Tools v7.4

We have released OR-Tools v7.4. To update your version, see the appropriate section of OR-Tools Installation.

New features and improvements

  • The CP-SAT solver now checks for constraints that do not support enforcement literals. The model checker will return an error before solving if such a constraint has an enforcement literal.
  • Better and faster local search for the routing library.
  • The linear solver now supports the third-party software Xpress-MP. You will need to rebuild OR-Tools from source to use it.
  • The architecture of the NuGet package has been completely rewritten. In particular, it now supports the .NET framework >= 4.5.2 on Windows platforms.

Deprecated platform

As announced in the July 2019 release notes, OR-Tools no longer supports Python 2.7.

Dependency update

Protobuf 3.9.0 has been updated to 3.10.0.

August 2019

Announcing the release of OR-Tools v7.3

We have released OR-Tools v7.3. To update your version, see the appropriate section of OR-Tools Installation.

Deprecated platform

We're deprecating support for Python 2.7 to align with Google's move to Python 3. This will be the last release of OR-Tools supporting Python 2.7.

Dependency update

Protobuf 3.8.0 has been updated to 3.9.0.

Bug fixes

The following issues have been fixed in OR-Tools v7.3. (For a complete list see Kanban v7.3).

In particular:

  • Fixed init/int64 cast issue on Java (#1448),
  • Fixed presolve check when processing empty cumulative constraints.

July 2019

Announcing the release of OR-Tools v7.2

We have released OR-Tools v7.2. To update your version, see the appropriate section of OR-Tools Installation.

Platform changes

  • We're deprecating support for Python 2.7 to align with Google's move to Python 3. There will be at most one more release of OR-Tools supporting Python 2.7.
  • Ubuntu 18.10 updated to Ubuntu 19.04.
  • Added support for compilation from sources on Visual Studio 2019.
  • Python 3.5 is no longer supported on Windows; please use Python 3.6 or higher.

Updates to dependencies

  • We now target CBC 2.10.3.
  • We now target Protobuf 3.8.0.

CP-SAT

  • We have made multiple improvements to search, parallelism, and the linear relaxation.
  • Added LinearExpr.Sum() and LinearExpr.ScalProd() APIs in Python.
  • Deprecated IntVar[].Sum() and IntVar[].ScalProd() APIs in C#.
  • C++: Removed SolveWithModel() as it was a duplicate of SolveCpModel().
  • Added CpModel.addGreaterThan() and CpModel.addLessThan() methods to the Java API.

Linear solver

  • Added MPSolver.SetHint() for Python, Java, and C# (supported by SCIP and Gurobi).
  • Added MPSolver.SetNumThreads() for Python, Java, and C# (supported by CBC, Gurobi, and SCIP).
  • Rewrote support for SCIP 6.0.1.

Reference documentation

  • We have added doxygen and pdoc3 based reference manuals for all languages and all tools (algorithms, routing, graph, linear_solver, and CP-SAT). See OR-Tools Reference Manuals.
  • Reference documentation is complete for C++ (all products) and CP-SAT (C++, Python, Java).
  • We are in the process of exporting all C++ documentation to Python and Java.
  • .NET documentation is lacking, and we have no solution in the foreseeable future to improve this. We have kept it as it still shows the available API.

May 2019

Announcing the release of OR-Tools v7.1

We have released OR-Tools v7.1. To update your version, see the appropriate section of OR-Tools Installation.

Changes to required dependencies

OR-Tools v7.1 has the following new and updated dependencies:

  • glog v0.3.5 updated to v0.4.0
  • protobuf v3.6.1 updated to v3.7.1
  • Cbc 2.9.9 updated to 2.10.1
  • Cgl 0.59.10 updated to 0.60.1
  • Clp 1.16.11 updated to 1.77.1
  • Osi 0.107.9 updated to 0.108.1
  • CoinUtils 2.10.14 updated to 2.11.1

CP-SAT API changes

The following sections describe changes to the CP-SAT API in OR-Tools 7.1.

Using Domain to create variables

The following examples show how to create an integer variable with non-contiguous domains. This replace the removed method NewEnumeratedIntVar(). Here, the variable x can be any of 1, 3, 4, or 6:

Python

model.NewIntVarFromDomain(cp_model.Domain.FromValues([1, 3, 4, 6]), 'x')

C++

model.NewIntVar(Domain::FromValues({1, 3, 4, 6}));

Java

model.newIntVarFromDomain(Domain.fromValues(new long[] {1, 3, 4, 6}), "x");

C#

model.NewIntVarFromDomain(Domain.FromValues(new long[] {1, 3, 4, 6}), "x");

Variables can also be created using a list of intervals. Below, the variable x is constrained to be 1, 2, 4, 5, or 6:

Python

model.NewIntVarFromDomain(cp_model.Domain.FromIntervals([[1, 2], [4, 6]]), 'x')

C++

model.NewIntVar(Domain::FromIntervals({ {1, 2}, {4, 6} }));

Java

model.newIntVarFromDomain(Domain.fromIntervals(new long[][] { {1, 2}, {4, 6} }), "x");

C#

model.NewIntVarFromDomain(Domain.FromIntervals(new long[][] { new long[] {1, 2}, new long[] {4, 6} }), "x");

Using Domain in linear expression

The following examples show how to limit a linear expression on a non-contiguous domain. Here, the linear expression linear_expr is defined on 5, 6, 8, 9 and 10:

Python

model.AddLinearExpressionInDomain(linear_expr, cp_model.Domain.FromIntervals([(5, 6), (8, 10)]))

C++

model.AddLinearConstraint(linear_expr, Domain::FromIntervals({ {5, 6}, {8, 10} }))

Java

model.addLinearExpressionInDomain(linear_expr, Domain.fromIntervals(new long[][] { {5, 6}, {8, 10} }))

.Net

model.AddLinearExpressionInDomain(linear_expr, Domain.FromIntervals(new long[][] {new long[] {5, 6}, new long[] {8, 10} }));

Using linear expression helpers

The following examples show how to use helper methods to create sums and scalar products. Here, an examples where we want x + y == 20 and 4 * x + 2 * y = 56:\

Python

model.Add(x + y == 20)
model.Add(4 * x + 2 * y == 56)

C++

cp_model.AddEquality(LinearExpr::Sum({x, y}), 20);
cp_model.AddEquality(LinearExpr::ScalProd({x, y}, {4, 2}), 56);

Java

model.addEquality(LinearExpr.sum(new IntVar[] {x, y}), 20);
model.addEquality(LinearExpr.scalProd(new IntVar[] {x, y}, new long[] {4, 2}), 56);

.Net

model.Add(x + y == 20);
model.Add(4 * x + 2 * y == 56);

March 2019

Announcing the release of OR-Tools v7.0

We have released OR-Tools v7.0. To update your version, see the appropriate section of OR-Tools Installation.

Changes to supported platforms

OR-Tools v7.0 no longer supports the following platforms:

  • Visual C++ 2015
  • Ubuntu 14.04
  • Python 3.4 on Linux

If you are using one of these platforms, you can still install OR-Tools v6.10.

Changes to required dependencies

OR-Tools v7.0 has the following new and updated dependencies:

The following sections describe the new features and improvements in OR-Tools 7.0.

New index manager for routing programs

In OR-Tools v7.0, vehicle routing programs must use the new RoutingIndexManager. This ensures that the standard indices for locations are consistent with the internal indices used by the solver, and helps prevent errors in your code.

The new RoutingIndexManager requires some minor changes to routing programs, which are described in the following sections:

Include/import RoutingIndexManager

In OR-Tools 7.0, routing programs in C++ and Java must include or import the RoutingIndexManager as shown in the examples below:

C++

#include "ortools/constraint_solver/routing_index_manager.h"

Java

import com.google.ortools.constraintsolver.RoutingIndexManager;

Python and C# imports are unchanged.

Declare RoutingIndexManager

In OR-Tools v7.0, routing programs must declare the RoutingIndexManager and create the routing model, as shown in the following examples:

Python

manager = pywrapcp.RoutingIndexManager(num_locations, num_vehicles, depot)
routing = pywrapcp.RoutingModel(manager)

C++

RoutingIndexManager manager(num_locations, num_vehicles, depot);
RoutingModel routing(manager);

Java

RoutingIndexManager manager = new RoutingIndexManager(numLocations, numVehicles, depot);
RoutingModel routing = new RoutingModel(manager);

.Net

RoutingIndexManager manager = new RoutingIndexManager(numLocations, numVehicles, depot);
RoutingModel routing = new RoutingModel(manager);

The arguments for RoutingIndexManager are:

  • The number of locations
  • The number of vehicles
  • The index of the depot (start and end location for all vehicles)

Callbacks

In OR-Tools v7.0, you need to use the RoutingIndexManager to create callbacks, such as the distance callback, which you then pass to the solver. The following examples show how to create a distance callback.

Python

    def distance_callback(from_index, to_index):
        """Returns the distance between the two nodes."""
        # Convert from routing variable Index to distance matrix NodeIndex.
        from_node = manager.IndexToNode(from_index)
        to_node = manager.IndexToNode(to_index)
        return data["distance_matrix"][from_node][to_node]

    transit_callback_index = routing.RegisterTransitCallback(distance_callback)
    routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index)

C++

  const int transit_callback_index = routing.RegisterTransitCallback(
      [&data, &manager](const int64_t from_index,
                        const int64_t to_index) -> int64_t {
        // Convert from routing variable Index to distance matrix NodeIndex.
        const int from_node = manager.IndexToNode(from_index).value();
        const int to_node = manager.IndexToNode(to_index).value();
        return data.distance_matrix[from_node][to_node];
      });
  routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index);

Java

    final int transitCallbackIndex =
        routing.registerTransitCallback((long fromIndex, long toIndex) -> {
          // Convert from routing variable Index to user NodeIndex.
          int fromNode = manager.indexToNode(fromIndex);
          int toNode = manager.indexToNode(toIndex);
          return data.distanceMatrix[fromNode][toNode];
        });
    routing.setArcCostEvaluatorOfAllVehicles(transitCallbackIndex);

.Net

        int transitCallbackIndex = routing.RegisterTransitCallback((long fromIndex, long toIndex) =>
                                                                   {
                                                                       // Convert from routing variable Index to
                                                                       // distance matrix NodeIndex.
                                                                       var fromNode = manager.IndexToNode(fromIndex);
                                                                       var toNode = manager.IndexToNode(toIndex);
                                                                       return data.DistanceMatrix[fromNode, toNode];
                                                                   });
        routing.SetArcCostEvaluatorOfAllVehicles(transitCallbackIndex);

The method IndexToNode converts the internal location indices used by the solver to the standard indices for the distance matrix.

Instead of passing the callback directly to to solver, as in previous versions, in v7.0 you first create transit&nbsp;callback&nbsp;index, a reference to the callback, and pass that to the solver (in this case by SetArcCostEvaluatorOfAllVehicles).

Dimensions

The following examples show how to create a dimension for demands and capacities , which is used to solve the capacitated vehicle routing problem.

Python

    def demand_callback(from_index):
        """Returns the demand of the node."""
        # Convert from routing variable Index to demands NodeIndex.
        from_node = manager.IndexToNode(from_index)
        return data["demands"][from_node]

    demand_callback_index = routing.RegisterUnaryTransitCallback(demand_callback)
    routing.AddDimensionWithVehicleCapacity(
        demand_callback_index,
        0,  # null capacity slack
        data["vehicle_capacities"],  # vehicle maximum capacities
        True,  # start cumul to zero
        "Capacity",
    )

C++

  const int demand_callback_index = routing.RegisterUnaryTransitCallback(
      [&data, &manager](const int64_t from_index) -> int64_t {
        // Convert from routing variable Index to demand NodeIndex.
        const int from_node = manager.IndexToNode(from_index).value();
        return data.demands[from_node];
      });
  routing.AddDimensionWithVehicleCapacity(
      demand_callback_index,    // transit callback index
      int64_t{0},               // null capacity slack
      data.vehicle_capacities,  // vehicle maximum capacities
      true,                     // start cumul to zero
      "Capacity");

Java

    final int demandCallbackIndex = routing.registerUnaryTransitCallback((long fromIndex) -> {
      // Convert from routing variable Index to user NodeIndex.
      int fromNode = manager.indexToNode(fromIndex);
      return data.demands[fromNode];
    });
    routing.addDimensionWithVehicleCapacity(demandCallbackIndex, 0, // null capacity slack
        data.vehicleCapacities, // vehicle maximum capacities
        true, // start cumul to zero
        "Capacity");

.Net

        int demandCallbackIndex = routing.RegisterUnaryTransitCallback((long fromIndex) =>
                                                                       {
                                                                           // Convert from routing variable Index to
                                                                           // demand NodeIndex.
                                                                           var fromNode =
                                                                               manager.IndexToNode(fromIndex);
                                                                           return data.Demands[fromNode];
                                                                       });
        routing.AddDimensionWithVehicleCapacity(demandCallbackIndex, 0, // null capacity slack
                                                data.VehicleCapacities, // vehicle maximum capacities
                                                true,                   // start cumul to zero
                                                "Capacity");

Printing solutions

In OR-Tools v7.0, you must use the RoutingIndexManager to display the vehicle routes in a solution. The following examples show how to print solutions in all of the supported languages.

Python

def print_solution(manager, routing, solution):
    """Prints solution on console."""
    print(f"Objective: {solution.ObjectiveValue()}")
    index = routing.Start(0)
    plan_output = "Route for vehicle 0:\n"
    route_distance = 0
    while not routing.IsEnd(index):
        plan_output += f" {manager.IndexToNode(index)} ->"
        previous_index = index
        index = solution.Value(routing.NextVar(index))
        route_distance += routing.GetArcCostForVehicle(previous_index, index, 0)
    plan_output += f" {manager.IndexToNode(index)}\n"
    plan_output += f"Distance of the route: {route_distance}m\n"
    print(plan_output)

C++

//! @brief Print the solution
//! @param[in] manager Index manager used.
//! @param[in] routing Routing solver used.
//! @param[in] solution Solution found by the solver.
void PrintSolution(const RoutingIndexManager& manager,
                   const RoutingModel& routing, const Assignment& solution) {
  LOG(INFO) << "Objective: " << solution.ObjectiveValue();
  // Inspect solution.
  int64_t index = routing.Start(0);
  LOG(INFO) << "Route for Vehicle 0:";
  int64_t distance{0};
  std::stringstream route;
  while (!routing.IsEnd(index)) {
    route << manager.IndexToNode(index).value() << " -> ";
    const int64_t previous_index = index;
    index = solution.Value(routing.NextVar(index));
    distance += routing.GetArcCostForVehicle(previous_index, index, int64_t{0});
  }
  LOG(INFO) << route.str() << manager.IndexToNode(index).value();
  LOG(INFO) << "Distance of the route: " << distance << "m";
  LOG(INFO) << "";
  LOG(INFO) << "Advanced usage:";
  LOG(INFO) << "Problem solved in " << routing.solver()->wall_time() << "ms";
}

Java

  /// @brief Print the solution.
  static void printSolution(
      DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) {
    // Solution cost.
    logger.info("Objective : " + solution.objectiveValue());
    // Inspect solution.
    logger.info("Route for Vehicle 0:");
    long routeDistance = 0;
    String route = "";
    long index = routing.start(0);
    while (!routing.isEnd(index)) {
      route += manager.indexToNode(index) + " -> ";
      long previousIndex = index;
      index = solution.value(routing.nextVar(index));
      routeDistance += routing.getArcCostForVehicle(previousIndex, index, 0);
    }
    route += manager.indexToNode(routing.end(0));
    logger.info(route);
    logger.info("Distance of the route: " + routeDistance + "m");
  }

.Net

    /// <summary>
    ///   Print the solution.
    /// </summary>
    static void PrintSolution(in RoutingModel routing, in RoutingIndexManager manager, in Assignment solution)
    {
        Console.WriteLine("Objective: {0}", solution.ObjectiveValue());
        // Inspect solution.
        Console.WriteLine("Route for Vehicle 0:");
        long routeDistance = 0;
        var index = routing.Start(0);
        while (routing.IsEnd(index) == false)
        {
            Console.Write("{0} -> ", manager.IndexToNode((int)index));
            var previousIndex = index;
            index = solution.Value(routing.NextVar(index));
            routeDistance += routing.GetArcCostForVehicle(previousIndex, index, 0);
        }
        Console.WriteLine("{0}", manager.IndexToNode((int)index));
        Console.WriteLine("Distance of the route: {0}m", routeDistance);
    }

Support for VRPs with pickups and deliveries

OR-Tools v7.0 provides support for solving vehicle routing problems (VRPs) with pickups and deliveries, in which the goal is to find the shortest routes for a fleet of vehicles picking up and delivering items at various locations. You set up the problem similarly to a standard VRP, but in addition you specify a pair (i, j) of locations for each item, where i is the pickup location and j is the drop off location. The routing solver returns vehicle routes such that for each pair (i, j), i and j are on the same route, and the vehicle visits i before j.

For an example that solves this type of problem, see Vehicle Routing with Pickups and Deliveries.

Support for lambda functions

OR-Tools v7.0 now includes support for lambda functions in C# and Java (in addition to C++ and Python, which were already supported). Lambda functions provide a convenient way to define callbacks in routing programs. However, you can define callbacks using standard functions if you feel that makes your code more readable.

The C# and Java callback examples above illustrate how to define callbacks using lambda functions.

November 2018

Announcing the release of version v6.10

We have released OR-Tools version 6.10. To update your version, see the appropriate section of OR-Tools Installation.

The following sections describe the new features and improvements in version 6.10.

Simplified commands for building and running programs

In version 6.10, you can build and run programs by entering commands like the following:

make run SOURCE=relative/path/to/program.cc
where <var>relative/path/to</var> is the path to the directory containing the program.

To build a program without running it, enter:

make build SOURCE=relative/path/to/program.cc
See Get Started with OR-Tools for specific instructions for running programs by language.

Support for SCIP 6.0.0

OR-Tools now provides support for SCIP 6.0.0.

Binaries

Binary distributions have been built using Java JDK 8 (JDK 7 for Ubuntu 14.04).

CP-SAT Solver

Update the API

  • Add C++ CP-SAT CpModelBuilder API.

Examples

Some examples have been moved.

  • Move community examples to examples/contrib.
  • Move some examples to ortools/<var>component</var>/samples (e.g. ortools/linear_solver/samples/simple_program.java)

September 2018

Announcing release of version v6.9

We have released OR-Tools version 6.9. To update your version, see the appropriate section of OR-Tools Installation.

Updated dependencies

  • Protobuf 3.5.1 -> 3.6.1.
  • SCIP 4.0 -> 6.0.

CP-SAT Solver

  • Breaking changes to the API - full details here:
  • Rename SolveWithSolutionObserver to SolveWithSolutionCallback in Python.
  • Rename NewSolution to OnSolutionCallback in class CpSolverSolutionCallback in Python. The following example shows the new way to create a solution callback in Python.

    class MySolutionCallback(cp_model.CpSolverSolutionCallback):
    def init(self):
    cpmodel.CpSolverSolutionCallback.init(self)
    self._solution_count = 0

    def OnSolutionCallback(self): print('Solution {}, time = {}s, objective = {}, makespan = {}'.format( self.solution_count, self.WallTime(), self.ObjectiveValue(), self.Value(makespan))) self.solution_count += 1

  • Expose StopSearch on solution callback in Python, Java and C#. Documentation here.

  • Expose ModelStats and CpSolverResponseStats in Python, Java and C#.

  • Improve Python docstring documentation. Documentation here.

  • Updates to Java implementation of the solver interface and cookbook.

  • Implement modulo.

  • Change implementation of reservoir: add API with boolean to specify optional draining/filling events.

Linear Solver

  • Expose InterruptSolve in Java and C#.

CP Solver

  • Expose SolutionCollector director in C#.

Python

  • Add support for Python 3.7.
  • When compiling from source: prefer python3 over python2 when detecting python.

.NET

  • Complete rewrite of the .NET layer.
  • Provide a Google.OrTools NetStandard 2.0 Nuget package compatible with Runtime IDentifier win-x64, linux-x64 and osx-x64.
  • Provide a Google.OrTools.FSharp Nuget package.
  • Add project file for all .NET examples.
  • Update all F# script examples (.fsx) to regular F# project (.fs).
  • Add documentation on .NET package build generation here.

Flatzinc

  • Add support for sets in flatzinc (using nosets.mzn).

Contributions

  • Add support for Binder. Thanks to Kevin Mader.
  • Make DecisionVisitor a director type in Java bindings. Thanks to Jeremy Apthorp.

July 2018

Announcing release of version v6.8

We have released OR-Tools version 6.8. To update your version, see the appropriate section of OR-Tools Installation.

Announcing the CP-SAT solver

The CP-SAT solver is a new solver for constraint programming. The CP-SAT solver is faster than the original CP solver, and should be preferred for CP problems.

For examples that use the CP-SAT solver, look in the examples directory on GitHub for files that have _sat in their names.

The original CP solver will continue to be maintained for a period of time to support existing code, but it is deprecated.

New options for the CP-SAT solver

The following options for the CP-SAT solver are new in this release:

  • Local neighborhood search (LNS): Use the SatParameters.use_lns option to enable LNS.
  • Parallel search: Use the SatParameters.num_search_workers option to enable multiple threads during a search. Each thread can have different parameters, and different random seeds. This maximizes diversity, and the probability that at least one thread will find solutions.

Performance improvements to solvers

We have made performance improvements to the CP-SAT and Glop solvers.

March 2018

Announcing release of version v6.7

We have released OR-Tools version 6.7. To update your version, see the appropriate section of OR-Tools Installation.

Update to required dependencies

  • Protobuf 3.5.0 -> 3.5.1.

Misc

  • Refactor base to prepare abseil-cpp integration.
  • Use of Travis CI and Appveyor continuous integration (CI) services.

SAT

  • Performance improvement.
  • Improves Python API.
  • Add C# API aka CpSolver.cs (EXPERIMENTAL).

Glop

  • Code refactoring.
  • Performance improvement.

CMake Support (EXPERIMENTAL)

  • Add C++ OR-Tools CMake support.
  • Be able to build OR-Tools as a standalone CMake project.
  • Be able to incorporate OR-Tools into an Existing CMake project.
  • Add Python OR-Tools CMake-based build.
  • Generate Python package (wheel) using CMake.

Contributions

  • Fix winsock2.h redefinition on windows. Thanks to Florent Tollin de Rivarol.
  • Add F# Support (EXPERIMENTAL). Thanks to Matthew Moore. Note: only available with Makefile builder.
  • Add .NET Standard Support (EXPERIMENTAL). Thanks to Ziad El Malki. Note: only available with Makefile builder.

November 2017

Announcing release of version v6.6

We have released OR-Tools version 6.6. To update your version, see the appropriate section of OR-Tools Installation.

Updates to required dependencies

  • Protobuf to 3.3.0 -> 3.5.0.
  • gflags to 2.2.0 -> 2.2.1.
  • CBC 2.9.8 -> 2.9.9.
  • Add Python module six (1.10) as required dependency for Python.

Bug Fixes

  • Pull request #494 Name refactoring. Adding comments for IntelliSense in some editors. Thanks to Matthew Moore.
  • Pull request #516 Instruction for F# standalone binary. Thanks to Matthew Moore.
  • Improve precision in Glop.

SAT Solver

  • Improve internal SAT solver, Fix various bugs.
  • Add a VRP constraint to the SAT solver, linked to the LP solver.
  • Change the solution observer in the SAT solver to take a CpSolverResponse as a parameter.
  • Improve the use of Glop in SAT Solver.
  • Speedup SAT-LP connection.
  • Add Reservoir constraint to the SAT cp_model protobuf format.

SAT/Python

Examples

  • Rewrite rcpsp_parser to use ProtoBuf format to store the problem.
  • Improve RCPSP parser.

October 2017

Announcing release of version v6.5

We have released OR-Tools version 6.5. To update your version, see the appropriate section of OR-Tools Installation.

Change in platforms

  • The pypi module py3-ortools has been merged into the ortools module. There is now only one module: 'ortools'.
  • The main format for these Python modules is now wheel files. To install OR-Tools for python from pypi, just run pip install ortools. You need a recent version of pip installed (>= 9.0.1). This should pull the latest release (v6.5).

Bug fixed

The protobuf jar file now correctly builds with compiled classes.

New Examples

  • More F# examples have been contributed to the examples/fsharp directory (Thanks again to Matthew Moore).
  • Java MIP examples have also been contributed (Thanks Darian).

September 2017

Announcing release of version v6.4

We have released OR-Tools version 6.4. To update your version, see the appropriate section of OR-Tools Installation.

Change in platforms

  • Pypi modules on Linux platforms are now delivered as wheel files using the manylinux1 tag. Thanks to Federico Ficarelli. With this change, we have backtracked the per-linux modules introduced in the July 2017 release.

New features

  • Improved scaling method used inside GLOP.
  • Fix wrapping of evaluators in the C# routing library. Thanks to DevNamedZed.
  • Improve the performance of the flatzinc presolve for large models.
  • Use the SAT backed for flatzinc by default.
  • Improve performance of the Core based approach for the sat solver.
  • Fix bug in the linear assignment algorithm that was failing incorrectly.
  • Added F# examples in ortools/examples/fsharp.
  • Remove check for positive penalties in the routing library.

August 2017

Announcing release of version v6.3

We have released OR-Tools version 6.3. To update your version, see the appropriate section of OR-Tools Installation.

New download files

Python wheel files for Linux are now available to download in the OR-Tools release page, along with the latest versions of all downloads.

Minizinc solver

This version contains the final sat and flatzinc code sent for the Minizinc 2017 challenge.

July 2017

Announcing release of version v6.2

We have released OR-Tools version 6.2. To update your version, see the appropriate section of OR-Tools Installation.

Change in platforms

  • We now support multiple Linux binary distributions (Ubuntu 14.04, 16.04, 17.04, CentOS 7, Debian 9).
  • Pypi modules on Linux platforms now include a tag that describes the distribution (ubuntu-14.04, ubuntu-16.04, ubuntu-17.04, centos-7, debian-9).

New features

We have added support for Docker to build linux artifacts. Go to or-tools/tools/docker and look at the Makefile to see possible targets (make archive, make pypi, and make pypi3).

These commands will create an export subdirectory and add binary artifacts in it.

June 2017

Announcing release of version v6.1

We have released OR-Tools version 6.1. To update your version, see the appropriate section of OR-Tools Installation.

Change in platforms

  • Visual Studio 2017 is supported; Visual Studio 2013 is no longer supported.
  • macOS versions 10.9 and higher are supported.

New Features

We've added a new protobuf format for our CP-SAT solver. See ortools/sat/cp_model.proto to define your model, and ortools/sat/cp_model_solver.h to solve your problem.

Bug Fixes

Issue #420: We have fixed the missing __version__ attribute on Python pypi modules on all platforms.

May 2017

Announcing release of version v6.0

We have released OR-Tools version 6.0. To update your version, see the appropriate section of OR-Tools Installation.

New directory structure in C++

We have changed the source/include structure of OR-Tools when using C++. The goal is to provide better encapsulation of the C++ include files. It also has the benefit of aligning the C++ and the Python directory structures.

  • src/ has been renamed ortools/.
  • All #include commands in C++ files now have the prefix ortools added. #include "constraint/constraint_solver.h" is now #include "ortools/constraint/constraint_solver.h".

New features

  • Bazel support. You can now build OR-Tools with bazel, Google's build tool. It works on Linux and Mac OS X. After downloading Bazel version 0.4.5 or later, change directory to or-tools and build the examples: bazel build examples/cpp/....

Routing

We have implemented support for breaks (e.g., vehicle downtime due to drivers eating lunch) in the routing library. This feature is shown in the cvrptw_with_breaks.cc example.

SCIP support

The linear solver wrapper now supports SCIP 4.0. You now need to build SCIP first, and then tell or-tools that you will use it. Instructions are available here.

GLPK support

We have also changed the way with build with GLPK. See here.

Cleanups

  • We have removed all usage of hash_map and hash_set in the C++ codebase as they are deprecated. They were replaced by unordered_map and unordered_set from the STL.
  • Cleanup of the C# makefiles, courtesy of Michael Powell.

January 2017

Announcing release of version v5.1

We have released OR-Tools version 5.1. To update your version, see the appropriate section of OR-Tools Installation.

New Features

Installing

Routing

Implemented an algorithm to compute the Held-Karp lower bound for symmetric Traveling Salesperson Problems. This enables you to compute an upper bound to the gap between the cost of a potentially non-optimal solution and the cost of the optimal solution.

Scheduling

Sat solver

Performance improvements

  • SAT solver — Improved performance of the Sat solver, particularly for the cumulative constraint.
  • Glop solver — Improved numerical robustness of the Glop solver, which now returns even more accurate solutions to hard numerical problems.
  • Flatzinc solver
  • Greatly improved performance of the Sat backend for the flatzinc interpreter.
  • Simplified the C# flatzinc interface. For an example of the new interface, see https://github.com/google/or-tools/blob/master/examples/csharp/csfz.cs.

Bug Fixes

  • Using the PathCheapestArc heuristic on routing models with a single vehicle and side constraints would sometimes cause the solver to run for an excessively long time. This was fixed by properly taking into account side-constraints.
  • In Java, the routing solver would sometimes crash when solving vehicle routing problems. This has been fixed in the latest release.

November 2016

Announcing release of version v5.0

We have released OR-Tools version 5.0. To update your version, see the appropriate section of OR-Tools Installation.

Running examples

  • Introduced language-specific targets that make it easier to compile and run your programs, as well as the examples that come with OR-Tools.

Sat

FlatZinc

Constraint Solver

Routing

  • Implemented AddAtSolutionCallback, which is a callback called each time a solution is found during the search.
  • Removed the RoutingModel depot-less constructors. Specifying at least one depot in the routing model is now mandatory.

September 2016

Announcing release of version v4.4

We have released OR-Tools version 4.4. To update your version, see the appropriate section of OR-Tools Installation.

Sat

  • Extended scheduling API and modified examples (weighted_tardiness_sat, and jobshop_sat) to use it.

Graph

  • Added iterator traits to Graph classes.

OR-Tools distribution

  • Nuget package is supported again.

August 2016

Announcing release of version v4.3

We have released OR-Tools version 4.3. To update your version, see the appropriate section of OR-Tools Installation.

Constraint solver

  • Implemented NotBetween method to constrain a variable to be outside a given interval.

routing

  • Added a parse of the model to check existing NotMember constraints as shown in this example, and use them in local search filters.
  • Added local search profiling.
  • Fix for local moves.

Linear solver

  • Fixed SCIP status reporting.

Sat

Glop

  • Improved performance by exploiting sparsity in more stages of computation.

Flatzinc

  • Fixed bugs found by minizinc challenge.

Lp_data

  • Continued simplification of templates in iterators.

OR-Tools distribution

  • C# assemblies are now strongly named by default.
  • Upgraded to Protobuf3.0.0.
  • Added a Python script to check OR-Tools archive dependencies.

July 2016

Announcing release of version v4.2

We have released OR-Tools version 4.2. To update your version, see the appropriate section of OR-Tools Installation.

Constraint solver (routing)

  • A disjunction can now be defined with a cardinality, which is the maximum number of nodes that can be active within this disjunction. For example, if you add a disjunction with n nodes and a cardinality of k, then k nodes among the n nodes are allowed to be active. You can use the new definition of AddDisjunction to do this.
  • Added support for multiple disjunctions per node. For example, you can now add a node, N1, to many disjunctions (D1..Dm). This increases its chance of being active within any one of them. Introduced a faster routing search algorithm for problems related to disjunct time windows.
  • Added constraint solver parameters to routing model parameters and log_search to routing search parameters.
  • Local search algorithm is faster with resolving problems with disjoint time windows. Check cvrp_disjoint_tw.cc example for more details.

Glop (linear optimization)

  • Introduced a faster Simplex Algorithm.

OR-Tools distribution

  • One archive per platform, rather than individual archives for each of C++, Java, and .Net. Python archives are still hosted on pypi.
  • On pypi, we have switched to wheel (.whl) modules on Mac OS X and Windows. Introduced a MAJOR.MINOR numbering schema. These numbers are used the archive names, the version stored in Mac OS X shared libraries, Python modules, .NET assemblies. The first version we are releasing is with this schema is v4.2

June 2016

Announcing release of version v2016-06

We have released OR-Tools version v2016-06. To update your version, see the appropriate section of OR-Tools Installation.

Constraint Solver

  • Removed most of the instances of the callbacks (src/base/callback.h) from the CP library.
  • Added NotMemberCt (the variable cannot belong to a set of intervals).

Routing library

  • INCOMPATIBLE CHANGE: To specify the capacity of vehicles in AddDimensionWithVehicleCapacity, you now need to pass an array (a vector in c++) instead of a callback.

GLOP

  • Change internal representation of sparse matrix.
  • Performance improvements.

Graph

  • Rewrite Dijkstra and Bellman-Ford algorithms to replace callbacks by std::function (C++).
  • Change API of different graph implementation when iterating over arcs and nodes.

Sat

  • Remove unused core method (Resolution nodes).
  • Added drat writer to check proofs on unsatisfiability.
  • Add preprocessor.

Bop

  • Add new neighborhoods.

Examples

  • c++: getting rid of filelinereader in examples.
  • data: Add single-machine scheduling problems.

Documentation

April 2016

Announcing release of version v2016-04

We have released OR-Tools version v2016-04. To update your version, see the appropriate section of OR-Tools Installation.

Updated dependencies

December 2015

Announcing release of version v2015-12

We have released OR-Tools version v2015-12. To update your version, see the appropriate section of OR-Tools Installation.

Constraint Solver

  • Broke compatibility on the Large Neighborhood Search in the CP solver (see examples/cpp/ls_api.cc, examples/python/pyls_api.py, examples/csharp/csls_api.cs, and examples/com/google/ortools/sample/LsApi.java to see the new API).
  • Cleaned up the Python wrapping. Support custom decision in the CP solver (see examples/test/test_cp_api.py to see the API in action).
  • Various improvements and bug fixes.

September 2015

Announcing first release on github.

Files will be stored there from now on.

Flatzinc

  • Added binary archives for the flatzinc interpreter (see www.minizinc.org).
  • Contains a few fixes to the version used in the challenge.