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.  
Problem Solver Description Tutorials and colabs Code examples
Routing Routing solver Simple TSP example
Routing Routing solver TSP with distance matrix
Routing Routing solver TSP with 2D locations
Routing Routing solver Simple Vehicle Routing Problem example
Routing Routing solver Vehicle Routing Problem with capacity constraints
Routing Routing solver Vehicle Routing Problem with pickup and delivery constraints
Routing Routing solver Vehicle Routing Problem with time window constraints
Linear Optimization GLOP solver Simple linear programming example
Integer Optimization SCIP solver Simple integer programming example
Constraint Optimization CP-SAT Solver Simple constraint programming example
Constraint Optimization CP-SAT Solver Simple CP program