- Route Optimization API
- Home
- Products
- Google Maps Platform
- Documentation
- Route Optimization API
Route Optimization is a Google Maps Platform API that accepts vehicle routingobjectives and operational constraints in the form of structured data to providea route plan for one or more vehicles.
Why use Route Optimization
With Route Optimization API, you can establish or refine an automated dispatchor route planning process that improves the operational efficiency of yourtransportation needs. With parameters to express your unique operationalobjectives and constraints, and an algorithm built on top of the trusted GoogleMaps data, the service generates the best possible route plans to meet thoseconstraints. Some use-case examples follow:
- A logistics company uses Route Optimization to optimize the assignmentsof all next-day shipments, providing a route for each shipment thatoptimizes for distance and time efficiency, cost saving, on time delivery,and driver and end customer satisfaction.
- An on demand food delivery company uses Route Optimization in theirreal-time dispatch process to choose the best active driver to pick upseveral new orders and insert it in their existing routes.
- A medical service provider uses Route Optimization to map healthproviders to appointments, improving the efficiency of the routes for eachprovider across their day.
- A field service provider uses Route Optimization to find the optimalroute and sequence for technician's service appointments, and re-optimizewhen condition changes occur, such as en route delays.
What you can do with Route Optimization
With Route Optimization API, you can optimize the routes and assignments oftasks for a fleet of vehicles, taking into account various objectives andconstraints.
Examples of the objectives:
- Travel efficiency: Define your requirements for travel efficiency basedon parameters such as distance and time-to-destination.
- On time arrival: Ensure vehicles arrive for their tasks on time. Forexample, define a given time window for a pickup, delivery, or serviceaction.
- Vehicle utilization cost: Minimize the number of vehicles required toperform the tasks to save cost.
- Load balancing: Ensure tasks are fairly distributed across the fleet ofvehicles and personnel.
Examples of the constraints:
- Drivers work hours: Start and end time for work and time for breaks.
- Vehicle capacity: The maximum amount of load a vehicle can carry at atime.
- Time windows: Specific time slot required for arrival, such as customeravailability or store operation hours.
Dependencies and compatibility: Define work dependencies in one of thefollowing ways:
- Requires specific types of vehicle or personnel
- Requires other work to be performed first
- A shipment must be the only one in the vehicle at a given time.
See developer reference guides (REST, gRPC) for details and allavailable parameters.
How Route Optimization works
The Route Optimization API uses a number of inputs to return a route plan.Inputs include vehicles, tasks or shipments, objectives, and constraints. Aroute plan includes tasks assignment to vehicles, the multi-stop routes for eachvehicle, and the related metrics.
Route Optimization API achieves this using two methods:
- OptimizeTours: A synchronous API, which requires the client to wait forthe server's response before proceeding with other tasks.
- BatchOptimizeTours: An asynchronous API, which allows the client toproceed with other tasks before the server finishes and responds.
Both methods share the same interface and supported parameters. You can readmore about BatchOptimizeTours inSynchronous and Asynchronous Endpoints.
The Route Optimization API accepts an HTTP POST request with a JSON request bodythat contains the details of the input.
The OptimizeTours Request
The request consists of the following required entities:
- Model: a global entity where global level settings and constraints areconfigured. It also contains Shipments and Vehicles.
- Shipment: used to define a task or an actual shipment that could includea pickup task and a delivery visit and the corresponding attributesincluding locations and other attributes, constraints, and cost functions.See the Shipment reference documentation (REST, gRPC) for details.
- Vehicle: used to define a vehicle (or driver, personnel) and thecorresponding travel attributes including starting locations and othervehicle or travel attributes, constraints, and cost functions. See (REST, gRPC) for details.
See Pickup and Delivery Stop Order Optimization for a simple example.
The OptimizeTours response
The Route Optimization API returns a JSON response that includes the route planfor the vehicles and the tasks or shipments.
- Routes: it contains the routes for each vehicle with its assigned tasks(or shipments)
- Metrics: aggregated metrics about the generated route plan
See Pickup and Delivery Stop Order Optimization for a simple example.
Read more details about constructing the request and interpreting the responsein Interpret the Response.
Resources
The following table summarizes the resources available through theRoute Optimization API along with the data it returns.
Data resources | Data returned | Return format |
batchOptimizeTours (REST,gRPC) | Returns the resource name of a Long Running Operation, which indicates when processing is complete. | JSON or gRPC proto |
optimizeTours (REST,gRPC) | Returns an optimized route, with details of the visits and metrics. | JSON or gRPC proto |
How to use Route Optimization
1 | Get set up | Start with Set up your Google Cloud project and complete the setup instructions that follow. |
2 | Run a basic request and receive a response | After setup, start with sending a basic request and get the response, following Constructing a Request and Interpret the Response. |
3 | Try a more advanced scenario and start creating your own request | Explore example scenarios starting with Pickup and Delivery Stop Order Optimization and start building requests that match your use cases. |
Available client libraries
For a list of the available client libraries for Route Optimization API, seeClient Libraries.
What's next
- Start using the Route Optimization API: Go to Run a Basic Request.
- Understand billing: Usage and Billing
- See sample code and libraries: Client Libraries andOpen Source
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-12 UTC.
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]