On the One-to-One Pickup-and-Delivery Problem with Time Windows and Trailers

This paper studies an extension of the well-known one-to-one pickup-and-delivery problem with time windows. In the latter problem, requests to transport goods from pickup to delivery locations must be fulfilled by a set of vehicles with limited capacity subject to time window constraints at locations. The goods are not interchangeable; what is picked up at one particular location must be delivered to one particular other location. The extension discussed here consists in the consideration of a heterogeneous vehicle fleet comprising lorries with detachable trailers. Trailers are advantageous as they increase the overall vehicle capacity. However, some locations may be accessible only by a lorry without a trailer. Therefore, special locations are available where trailers can be parked while lorries visit accessibility-constrained locations. This induces a nontrivial tradeoff between an enlarged vehicle capacity and the necessity of scheduling detours for parking and reattaching a trailer. The contribution of the present paper is threefold: (i) It studies a practically relevant generalization of the one-to-one pickup-and-delivery problem with time windows. (ii) It develops an exact amortized constant-time procedure for testing the feasibility of an insertion of a transport task into a given route with regard to time windows and lorry and trailer capacities. (iii) The paper provides a comprehensive set of new benchmark instances on which the running time of the constant-time test is compared with a naïve one that requires linear time by embedding both tests in an adaptive large neighbourhood search algorithm. The results of computational experiments show that the constant-time test outperforms its linear-time counterpart by one order of magnitude on average.


