Relations
Relation is a mechanism to lock jobs to specific vehicles. List of relations is a part of plan
schema and each relation
has the following properties:
- type (required): one of three relation types: tour, fixed, or sequence. See description below.
- vehicleId (required): a specific vehicle id
- jobs (required): list of job ids including reserved:
departure
,arrival
,break
andreload
- shiftIndex (optional): a vehicle shift index. If not specified, a first, zero indexed, shift assumed
You can use more than one relation per vehicle.
Any type
A any
relation is used to lock specific jobs to certain vehicle in any order:
{
"type": "any",
"jobs": [
"job1",
"job3"
],
"vehicleId": "vehicle_1"
}
Sequence type
A sequence
relation is used to lock specific jobs to certain vehicle in fixed order allowing insertion of new jobs in
between.
Strict type
In contrast to sequence
relation, strict
locks jobs to certain vehicle without ability to insert new jobs in between:
{
"type": "strict",
"jobs": [
"departure",
"job4",
"job1"
],
"vehicleId": "vehicle_1"
}
In this example, new jobs can be inserted only after job with id job1
.
Important notes
Please consider the following notes:
- jobs specified in relations are not checked for constraint violations. This might lead to non-feasible solutions (e.g. routes with capacity or time window violation).
- relation with jobs which have multiple pickups or deliveries places are not yet supported
Related errors
- E1200 relation has job id which does not present in the plan
- E1201 relation has vehicle id which does not present in the fleet
- E1202 relation has empty job id list
- E1203 strict or sequence relation has job with multiple places or time windows
- E1204 job is assigned to different vehicles in relations
- E1205 relation has invalid shift index
- E1206 relation has special job id which is not defined on vehicle shift
Examples
Please refer to complete example to see how to specify problem with relations.