VROOM - Category (Experimental)¶
Warning
Possible server crash
These functions might create a server crash
Warning
Experimental functions
They are not officially of the current release.
They likely will not be officially be part of the next release:
The functions might not make use of ANY-INTEGER and ANY-NUMERICAL
Name might change.
Signature might change.
Functionality might change.
pgTap tests might be missing.
Might need c/c++ coding.
May lack documentation.
Documentation if any might need to be rewritten.
Documentation examples might need to be automatically generated.
Might need a lot of feedback from the comunity.
Might depend on a proposed function of vrpRouting
Might depend on a deprecated function of vrpRouting
Contents
Functions
Synopsis¶
VROOM is an open-source optimization engine that aims at providing good solutions to various real-life vehicle routing problems (VRP) within a small computing time.
VROOM can solve several well-known types of vehicle routing problems (VRP).
TSP (travelling salesman problem)
CVRP (capacitated VRP)
VRPTW (VRP with time windows)
MDHVRPTW (multi-depot heterogeneous vehicle VRPTW)
PDPTW (pickup-and-delivery problem with TW)
VROOM can also solve any mix of the above problem types.
Characteristics¶
VROOM models a Vehicle Routing Problem with vehicles
, jobs
and shipments
.
The vehicles denote the resources that pick and/or deliver the jobs and shipments. They are characterised by:
Capacity on arbitrary number of metrics
Skills
Working hours
Driver breaks
Start and end defined on a per-vehicle basis
Start and end can be different
Open trip optimization (only start or only end defined)
The jobs denote the single-location pickup and/or delivery tasks, and the shipments denote the pickup-and-delivery tasks that should happen within the same route. They are characterised by:
Delivery/pickup amounts on arbitrary number of metrics
Service time windows
Service duration
Skills
Priority
Terminologies¶
Tasks: Either jobs or shipments are referred to as tasks.
Skills: Every task and vehicle may have some set of skills. A task can be served by only that vehicle which has all the skills of the task.
Priority: Tasks may have some priority assigned, which is useful when all tasks cannot be performed due to constraints, so the tasks with low priority are left unassigned.
Amount (for shipment), Pickup and delivery (for job): They denote the multidimensional quantities such as number of items, weights, volume, etc.
Capacity (for vehicle): Every vehicle may have some capacity, denoting the multidimensional quantities. A vehicle can serve only those sets of tasks such that the total sum of the quantity does not exceed the vehicle capacity, at any point of the route.
Time Window: An interval of time during which some activity can be performed, such as working hours of the vehicle, break of the vehicle, or service start time for a task.
Break: Array of time windows, denoting valid slots for the break start of a vehicle.
Service time: The additional time to be spent by a vehicle while serving a task.
Travel time: The total time the vehicle travels during its route.
Waiting time: The total time the vehicle is idle, i.e. it is neither traveling nor servicing any task. It is generally the time spent by a vehicle waiting for a task service to open.
Inner Queries¶
Jobs SQL¶
A SELECT
statement that returns the following columns:
id, location_index
[, service, delivery, pickup, skills, priority]
Column |
Type |
Default |
Description |
---|---|---|---|
id |
|
Non-negative unique identifier of the job. |
|
location_index |
|
Non-negative identifier of the job location. |
|
service |
|
0 |
Job service duration, in seconds |
delivery |
|
Array of non-negative integers describing multidimensional quantities for delivery such as number of items, weight, volume etc.
|
|
pickup |
|
Array of non-negative integers describing multidimensional quantities for pickup such as number of items, weight, volume etc.
|
|
skills |
|
Array of non-negative integers defining mandatory skills. |
|
priority |
|
0 |
Priority level of the job
|
Where:
- ANY-INTEGER
SMALLINT, INTEGER, BIGINT
Shipments SQL¶
A SELECT
statement that returns the following columns:
id, p_location_index [, p_service], d_location_index [, d_service]
[, amount, skills, priority]
Column |
Type |
Default |
Description |
---|---|---|---|
id |
|
Non-negative unique identifier of the shipment. |
|
p_location_index |
|
Non-negative identifier of the pickup location. |
|
p_service |
|
0 |
Pickup service duration, in seconds |
d_location_index |
|
Non-negative identifier of the delivery location. |
|
d_service |
|
0 |
Delivery service duration, in seconds |
amount |
|
Array of non-negative integers describing multidimensional quantities such as number of items, weight, volume etc.
|
|
skills |
|
Array of non-negative integers defining mandatory skills. |
|
priority |
|
0 |
Priority level of the shipment.
|
Where:
- ANY-INTEGER
SMALLINT, INTEGER, BIGINT
Vehicles SQL¶
A SELECT
statement that returns the following columns:
id, start_index, end_index
[, capacity, skills, tw_open, tw_close, speed_factor]
Column |
Type |
Description |
---|---|---|
id |
|
Non-negative unique identifier of the job. |
start_index |
|
Non-negative identifier of the vehicle start location. |
end_index |
|
Non-negative identifier of the vehicle end location. |
capacity |
|
Array of non-negative integers describing multidimensional quantities such as number of items, weight, volume etc.
|
skills |
|
Array of non-negative integers defining mandatory skills. |
tw_open |
|
Time window opening time. |
tw_close |
|
Time window closing time. |
speed_factor |
|
Vehicle travel time multiplier. |
Note:
At least one of the
start_index
orend_index
shall be present.If
end_index
is omitted, the resulting route will stop at the last visited task, whose choice is determined by the optimization process.If
start_index
is omitted, the resulting route will start at the first visited task, whose choice is determined by the optimization process.To request a round trip, specify both
start_index
andend_index
as the same index.A vehicle is only allowed to serve a set of tasks if the resulting load at each route step is lower than the matching value in capacity for each metric. When using multiple components for amounts, it is recommended to put the most important/limiting metrics first.
It is assumed that all delivery-related amounts for jobs are loaded at vehicle start, while all pickup-related amounts for jobs are brought back at vehicle end.
tw_open ≤ tw_close
Breaks SQL¶
A SELECT
statement that returns the following columns:
id, vehicle_id [, service]
Column |
Type |
Default |
Description |
---|---|---|---|
id |
|
Non-negative unique identifier of the break. (unique for the same vehicle). |
|
vehicle_id |
|
Non-negative unique identifier of the vehicle. |
|
service |
|
0 |
The break duration, in seconds |
Time Windows SQL¶
A SELECT
statement that returns the following columns:
id [, kind], tw_open, tw_close
Column |
Type |
Description |
---|---|---|
id |
|
Non-negative unique identifier of the job, pickup/delivery shipment, or break. |
kind |
|
Only required for shipments. Value in [‘p’, ‘d’] indicating whether the time window is for:
|
tw_open |
|
Time window opening time. |
tw_close |
|
Time window closing time. |
Note:
All timing are in seconds.
Every row must satisfy the condition:
tw_open ≤ tw_close
.It is up to users to decide how to describe time windows:
Relative values, e.g. [0, 14400] for a 4 hours time window starting at the beginning of the planning horizon. In that case all times reported in output with the arrival column are relative to the start of the planning horizon.
Absolute values, “real” timestamps. In that case all times reported in output with the arrival column can be interpreted as timestamps.
Time Matrix SQL¶
A SELECT
statement that returns the following columns:
start_index, end_index, agg_cost
Column |
Type |
Description |
---|---|---|
start_vid |
|
Identifier of the start node. |
end_vid |
|
Identifier of the end node. |
agg_cost |
|
Time to travel from |
Result Columns¶
Column |
Type |
Description |
---|---|---|
seq |
|
Sequential value starting from 1. |
vehicle_seq |
|
Sequential value starting from 1 for current vehicles. The \(n^{th}\) vehicle in the solution. |
vehicle_id |
|
Current vehicle identifier. |
step_seq |
|
Sequential value starting from 1 for the stops made by the current vehicle. The \(m^{th}\) stop of the current vehicle. |
step_type |
|
Kind of the step location the vehicle is at:
|
task_id |
|
Identifier of the task performed at this step.
|
arrival |
|
Estimated time of arrival at this step, in seconds. |
travel_time |
|
Cumulated travel time upon arrival at this step, in seconds |
service_time |
|
Service time at this step, in seconds |
waiting_time |
|
Waiting time upon arrival at this step, in seconds. |
load |
|
Vehicle load after step completion (with capacity constraints) |