Introduction
The one-to-one pickup-and-delivery problem with time windows and trailers (PDPTWT) can be described as follows. There is a set of requests or tasks to transport specified amounts of goods between paired pickup and delivery locations. To fulfil the tasks, a set of capacitated vehicles consisting of single lorries and lorry-trailer combinations (LTCs) is available. Each vehicle has a given start and a given end location. The start location of a vehicle may differ from the vehicle's end location. A trailer has the same start and the same end location as its associated lorry. Each single lorry and each LTC has a fixed cost, incurred only if it fulfils at least one task, and a travel cost for moving from one location to another. Fixed and travel costs may differ between vehicles; for LTCs, travelling between two locations with the trailer attached may be more expensive than without. Capacities may also differ between vehicles. LTCs have a lorry capacity and a trailer capacity. After picking up and before delivering the goods of a certain task, vehicles may visit other pickup and/or delivery locations. All pickup and all delivery locations can be visited by a single lorry and by an LTC lorry without its trailer. However, some pickup and some delivery locations may have accessibility constraints in the sense that they cannot be visited by an LTC lorry when the trailer is coupled. Because of these accessibility restrictions, there are also parking and transshipment locations (PTLs). At PTLs, trailers can be decoupled, parked, and re-coupled, and load can be transshipped between an LTC lorry and its trailer. In this paper, a fixed lorrytrailer assignment is assumed. This means that each trailer can be pulled only by one lorry, and only this lorry can transfer load to or from the trailer. All task locations, i.e., all pickup or delivery locations, can be visited by any lorry, all locations designated as reachable by trailer can be visited by any trailer, and PTLs can be visited by all LTC lorries and trailers. Each task location is visited exactly once, whereas PTLs can be visited more than once by the same or different LTCs. The load to be picked up at a task location can be split arbitrarily between a lorry and its trailer if the location is visited by an LTC. Each location has a single, hard time window that may be equal to the length of the planning horizon and thus nonrestrictive. Arrival at a location before the start of its time window is allowed and incurs waiting time but no cost. Waiting time is not limited. There are fixed service times at all task locations and all PTLs. At PTLs, there are two service times, one for the decoupling and one for the re-coupling operation. Travel times between locations and service times are independent of the current vehicle, of its current load and, for LTCs, of whether or not the trailer is attached. Travel and service times as well as fixed and travel costs are time-independent. All vehicles are available throughout the complete planning horizon. An LTC route may visit any location and is partitioned into the main route, which is the part of the route where the lorry pulls its trailer, and zero or more subroutes that start and end at a PTL where the lorry parks its trailer while visiting one or more task locations. An LTC lorry may perform several consecutive subroutes starting and ending at the same PTL before finally pulling away its trailer. If a delivery location is visited on a subroute and the corresponding pickup location has been visited before this subroute, it must be ensured that the entire amount of goods bound for this delivery location is on the lorry at the start of the subroute. This may require a load transfer from a trailer to its lorry at a PTL. There is no congestion at PTLs: arbitrarily many trailers can be parked at a PTL at the same time. Without loss of generality, it is assumed that a load transfer, if any, between an LTC lorry and its trailer takes place only directly before a decoupling operation, not when re-coupling. The duration (service time) of a decoupling operation includes time for a potential load transfer. The problem is static and deterministic, i.e., all data are known in advance. The objective of the PDPTWT is to find a feasible solution with a minimal (or, at least, low) sum of fixed and travel costs. A feasible solution consists of a set of feasible routes, one for each single lorry and one for each LTC, so that each task is covered by exactly one vehicle (single lorry or LTC). A route is feasible if and only if it starts at the start depot of the vehicle that performs the route, fulfils zero or more tasks, and ends at the vehicle's end depot, while maintaining all time windows, accessibility constraints, and lorry and trailer capacities. In a feasible solution, the following nine cases are possible with regard to accessibility constraints: Pickup Figure 1 shows an example LTC route that fulfils the nine tasks t 1 , . . . , t 9 . For i = 1, . . . , 9, p i and d i respectively denote the pickup and the delivery location of task t i . The route starts and ends at the depot bottom left and performs four subroutes, two each at the parking and transshipment locations ptl 1 and ptl 2 . In the figure, task t i corresponds to case i of the above table for i = 1, . . . , 9. Blue triangles represent locations that can be visited with a trailer; green ones can only be visited without. Triangles pointing upwards represent pickups, those pointing downwards represent deliveries. There is no lack of practical applications of the PDPTWT. This author has seen use cases in the supply of supermarkets, beverage stores, and apparel stores, in the transport of ready-mixed concrete garages and commercial waste bins, and, most notably, in the less-than-truckload business, where containers, swap-body platforms, and smaller collective consignments are transported by LTCs. The contribution of this paper is threefold: (i) It studies a practically relevant extension of the one-to-one pickup-and-delivery problem with time windows. Put differently, it generalizes vehicle routing problems (VRPs, i.e., problems where either all pickups or all deliveries take place at a central depot) with trailers to pickup-and-delivery problems. (ii) It develops an exact amortized constant-time procedure for testing the feasibility of an insertion of a task into a given PDPTWT route concerning time windows and lorry and trailer capacities. 'Exact' means that the testing procedure will declare the insertion as feasible if and only if the route resulting from the insertion is feasible. 'Amortized constant-time' means that the test itself takes constant time and is independent of the number of tasks (or, equivalently, the number of locations visited) on the route, but that the test uses auxiliary data which must be computed in a preprocessing step which does not run in constant time. (iii) The paper provides a comprehensive set of new benchmark instances and empirically compares the running time of the constant-time test on these instances with a naïve one that requires linear time by embedding both tests in an adaptive large neighbourhood search algorithm for the heuristic solution of the problem. The results of computational experiments show that the constant-time test outperforms its linear-time counterpart by one order of magnitude on average. The rest of the paper is structured as follows. The next section gives a brief review of related literature. Section 3 presents the adaptive large neighbourhood search procedure used to solve the PDPTWT. In Section 4, the insertion feasibility tests regarding time and capacity are described. Section 5 presents the newly created benchmark instances and discusses the computational results obtained on them. Finally, Section 6 gives a conclusion and proposes topics for further research.
Pickup-and-delivery problems (without trailers) exist in several variants (one-to-one, one-to-manyto-one, many-to-many, simultaneous delivery and pickup) and have been extensively studied in the last decades. Important surveys are presented by Parragh et al. [26,27], Doerner and Salazar-González [9], and Battarra et al. [2]. These works also provide classification schemes for the different variants. The static, deterministic, multi-vehicle, one-to-one variant with time windows is the most widely studied type. Exact algorithms for this problem are presented by Ropke et al. [34], Ropke and Cordeau [33], and Baldacci et al. [1]. According to Battarra et al. [2], the most successful heuristic procedures, by Bent and Van Hentenryck [3] and Ropke and Pisinger [35], are both based on large neighbourhood search. Routing problems with trailers have also attracted a lot of interest from researchers. The surveys by Prodhon and Prins [32] and Cuda et al. [7] contain sections on VRPs with trailers, which are commonly referred to as truck-and-trailer routing problems (TTRPs). Most works on TTRPs consider no time windows. Exact algorithms for TTRPs with time windows (TTRPTWs) are presented by Parragh and Cordeau [25] and Rothenbächer et al. [36]. Heuristics for TTRPTWs are described by Drexl [10] (heuristic column generation), Lin et al. [22] (simulated annealing), Derigs et al. [8] (hybrid local and large neighbourhood search, attribute-based hill climber), and Parragh and Cordeau [25] (adaptive large neighbourhood search). Pickup-and-delivery problems with time windows and trailers are less well studied. Most papers on this topic consider approaches for problems where vehicles consisting of a tractor and a semitrailer are employed to perform full-load tasks, i.e., where a vehicle can transport only one task at a time. Examples are the problems examined by Cheung et al. [6] (attribute-decision model), Xue et al. [46] (tabu search) and Tilk et al. [42] (branch-and-price-and-cut). Concerning the PDPTWT version studied here, this author is aware of only one paper: Bürckert et al. [5] describe a holonic multi-agent system heuristic for a generalization of the PDPTWT in the context of long-distance transport. The authors take into account eight types of resource: driver, lorry with loading capacity, lorry without loading capacity, tractor, trailer, semi-trailer, chassis, and swap-body. Adequate combinations of these resources must be created to fulfil tasks. Seminal works on efficient feasibility tests for insertion or local search procedures for different types of VRPs and PDPs are the ones by Savelsbergh [37,38,39], Kindervater and Savelsbergh [20], Funke et al. [13], Irnich et al. [18], Irnich [16,17], Masson et al. [24], Vidal et al. [43], and Grangier et al. [14]. None of these, however, considers routing problems with trailers.

