Search for content

Routes

The primary objective of the optimization is to effectively allocate tasks to routes. As such, a route is a sequence of tasks, assigned to a vehicle. The efficiency of routes is gauged by metrics such as the total drive duration, the count of scheduled orders, and the associated cost. The optimization strives to minimize the overall cost of the routes.

Start and end

At the start of the route, vehicles initiate their journey from a designated point known as the start location of the vehicle. Here, all necessary preparations happen before stops can be visited. As the route progresses, various stops for pickups and deliveries are executed according to the optimized schedule. After the last stop, the vehicle proceeds to its end location and carries out its final activities, marking the end of the route.

Note that no pickup or delivery tasks are executed at the start and end of the route. These tasks are captured in the stops of the route, which may take place at the start or end location of the vehicle.

Stops

A stop denotes the visit of a location for the purpose of executing a pickup or delivery. As neither pickups nor deliveries are carried out at the start or end of a route, these are not classified as stops. Nevertheless, there is a possibility that the initial stop of a route takes place at the start location of the vehicle, or the final stop occurs at the vehicle's end location. A stop is characterized by several noticeable properties.

  • An approach describes the segment or leg of the route since the preceding stop. It includes information such as driving duration, distance traveled and breaks that take place between the two consecutive stops.
  • A stop’s preparation duration is a period of time, scheduled before planned appointments. It reflects the preparation duration as defined on the corresponding location. This is not influenced by the tasks scheduled for execution at this stop.
  • The appointments associated with a stop encapsulate its vital information, detailing the tasks scheduled and their respective timing restrictions. An appointment is a sequential arrangement of tasks coordinated with the same time slot.
stops

Appointments

An appointment involves a consecutive series of tasks at a stop scheduled with the same time slot. The start of the appointment is limited by the time slot. The optimization will schedule appointments such that their start lies within the earliest start and latest start of the appointment’s time slot. This can result in a waiting duration before the appointment's start, in case the driver has to wait for the earliest start of the time slot. Two main activities take place during an appointment.

  • An appointment’s preparation duration, defined by the time slot's preparation duration, is a period of time that is scheduled before tasks are executed. Note that the appointment’s preparation duration is scheduled after the start of the appointment, while the stop’s preparation duration is scheduled before the start of the first appointment at the stop.
  • The optimization schedules an appointment at a stop to carry out pickup or delivery tasks. As long as the start of the appointment falls within the limits specified by its time slot, any number of tasks can be executed within this appointment, provided the time slot aligns with the requirements of the task. When the last task of the appointment is executed, the appointment ends. The end of the appointment must not be later than the latest end time defined by the time slot.
appointments

 

Example

Below is an example of a time slot that can be used to schedule an appointment with a preparation duration of 1 hour.

"timeSlots": [
    {
        "id": "NOON",
        "earliestStart": "2023-01-01T12:00:00+01:00",
        "latestStart": "2023-01-01T12:00:00+01:00",
        "latestEnd": "2023-01-01T14:00:00+01:00",
        "preparationDuration": 3600
    }
]

The start of the appointment must adhere the constraints set by the time slot. For instance, if the time slot above is used to arrange an appointment, the preparation duration of the stop, when defined, will be scheduled before noon. The appointment’s preparations will be scheduled to start exactly at noon and the start of the first task’s execution will be scheduled at one o’clock. Any number of tasks can be assigned to this appointment as long as the task allows for the time slot to be used and as long as the last task ends before 2 o’clock.

Tasks

For every order present in the optimization request, the algorithm tries to schedule the pickup and delivery of the order on a route. Depending on the order type, these tasks can take place either at a depot or an order-specific location. In case the task is executed at a depot, it will reference the depot selected by the optimization.

Metrics

The optimization tries to minimize the total cost of the routes. This cost is computed based on the cost per hour, cost per kilometer and fixed cost of the vehicle assigned to the route. The cost of the individual route, together with other specific aspects of the route such as the covered distance, the duration of the route and the number of stops visited are provided in the metrics of the route.

Input routes

When starting an optimization, you can specify an initial set of routes, which will undergo reconstruction before optimization begins. Reconstruction ensures that all constraints, such as time slots, maximum loads of the vehicle, and break settings are met. This process may involve removing orders, adding or removing breaks, or adjusting route start times. After reconstruction, the optimization process will improve the routes just as it would for routes generated directly by the optimization itself. Providing a set of initial routes can accelerate the optimization process, especially when only a few parameters have changed in the request, such as the addition of a small number of orders.

It's important to note that the optimization will not preserve the provided input routes as they are. To ensure specific orders stay assigned to the same vehicle, order-vehicle combination constraints can be used. Similarly, if maintaining the sequence of tasks within a route is crucial, respected task sequence constraints can be applied. However, enforcing these constraints might lead to unscheduled orders if it becomes impossible to maintain the desired route structure without violating other constraints.

The following route properties must be specified in order for the optimization process to reconstruct the routes.

  • The vehicle the route is assigned to.
  • The point in time when the route should start. This time will be respected as closely as possible.
  • In essence, a route is a sequence of tasks that should be executed. Each task can be described by the following properties.
    • The order whose pickup or delivery is described by this task.
    • Whether the task is a pickup or delivery task.
    • The time slot of the appointment during which the task is executed.
    • The depot in case the task is a pickup or a delivery at a depot.
    • The compartment that the order needs to be loaded in or unloaded from.
  • The breaks scheduled on the route, defined by their start time and duration. When omitted, reconstruction will make a best effort to schedule breaks in order to satisfy the break settings.