Skip to main content

Vehicle depot

In the context of the Vehicle Routing Problem (VRP), a depot is a central location where vehicles start and end their routes. It serves as the origin and destination for all vehicle trips. The depot is a critical component of the VRP, as it represents the base of operations for the fleet.

Key Characteristics of a Depot:

  • Origin and Destination: All vehicle routes begin at the depot and return to the depot at the end of their service.
  • Vehicle Staging: The depot is where vehicles are parked, loaded, and prepared for their routes.
  • Resource Hub: The depot may house resources such as fuel, maintenance facilities, or loading/unloading equipment.
  • Time Windows: Depots can have time windows, restricting when vehicles can depart or return.

The Role of the Depot in Route Planning:

Routes can be designed to start and end at the depot, and the distance between the depot and the customer nodes is a key factor in determining travel time and cost.

Here's how the depot influences route planning:

  • Route Start and End: All routes must begin and end at the depot, adding constraints to the route planning process.
  • Travel Time: The distance between the depot and the customer nodes directly impacts travel time and cost.
  • Vehicle Availability: The depot is where vehicles are available for service, so the number of vehicles at the depot influences the number of routes that can be created.
  • Resource Allocation: The depot's resources (e.g., loading docks, fuel) can constrain the number of vehicles that can be serviced simultaneously.

Multiple Depots:

In some scenarios, there may be multiple depots. In these cases, each vehicle is typically assigned to a specific depot, and its routes must start and end at that depot. Multiple depots can improve efficiency by reducing travel time, especially when customer nodes are spread over a large area.

Example:

Imagine a delivery company with a single depot located in the city center. All delivery trucks start their day at the depot, load their goods, and then depart to serve their assigned customers. At the end of the day, they return to the depot to unload any remaining goods and park for the night. The depot's location and the number of trucks it can accommodate directly impact the efficiency of the delivery routes.

Supporting depots in SWAT APIs

Depots can be support both in Integration API and Optimization (stateless) API. IN case of Integration API, it's a setting for each vehicle, or the node as discussed in the relevant How To guide. In addition, depot (or vehicle start\end location) can be be modelled in Optimization (stateless) API allowing for more granular and flexible control.

Depots in Optimization API

A vehicle's depot is defined using the assigned_nodes configuration. This specifies start and end locations on the route as nodes. For example, assigned_nodes of node_type=point represent locations along the route. These special nodes ignore the demand configuration. However, their time windows are still enforced. Therefore, insufficient time for a vehicle to return to the depot may lead to rejected orders.

The payload uses partial_route to specify the vehicle's route and partial_route_end to mark its endpoint. These locations may differ.

       "vehicles": [
{
"agent_id": "2957b18e-6897-466e-9480-9e695962ccfb",
"service_number": "IKEA 2man Chiba W 3",
"start_time": "2024-05-28T9:00+00:00",
"end_time": "2024-05-28T18:00+00:00",
"capacity": {
"g": 9999000,
"unit": 18
},
"lat": 0,
"lon": 0,
"labels": [],
"geofence_ids": [
-1
],
"partial_route": [
"e36b4f8d-2d3b-4d0c-9ea7-5b511cb070a1"
],
"partial_route_end": [
"2f50bd9c-db60-4006-b4be-4367aacce897"
],
"assigned_nodes": [
{
"uid": "e36b4f8d-2d3b-4d0c-9ea7-5b511cb070a1",
"node_type": "point",
"open_time_ts": "2024-05-28T9:00+00:00",
"close_time_ts": "2024-05-28T18:00+00:00",
"close_time_ts_dynamic": "2024-05-28T18:00+00:00",
"service_time": 0,
"lat": 35.6656493595347,
"lon": 139.825169021904,
"demand": {
"g": 0
},
"location_name": "depot"
},
{
"uid": "2f50bd9c-db60-4006-b4be-4367aacce897",
"node_type": "point",
"open_time_ts": "2024-05-28T9:00+00:00",
"close_time_ts": "2024-05-28T18:00+00:00",
"close_time_ts_dynamic": "2024-05-28T18:00+00:00",
"service_time": 0,
"lat": 35.6656493595347,
"lon": 139.825169021904,
"demand": {
"g": 0
},
"location_name": "depot"
}
]
}
]