Adaptive Large Neighbourhood Search for the PDPTWT
Adaptive large neighbourhood search (ALNS) is a very widely and successfully used metaheuristic, in particular for, but not limited to, many different types of routing problem. ALNS was first used by Ropke and Pisinger [35] and extends the large neighbourhood search principle introduced by Shaw [40] by adding different removal and reinsertion operators and an adaptive operator selection scheme. Pisinger and Ropke [30] present a tutorial and a literature survey on (A)LNS. The basic idea of large neighbourhood search is to repeatedly perform the following steps. Given an incumbent solution, some of its elements are removed and reinserted to create a new solution that replaces the current incumbent if it either improves the best solution found so far or fulfils some other acceptance criterion. The ALNS used for the computational experiments described in this paper follows the set-up described by Ropke and Pisinger [35] for the PDPTW without trailers. All removal and reinsertion operators described by Ropke and Pisinger [35] (random, worst and Shaw removal, basic greedy, regret-2, -3, -4 and -M reinsertion) are applied, a roulette wheel procedure with adaptive weight adjustment is employed for selecting the removal and reinsertion operators in each iteration, and a simulated annealing acceptance criterion is used. In addition, the following three removal strategies are built into the ALNS. In the arc frequency history removal heuristic, proposed by Masson et al. [23], the aim is to remove tasks that seem to be at bad positions compared to the best known solutions. The heuristic keeps track of how often each arc (connection between two locations) appears in any one of the solutions contained in a fixed-size set composed of the best solutions found so far. In each ALNS iteration, if a solution enters or leaves this set, the frequencies of the arcs in this solution are incremented or decremented accordingly. When the arc frequency history removal heuristic is selected, a frequency value is computed for each task by summing up the frequencies of the arcs over which the pickup and the delivery locations of the task are reached and left in the current solution. Then, with a certain amount of randomness as proposed by Ropke and Pisinger [35], the tasks with the lowest frequency values are removed. The zero-split removal heuristic, proposed by Parragh et al. [28], removes sequences of task locations where the vehicle is empty when reaching the first location and when leaving the last. Longer sequences are preferred, and the removed tasks are reinserted one by one. Finally, the subroute removal heuristic, as its name implies, removes entire subroutes, which are selected at random. 'Removing a subroute' means that all tasks with at least one location on the subroute are removed. The removed tasks are reinserted one by one in this heuristic, too. The worst and Shaw removal heuristics exist in a static and a dynamic version. In the static versions, the removal criteria are computed anew only once in an ALNS iteration, in the dynamic versions, they are updated after each removal of a single task. The removal criterion for a task in the worst removal heuristic is the difference in the costs of the current solution with and without the task. The Shaw removal operator uses, for each pair of tasks, a relatedness measure that takes into account the distances between the pickup locations, the distances between the delivery locations, the overlap of the time windows of the pickup locations, the overlap of the time windows of the delivery locations, and the difference between the capacity requirements of the two tasks. In lieu of the noise mechanism used by Ropke and Pisinger [35], the ALNS uses insertion preference strategies. In each iteration of a reinsertion heuristic, one of the following five strategies is randomly selected and applied before deciding which task to insert into which route: (i) make the insertion of tasks where the pickup location can be visited with a trailer more attractive; (ii) similar for tasks where this is not the case; (iii) make the insertion into single lorry routes more attractive; (iv) similar for LTC routes; (v) make it more attractive to insert tasks where the pickup location can be visited with a trailer into LTC routes. This is achieved by appropriately modifying the insertion costs of tasks into particular routes. When, in an insertion step, the creation of a new subroute must be tested, which is necessary if a location not reachable by trailer is to be inserted directly after a location that is left with the trailer coupled, a suitable PTL must be selected. The ALNS does not necessarily choose the PTL closest to the task location in question. Instead, similar to what is done in the removal heuristics, a certain degree of randomness is introduced, with closer PTLs being selected with higher probability. Apart from that, the decisive modification to the ALNS as described by Ropke and Pisinger [35] is that the time window and capacity feasibility tests described in the next section are used; these take into account trailers and accessibility restrictions.

