gitwtfhub

wtf is or-tools?

google/or-tools — explained in plain English

Analysis updated 2026-06-24

13,476C++Audience · developerComplexity · 4/5LicenseSetup · moderate

TL;DR

OR-Tools is Google's free open-source toolkit for solving hard scheduling, routing, and assignment problems by finding the best possible arrangement from millions of options. Available in Python, Java, C#, and C++.

Mindmap

mindmap
  root((repo))
    What it does
      Optimization solver
      Scheduling problems
      Routing problems
    Solver Types
      Constraint programming
      Linear programming
      Traveling salesman
      Bin packing
    Languages
      Python
      Java
      C#
      C++
    Audience
      Developers
      Researchers
      Operations teams
    Resources
      Developer guide
      Jupyter tutorials
      Code examples

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Solve a nurse or employee scheduling problem where shifts must be assigned fairly while respecting availability constraints.

REASON 2

Optimize delivery vehicle routes across dozens of locations to minimize total driving distance.

REASON 3

Solve a bin-packing problem to fit products into the fewest possible shipping containers.

REASON 4

Find the shortest path through a large logistics network using the built-in graph algorithms.

What's in the stack?

C++PythonJavaC#

How it stacks up

google/or-toolsgoogle-deepmind/mujocofacebook/watchman
Stars13,47613,46413,578
LanguageC++C++C++
Setup difficultymoderatemoderatemoderate
Complexity4/54/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires understanding the problem domain, the math can be complex even though the API is straightforward.

Apache 2.0: use freely for any purpose, including commercial products, as long as you include the license and copyright notice.

Wtf does this do

OR-Tools is a free, open-source toolkit from Google for solving a specific class of math problems called combinatorial optimization. These are problems where you need to find the best possible arrangement or assignment from a large number of possibilities, such as scheduling shifts for a workforce, routing delivery vehicles across a city, or packing items into containers as efficiently as possible. The toolkit includes several specialized solvers, each designed for a different type of problem. There are constraint programming solvers that figure out what combinations satisfy a set of rules, linear programming solvers that optimize a goal while respecting numerical limits, and algorithms specifically built for classic problems like the Traveling Salesman Problem (finding the shortest route that visits many locations) and bin packing (fitting items into the fewest possible containers). It also covers graph problems like finding the shortest path between two points in a network. The core code is written in C++, which makes it fast, but the library can be used from Python, Java, and C# as well. This means developers on most popular platforms can plug it into their projects without rewriting anything. Installation packages are available through standard channels for each language. The project is well documented, with an official developer guide, worked examples in multiple languages, and Jupyter notebook tutorials. The examples directory covers C++, Java, Python, and .NET, so there are starting points for most teams regardless of their preferred language. This is a mature, production-grade tool used inside Google and published for general use under the Apache 2.0 open-source license.

Yoink these prompts

Prompt 1
I need to schedule 10 employees across 5 shifts per day for a week, with each employee working at most 5 days and no back-to-back closing and opening shifts. Write an OR-Tools constraint programming solution in Python.
Prompt 2
I have 20 delivery stops and one vehicle. Use OR-Tools to find the shortest route that visits all stops and returns to the start.
Prompt 3
Explain how the OR-Tools CP-SAT solver works in plain English, then show me a minimal Python example that solves a simple assignment problem.
Prompt 4
I installed OR-Tools in Python but get an import error. Walk me through verifying my install and running the first example from the documentation.

Frequently asked questions

wtf is or-tools?

OR-Tools is Google's free open-source toolkit for solving hard scheduling, routing, and assignment problems by finding the best possible arrangement from millions of options. Available in Python, Java, C#, and C++.

What language is or-tools written in?

Mainly C++. The stack also includes C++, Python, Java.

What license does or-tools use?

Apache 2.0: use freely for any purpose, including commercial products, as long as you include the license and copyright notice.

How hard is or-tools to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is or-tools for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.