Interpret the response

  • The Route Optimization API returns optimized routes for vehicles, assigning shipments and potentially skipping some based on constraints and costs.

  • The API response includes routes for each vehicle, detailing their assigned shipments, start and end times, along with aggregated metrics for the entire solution.

  • Shipments that cannot be performed within the specified constraints or are too costly are listed in skippedShipments.

  • validationErrors highlight issues with the request when using VALIDATE_ONLY solving mode, aiding in debugging.

  • Each route includes visits representing shipment pickups and deliveries, and transitions detailing travel between them, with associated metrics like duration and distance.

European Economic Area (EEA) developers

The Route Optimization API returns routes for vehicles in the corresponding request. Shipments are assigned to vehicles, or may be skipped depending on the request's properties.

An OptimizeToursResponse message (REST, gRPC) has two main top-level properties:

  • routes[] are the routes for each vehicle with its assigned shipments. Each Route contains metrics reflecting properties of that individual route.
  • metrics are aggregated metrics for the entire response, across all vehicles and route plans. Top-level metrics contain the same properties as per-Route metrics, with values aggregated across all Routes.

Some properties may not always be populated depending on optimization results:

  1. skippedShipments[] lists shipments that are not performed by any vehicle. A shipment can be skipped if it cannot be performed within specified constraints or if the cost to perform the shipment exceeds its penalty cost. For example, if a shipment's pickup or delivery has a very narrow timeWindow it may not be possible or cost effective for a vehicle to perform the visit during the required time window.
  2. validationErrors[] specifies errors that makes the request invalid or impossible to solve when the request's solvingMode is set to VALIDATE_ONLY. In normal DEFAULT_SOLVE mode, validation errors will appear in an error message instead of the response body. Note that VALIDATE_ONLY solving mode can report multiple errors at once, which is useful for quickly debugging requests.

Route properties

Each routes[] entry is a ShipmentRoute message (