Feasibility Tests
In the following, techniques are proposed to test the temporal and capacitive feasibility of task insertions into routes performed by single lorries or LTCs in constant time, given appropriate auxiliary data computed in a preprocessing step. (In a slight abuse of terminology, 'amortized constant time' is abbreviated by 'constant time' here and in what follows.) As will be shown, the preprocessing to determine or update the necessary auxiliary data for a route to test time window as well as capacity feasibility takes time quadratic in the number of tasks fulfilled or locations visited on the route, but it is performed only once for a given solution. The resulting data are then used for all feasibility tests, i.e., for testing all potential insertion positions of all unplanned tasks. The routines are embedded in the ALNS metaheuristic described in the previous section. They could, however, also be used within other metaheuristic or local search approaches. In this section, the following notation is used. Each task t from pickup location p to delivery location d is denoted by t = (p, d) and has a capacity requirement q t > 0, which means that q t units of load must be picked up at p and −q t units must be delivered at d. The capacity requirement at each location u is denoted by q u . Hence, q p > 0 for each pickup location p, q d < 0 for each delivery location d, and q u = 0 for each vehicle depot or PTL u. Each location u has a single, hard time window [a u , b u ], 0 ≤ a u ≤ b u ≤ T, where T is the length of the planning horizon. The depot locations have a time window of [0, T]. Each task location u has a unique service time (duration) s u , and each PTL u has a decoupling duration (including a fixed time for a potential load transfer) of s dec u and a coupling duration of s cou p u . For each pair (u, v) of locations, t uv denotes the travel time from u to v. Each single lorry, each LTC lorry, and each trailer has a specified onedimensional capacity, denoted by Q l k and Q t k respectively. For a single lorry k, Q t k = 0. The symbol '==' serves as equality operator, '=' is the assignment operator, and 'x += y' is used as shortcut for 'x = x + y'. The descriptions assume that feasibility of an insertion of a task t = (p, d) into an existing route r = (0, 1, . . . , n−1, n), with p to be inserted directly after position (zero-based index of the route) h and d to be inserted directly after position i, is to be tested. If p cannot be reached with a trailer, r is performed by an LTC, and the trailer is attached upon leaving h, a location triplep = ptl p → p → ptl p corresponding to a new subroute is inserted after h; similar for i and d. ptl p is a suitable trailer parking location; similar for d. Note that p, d, ptl p , ptl d ,p, andd are locations, whereas h and i are indices on a route. To simplify notation, when referring to a location visited at a certain position on a route, only the index is used: for example, the start of the time window of index i, i.e., of the ith location visited on a route, is denoted by a i , and the travel time between index i and a to-be-inserted location v is denoted by t iv etc. Indices h and i indicate positions in the route before p and d are inserted. Hence, if h == i, then d is to be inserted directly after p, or, if a triplep = ptl p → p → ptl p is to be inserted, directly after the triple. If, however, d cannot be reached with a trailer and p is left with the trailer attached or a triplep is to be inserted, then a tripled = ptl d → d → ptl d is inserted. In principle, if h == i and p or d must be surrounded by a decouple-couple pair, it would also be possible to surround both p and d by one pair. This might be beneficial for instances where many pickups are close to their deliveries. For simplicity of exposition, this additional possibility is not considered in the present paper. When this option is used, constant-time feasibility tests are just as well possible with the auxiliary data structures described in the following subsections; the formal description, though, is tedious. Moreover, in the course of an ALNS, configurations where it is beneficial that the pickup and the delivery of a task are surrounded by a decouple-couple pair will often be achieved automatically as a result of the removal steps. Several consecutive subroutes by one LTC lorry at the same PTL are modelled by inserting a decouple-couple pair for each subroute. It is assumed that the fixed service times at PTLs are incurred also in such cases.

