Without a vehicle, nothing can be transported. This is why an optimization request is required to contain at least one vehicle. They can be customized in various ways by specifying a routing profile, enforcing constraints and defining costs. While vehicle characteristics, like its maximum load, can be specified, driver-specific properties, such as break settings, are also considered parameters of the vehicle.
The optimization will assign routes to your vehicles in such a way that costs are minimized while satisfying the required constraints. Every vehicle can be assigned at most one route and every route is scheduled to be executed by a single vehicle.
Start and end
When a vehicle is assigned a route, the vehicle defines where and when the route can start and end. A vehicle has a fixed start and end location along with a time frame in which the vehicle can be used. This window is defined by the earliest start and the latest end time, with the option to include a latest start time.
Costs
Assigning a route to vehicle results in a cost, which the optimization process aims to minimize. This cost consists of different components.
- Cost per hour - Specifies the cost for each hour a vehicle is deployed, applied accurately down to a second.
- Cost per kilometer - Specifies the cost for the distance a vehicle drives, applied accurately down to a meter.
- Fixed cost - Specifies the cost for the vehicle to be deployed. This cost is applied exactly once if the vehicle is assigned a route by the optimization.
- Overtime costs - Specifies the extra cost per hour for each hour that the route duration exceeds a threshold, applied accurately down to the second. Multiple thresholds can be configured, and the extra costs are applied cumulatively for each threshold that is exceeded.
Example
Given a route with a duration of 8.5 hours and a travel distance of 200 kilometers, assigned to a vehicle with the following cost properties.
"costs": { "perHour": 40, "perKilometer": 0.42, "fixed": 50 }
This route would then have a duration cost of 340, a distance cost of 84 and a fixed cost of 50, resulting a total cost of 474.
Example
Consider the following cost structure. For the first 5 hours of the route, everything is covered by the fixed fee. Once the 5-hour mark is crossed, the driver begins earning at a rate of 40 per hour for the additional time spent on the road. However, should the route extend beyond 8 hours, the driver’s compensation increases further. For every hour beyond this threshold, an extra 10 is added, raising the rate to 50 per hour.
"costs": { "perHour": 0, "perKilometer": 0.42, "fixed": 250, "overtimes": [ { "threshold": 18000, "extraPerHour": 40 }, { "threshold": 28800 "extraPerHour": 10 } ] }
If a route of 8.5 hours would be assigned to a vehicle with the above cost structure, the hour cost of the route would be 395 (
250 + 3.5 * 40 + 0.5 * 10
).
Preferences
When planning efficient routes, the optimization process typically focuses on minimizing costs. However, there are times when a less cost-efficient route might be preferred because it better aligns with certain preferences not directly tied to cost. Preferences guide the optimization process, making it possible to prioritize specific needs, even if it means accepting higher costs as a trade-off.
- Compactness - A route is considered compact if all stops, excluding those at depot, are close together. While the cost per kilometer only applies to the distance between consecutive stops, compactness considers the overall distance between stops resulting in tightly grouped routes. Preference is expressed as a value ranging from 0 and 1, resembling a balance between minimizing the route's kilometers and maximizing route compactness. The impact of this trade-off depends on the total cost of the route's kilometers. As the cost per kilometer rises, the trade-off becomes more significant, playing a larger role during optimization.
Example
The following example demonstrates the effect of choosing different compactness preferences. From left to right, the compactness values of 0, 0.5, and 1 were applied, creating progressively more compact routes. However, as compactness increases, so does the cost. The total distances for the routes are 997 km, 1065 km, and 1242 km, respectively. These include the segments to and from the depot in Brugge which are not visualized.
Routing
The routing properties of a vehicle define how a vehicle drives from one location to another. Some vehicles go faster than others and some roads may not be accessible to certain vehicles.
The routing profile considers vehicle-specific characteristics, such as height and weight. Additionally, the traffic mode takes into account the traffic situation. Both parameters are explained in more detail on a separate concept page about profiles and countries.
Due to restrictions such as weight and height limits, a vehicle may be prohibited from accessing certain road segments, which could prevent it from reaching its destination. By default, the system allows the vehicle to violate the restrictions in its routing profile if no alternative route is available. However, this behavior can be disabled, which may result in the vehicle being unable to reach its destination, requiring the optimization process to assign a different vehicle with a suitable profile to complete the tasks at that location.
A speed factor can be used to further tweak the time required to drive from one location to another.
Example
A speed factor of 2, applied to a van, means that the van drives twice as fast, effectively halving the driving durations. We specify the average traffic mode to take into account the departure time-dependent variations of driving durations.
"routing": { "profile": "EUR_VAN", "trafficMode": "AVERAGE", "speedFactor": 2 }
Break settings
A vehicle can specify restrictions that define when a driver needs to take a break. A break should be scheduled after a maximum driving or working duration.
- Driving duration — The amount of time the vehicle is driving between two locations.
- Working duration — The amount of time the vehicle is deployed and the driver is not waiting or taking a break.
Break settings define how long the driver of a vehicle can work or drive before a break of at least a certain duration should be scheduled. A single break can fulfill the requirements of multiple break settings.
Example
If a break of at least 30 minutes should be taken every 6 hours of working, the working duration between two consecutive breaks of at least 30 minutes should not exceed 6 hours. If, additionally, a break of at least 45 minutes should be taken every 4.5 hours of driving, a single break of 45 minutes is sufficient to satisfy the break settings in a route where the driver works 7 hours and drives 5 hours.
A simplified version of the EU regulation (regulation (EC) No 561/2006) for a single working day can be modeled with 3 break settings.
"breaks" : {
"working" : [
{
"maximumWorkingDuration" : 21600,
"minimumBreakDuration": 1800
},
{
"maximumWorkingDuration": 32400
"minimumBreakDuration": 2700
}
],
"driving" : [
{
"maximumDrivingDuration" : 16200,
"minimumBreakDuration": 2700
}
]
}
The US regulation for a single working day can be modeled with a single break setting.
"breaks" : {
"driving" : [
{
"maximumDrivingDuration" : 28800,
"minimumBreakDuration": 1800
}
]
}
Constraints
A vehicle and its driver have limitations that should be respected by the optimization.
- Maximum loads — Defines the maximum loads a vehicle can transport. While one order alone may fit on a vehicle, a combination of orders may not fit. You can specify the capacity of a vehicle for multiple dimensions such as weight, volume or pallets. The optimization will make sure that the order combination loaded onto the vehicle will never exceed the capacity of the vehicle for each dimension.
- Maximum duration — Defines the maximum duration of a route that can be assigned to the vehicle. This can be used to limit the duration of a driver’s working day, according to governmental regulations.
- Maximum distance — Defines the maximum distance of a route that can be assigned to the vehicle. This is especially relevant for electric vehicles that only have a limited range.
Categories
Certain constraints and rules are not only specific to the vehicle but entail different entities such as orders or depots. These constraints are typically expressed based on categories, which are often functional properties of the vehicle itself. Examples of categories might be whether or not a vehicle can be cooled, the region it can be deployed or any other essential property associated with the vehicle.