OR-Tools Examples

The following table provides links to:

  • Code examples in the supported languages:   C++     Python     DotNet     Java
  • Tutorials that explain the examples.  
  • Colabs—code demos that you can run directly in your browser.  
Solver Description Tutorials and colabs Code examples
Routing Simple TSP example
Routing TSP with distance matrix
Routing TSP with 2D locations
Routing Simple Vehicle Routing Problem example
Routing Vehicle Routing Problem with capacity constraints
Routing Vehicle Routing Problem with pickup & delivery constraints
Routing Vehicle Routing Problem with time window constraints
Linear programming Linear programming hello world
Linear programming Simple linear program
Linear programming Integer programming hello world
Linear programming Simple MIP program
Constraint programming Constraint programming hello world
Constraint programming Simple CP program