Time Windows
In this paper, neither route duration constraints nor time-dependent costs are considered and thus there is no need to strive for minimization of route duration. Under these conditions, it is optimal regarding feasibility to consider only as-early-as-possible schedules, i.e., to assume that a vehicle always leaves a location at the earliest possible point in time; this provides the maximum possible flexibility at subsequent positions on the vehicle's route. Testing time-window feasibility of an insertion in linear time is trivial: the locations of the to-beinserted task are tentatively inserted (including PTLs for decoupling and coupling, if necessary); the route is traversed, starting at the depot at time zero; travel, service and waiting times are added; finally, the resulting earliest possible starts of service are compared with the location time windows. Testing time-window feasibility in constant time is a little more involved. To do so, Savelsbergh [39] introduced the concept of forward time slack (FTS). The FTS at a position on a route indicates by how much the earliest possible start of service at this position can be postponed without violating a time window at this or a subsequent position on the route. This idea is adapted to test the feasibility of the insertion of a pickup-and-delivery task (p, d) into a PDPTWT route r = (0, . . . , n) as follows. First, note that a tripleũ = ptl u → u → ptl u can be regarded as a meta-location or segment (cf. Irnich [16], Vidal et al. [43]) and handled as if it were a single location. Hence, whenever the insertion of a tripleũ needs to be tested because the task location u cannot be reached with a trailer, the time window of the corresponding meta-location is tested. (However, when an insertion of a triple for a location u is to be actually performed, the sequence ptl u → u → ptl u must be inserted, because the new subroute created by inserting the triple might be enlarged by an insertion of a task location in a later iteration.) The time window [aũ, bũ] of a meta-location need be precomputed only once, before the start of the ALNS, for each task location u and each PTL ptl. This can be done by setting If aũ > bũ, then ptl cannot serve as parking location for visiting u. Otherwise, the service time sũ of a meta-locationũ is set to The travel times to and from a meta-locationũ are those to and from ptl u . The travel costs toũ are those to ptl u for a lorry with its trailer plus those from ptl u to u plus those from u to ptl u , both for a lorry without its trailer. The travel costs fromũ are those from ptl u for a lorry with its trailer. Second, the following auxiliary data are used: e i : Earliest point in time at which service at index i can begin. The first four quantities are computed for each route in a preprocessing step as follows: The FTS can then be computed as f i = min j=i,...,n (sl j ) for i = 0, . . . , n. The computation or update of the first four auxiliary data structures requires linear time in n; the FTS computation time is quadratic in n. Given these data, time-window feasibility of an insertion can be tested as described in Algorithm 1 (cf. Masson et al. [24]). Note that it is sufficient to execute lines 1-7 of Algorithm 1 only once for each h with a given PTL ptl p . If TestTimeWindows returns false in line 7, it makes no sense to test further insertion positions for d with h as insertion position for p orp, because neither p norp can be inserted after h or later on r; hence, the next position for inserting p can be considered. Due to the limited planning horizon, if a task location not reachable by trailer is to be inserted at a certain position on a main route, i.e., when a new subroute must be created, in principle all PTLs must be tested for whether an insertion at this position is possible. This, of course, increases the running time of an insertion heuristic. However, if only a subset of all PTLs is considered, an insertion heuristic may miss some feasible solutions, and the solution quality of the overall algorithm may deteriorate. The time window feasibility test described in Algorithm 1 receives as input a particular choice of PTL for the pickup and for the delivery location. Therefore, the test is exact in the sense that it will correctly consider the insertion of a specific triple ptl v → v → ptl v feasible if and only if the insertion of this specific triple is feasible. If several PTLs shall be considered, Algorithm 1 must be embedded in a loop over these PTLs.

Capacities
Time-window tests are the same for single lorry as well as LTC routes: at each position on a route, the earliest start of service must lie within the time window of the respective location. By contrast, the presence of trailers requires additional capacity tests for LTC routes compared to single lorry routes. In this section, it is first described verbally what must be tested in linear-and constanttime capacity tests. Afterwards, the linear-and constant-time test routines are presented. At each position of single lorry routes and main routes of LTCs, the total load balance, which is the difference between the load picked up on the route so far minus the load delivered so far, must be less than or equal to the lorry plus the trailer capacity. For capacity considerations on subroutes, the following two quantities are relevant: • The minimal lorry load at decoupling, i.e., the minimal load that must inevitably be in the lorry upon leaving the decoupling location. This load is equal to the maximum of the following two values: -The difference between the total load balance at the decoupling location and the trailer capacity. -The sum of the capacity requirements incurred by the deliveries on the subroute whose pickups lie before the subroute. (This value is nonnegative, so that the minimal lorry load at the decoupling location is nonnegative as well.) • The subroute load balance at each position, i.e., the difference between the sum of the load in the lorry at the start of the subroute plus the load picked up on this subroute so far minus the load delivered on this subroute so far. (The subroute load balance can be positive, zero, or negative.) A subroute is capacity-feasible if and only if the first quantity is less than or equal to the lorry capacity and the value of the second is nonnegative and less than or equal to the lorry capacity at each position.

Testing Capacities in Linear Time
To test capacity-feasibility of an insertion in linear time, the procedure detailed in Algorithm 2 is used. For simplicity, the vehicle index k is omitted: Q l and Q t are used instead of Q l k and Q t k to denote the lorry and the trailer capacity. Testing capacity in linear time for single-lorry routes is simple: the to-be-inserted task is tentatively inserted, one pass over the route is performed, and the capacity requirement at each position is added to the total load and compared with the lorry capacity (lines 2-6). Testing capacity for LTC routes is not entirely straightforward even in linear time. As discussed above, it must be known at the start of a subroute how much load must be in the lorry to be able to perform the deliveries whose pickups are not on this subroute. This information is gathered in one forward pass over the route (lines [11][12][13][14][15][16]. (In reality, it is of course not enough to have this amount of load in the lorry at the start of a subroute. It is also necessary to have the right commodities aboard the lorry, those that must be delivered on this subroute. This, however, has to be ensured by the driver. For algorithmic planning, it is sufficient to test whether enough loading capacity is available on the lorry.) The second pass (lines 20-38) then performs the actual capacity test on main routes and subroutes (total load at all positions, minimal load at decoupling positions, subroute load balance at all positions on subroutes).

Testing Capacities in Constant Time
To test the feasibility of the insertion of a pickup-and-delivery task (p, d) in constant time, the following data, computed for each route in a preprocessing step, can be used.  Index  0  1  2  3  4  5  6  7  8  9  10 11 12 13 Capacity 0 +40 +10 0 +10 +20 -40 +5 -10 0 -10 -20 -5 0 requirement This route contains one subroute, which starts at index 3 and ends at index 9, i.e., the zero value at index 3 corresponds to a decoupling process at some PTL, and the zero value at index 9 represents the associated coupling process at this PTL. The load balances at indices 2 to 6 are +50, +50, +60, +80, and +40; thus, MaxTotalLoadOfSegment MaxTotalLoadOfSegment and MaxLoadBalanceFromStartOfSubroute can be filled using a nested forward pass, i.e., by iterating over all indices j ≥ i for each index i on the route. All other data structures described above can be filled or updated by passing through a route once. This means that all necessary preprocessing data for a route can be computed in quadratic time in the number of tasks on the route. Given these data, the capacity feasibility of an insertion of a task t = (p, d) into an existing route r, with p to be inserted directly after position (zero-based index of the route) h and d to be inserted directly after position i, can be tested as described in Algorithm 3. It is evident that the algorithm itself runs in constant time, i.e., its running time is independent of the number of tasks or the number of locations visited on route r. Note that, to test the capacity constraints, it is irrelevant whether or not the pickup and/or the delivery location of the task to be inserted must be surrounded by a decouple-couple pair for insertion at the position in question, as decoupling and coupling processes have a capacity requirement of zero.
Note further that, similar to the situation in Algorithm 1, if TestCapacityConstant returns false from line 3 or line 18, it is unnecessary to consider further potential insertion positions for d for the current insertion position of p. Instead, the next position for inserting p can be considered. Hence, it is sufficient here to execute lines 2-18 of Algorithm 3 only once for each h.

Benchmark Instances
To this author's knowledge, there are no benchmark instances for the PDPTWT as studied in this paper. Therefore, a set of instances has been created to perform computational experiments with

Algorithm 3 TestCapacityConstant(p, d, r, h, i, k)
Input: Pickup-and-delivery task t = (p, d) with capacity requirement q > 0 Route r = (0, 1, 2 34 return true solution procedures. A well-known and widely used set of benchmark instances for pickup-anddelivery problems with time windows and without trailers has been proposed by Li and Lim [21] and is available at www.sintef.no/projectweb/top/pdptw/li-lim-benchmark. This set comprises six classes of instances, with 100, 200, 400, 600, 800, and 1,000 task locations, and thus with 50, 100, 200, 300, 400, and 500 tasks respectively. The instances have been derived from the Solomon instances for the vehicle routing problem with time windows (Solomon [41]), and in analogy to the original data, the Li and Lim instances are also partitioned into six classes LC1, LC2, LR1, LR2, LRC1, and LRC2 according to structural characteristics as follows: 'C' stands for geographically clustered tasks which, for the PDPTW and the PDPTWT, also means that the pickup and the delivery location of a task are close together; 'R' stands for geographically randomly distributed tasks; '1' stands for restrictive time windows so that only few tasks per route are possible; and '2' stands for less restrictive time windows and a longer planning horizon, which makes longer routes (routes covering more tasks) possible. Each instance has a homogeneous fleet, and start and end depot location of the vehicles coincide. As pointed out by Derigs et al. [8], p. 544, some benchmark instances for vehicle routing problems with trailers are constructed such that there is no need to use lorry-trailer combinations at all, because the capacity of the lorry is high enough for transporting the entire demand and/or the time windows are so restrictive that a vehicle cannot serve many customers. This has also been observed when trying to modify the Li and Lim instances for use with trailers. Therefore, the benchmark instances for the PDPTWT have two vehicle classes: lorry-trailer combinations and single lorries. The single lorries have artificially high fixed cost, so that they are used only when necessary to ensure that all tasks are covered. Such cases can occur when the time windows of a task are so tight that there is not enough time to decouple the trailer to visit the pickup or the delivery task. With this in mind, the Li and Lim instances have been adapted to the PDPTWT as follows: • Every even-numbered location (as listed in the original Li and Lim instance file) is reachable by trailer, i.e., locations 0, 2, 4, 6. . . ; the odd-numbered ones are not. • Starting with location 0 (the depot), every second location that is reachable by trailer may be used for parking and transshipment; i.e., for locations 0, 4, 8, 12. . . , a PTL is created. This means that the number of PTLs is approximately half the number of tasks. • As mentioned, the time windows of task locations are generally too short in the Li and Lim instances, so that no LTCs are used. Therefore, each original time window [a u , b u ] of a task location u is enlarged to a u = max(0, a u −TWShift) and b u = min(b u +TWShift, T), where TWShift = 100 + (AvgPickupTime + AvgDeliveryTime)/2 , and AvgPickupTime and AvgDeliveryTime respectively indicate the arithmetic mean of the service times at pickup and at delivery locations as indicated in the original files, rounded down to the nearest integer. • The time windows of parking and transshipment locations are set to the complete planning horizon, i.e., to the time window of the depot. According to the author's practical experience, this is a mild and realistic assumption. • The decoupling and coupling service times at PTLs are set to AvgPickupTime and AvgDeliv-eryTime respectively. • The number of single lorries as well as the number of LTCs is considered unlimited. • Single lorries are assigned a fixed cost of 1,000; LTCs have no fixed cost. • As in the Li and Lim instances, Euclidean distances are used for travel times as well as travel costs. For LTCs, travel times and costs are the same whether or not the trailer is currently attached. • Capacities of single and LTC lorries are set to the vehicle capacity specified in the respective original instance; trailer capacities are set to 150 % of the lorry capacity. There is an arc between two locations u and v, i.e., a location v can be visited directly after a location u, unless a u + t s u + t uv > b v , where t s 0 = 0 for the depot location 0, t s u = s u for all task locations u, and t s u = min(AvgPickupTime, AvgDeliveryTime) for all PTLs u. Table 1 shows the distribution of the number of instances of the different types and basic instance characteristics. Note that the number of tasks differs slightly between instances of the same size

Results
The code was programmed in C++ and compiled with Microsoft Visual Studio Enterprise 2017, Version 15.5.3. The experiments were run on a workstation with the Windows 10 Education operating system, an Intel Xeon E5-1660 v3 @ 3.00 GHz CPU, and 64 GB RAM in single-thread mode. The parameters used in the ALNS are listed in Table 3 in the Appendix.
To assess the relative performance of the linear-and the constant-time test, 10,000 ALNS iterations were performed with both tests for all instances of size classes 100, 200, and 400, i.e., those with at most 200 tasks. For the larger instances, computation times using the linear-time test became too long, so that, for size classes 600, 800, and 1,000, only the constant-time test was used. For the linear-time test, the time windows are tested together with the capacities in the loop of line 3 or 19 in Algorithm 2. The constant-time test first examines time window feasibility, then capacities. Aggregated results are shown in Table 2; detailed results by instance are given in Tables 4-9 in the Appendix.
The most important finding that can be read from Table 2 is that the speedup of the constant-time test compared to the linear one is considerable for all instance types and ranges from a factor of nine to a factor of 142, with an average of 38. This demonstrates that the effort of implementing the constant-time test is well justified. Further insights that can be obtained from the data in Table 2 are: • The larger the instance, the higher is the iteration number where the best solution was found.
• The number of routes in the best solution found can differ significantly between instances of the same size class and type. • As LTC routes have no fixed cost, most routes are actually LTC routes. This also shows that the instances are a suitable test bed for routing problems with trailers (remember the comment on page 13). • In particular for the larger instances with long planning horizon and wide time windows, the number of subroutes greatly exceeds the number of LTC routes, meaning that the average LTC route performs more than one subroute. Most PTLs are used only once. • The running times for the instances with more tasks per route, i.e., fewer routes, are consistently higher than those for the other instances. • The speedup for the LR and LRC instances increases with increasing instance size; for the LC instances, this is not the case. • The speedup is significantly greater for the instances with fewer routes (classes with '2').

Conclusions and Outlook
This paper has studied the PDPTWT, a routing problem which aims at fulfilling a set of transport tasks between pickup and delivery locations, subject to time window constraints and accessibility restrictions, by means of a fleet consisting of single lorries and lorry-trailer combinations. Procedures to test the temporal and capacitive feasibility of inserting a task into an existing route have been presented. Given adequate data computed in a preprocessing step, these procedures run in constant time. They have been embedded in an adaptive large neighbourhood search algorithm for the heuristic solution of the PDPTWT. A comprehensive set of benchmark instances has also been created. The results of computational experiments are presented which show significant speedups that can be realized with the constant-time feasibility test. Topics for further research abound. As the focus of the research presented here was on efficient feasibility testing, not on solution quality, many options exist regarding algorithmic refinements to improve solution quality of the ALNS. First of all, local and/or very large-scale neighbourhood search routines could be added, as done, e.g., by Derigs et al. [8] and Gschwind and Drexl [15]. Also, matheuristic components, e.g., solving a set-covering problem with all generated routes at the end of the ALNS, cf. Parragh and Schmid [29], Villegas et al. [45], could be helpful. Another refinement would be to add a splitting procedure based on dynamic programming that finds optimal PTLs for given routes, cf. Prins [31] and Villegas et al. [44].
Regarding modelling extensions, many additional practically relevant constraints could be taken into account. Two particularly interesting extensions are loading constraints such as last-in-firstout, and the impossibility of transferring load between an LTC lorry and its trailer. Of special relevance in connexion with constant-time feasibility tests are limits on route duration and on the time or the number of intermediate stops between the pickup and the delivery of a task. Loaddependent service times require an optimization of the load transfer amounts from lorry to trailer at decoupling and coupling locations, a considerable additional intricacy. Time-dependent costs (and route duration constraints, too) lead to the difficult situation that an as-early-as-possible schedule need no longer be optimal (Savelsbergh [39]), thus violating a fundamental assumption on which the feasibility tests described in the present paper are based. Also other variants of pickup-and-delivery problems, such as one-to-many-to-one problems (also called vehicle routing problems with backhauls, Irnich et al. [19]), many-to-many, and simultaneous PDPs (Battarra et al. [2]), lend themselves to consider a fleet containing trailers. Furthermore, in many pickup-and-delivery applications, the possibility or even the requirement to split tasks exists (cf. the survey by Drexl [11] and the more recent papers by Masson et al. [24] and Grangier et al. [14]). This means that a task t = (p, d) can be decomposed into two subtasks or legs, (p, tl) and (tl, d) at transshipment locations tl. The legs of split tasks can be performed by different vehicles, and this creates an interdependence between routes: changes in one route may make one or several or all other routes infeasible. This interdependence requires a synchronization regarding time and load and, when trailers are considered, leads to the PDPTWT with synchronization.
Of course, all of the above extensions and variants can also be considered in a dynamic and/or stochastic context, where some information becomes known only after execution of a route plan has begun and/or some data are known only in the form of random variables, cf. Berbeglia et al. [4] and Flatberg et al. [12]. Finally, there is yet no exact algorithm for solving the PDPTWT. Computing optimal solutions to larger PDPTWT instances is surely a challenging but worthwhile endeavour.

Appendix
The subsequent Table 3 specifies the parameter settings of the ALNS used for the computational  experiments. The following Tables 4-9 present the detailed computational results for each of the benchmark instances with these settings. Table 2 was compiled based on these data. Euclidean distances were computed with full double precision, 10,000 iterations were performed, and the objective function values were rounded to three digits.