1 Introduction

E-commerce currently appears to be one of the fastest growing marketing channels for different kinds of products and services for consumers. Online sales of goods in the European Union amounted to approximately 200 billion euros (B2C only) in 2014 and may double in the next five years with annual growth rates above 15% per year (Prologis 2015), which has resulted in a rapid growth in parcel delivery. With the growth of e-commerce in distribution channels, deliveries will likely become more fragmented than ever with a large number of small-to-medium packages that need to be delivered to customer’s locations rapidly (Fatnassi et al. 2015). Although a “last-mile” delivery service is convenient for the customer, it creates significant logistical challenges for shipping companies, one of which is the allocation of large load capacity to address small volume demands (Montreuil 2011). A larger fleet size increases congestion and environmental problems in urban areas. The INRIX Traffic Scorecard Annual report shows that countries with strong economic growth in 2014, such as the US, Germany, Ireland, Switzerland and Luxembourg, all experienced increased gridlock on their roads. In the US, for instance, 6.9 billion hours of US drivers’ extra time and 3.1 billion gallons of fuel, which is approximately 160 billion US dollars, are wasted in traffic congestion (Schrank et al. 2015). The road transport sector also plays an important role in world energy use and emissions of greenhouse gases. Up to 30–40% of road sector CO\(_2\) emissions come from road freight transport (ITF 2010; IPCC 2014).

As a result of the ever-growing conflict between the increasing demand for mobility and limited resources, shared transport practice has gained a lot of attention recently. It focuses on making joint use of transport resources, between passengers and goods flows. Trentini and Mahléné (2010) provide an overview of solutions for combining passenger and freight transportation used in practice. Large retailers such as Walmart and Amazon are also considering crowdsourced parcel services (Barr and Wohl 2013; Reilly 2015). As shared economy is increasingly in the spotlight, related strategic and operational aspects of providing integrated transportation services for both people and freight have received academic attention. Several attempts to develop such integrated models have been made. Li et al. (2014) and Nguyen et al. (2015) consider problems in which people and parcels are handled in an integrated way by the same taxi network. Ghilas et al. (2013) study the possibility of transporting freight by public transport, which operates according to predetermined routes and schedules. Similarly, Masson et al. (2014) design a two-tier distribution system that uses spare capacity of the buses combined with a fleet of near-zero emission city freighters to deliver parcels to shops and administrations located in congested city cores. In addition, Fatnassi et al. (2015) investigate the potential of integrating a shared goods and passengers on-demand rapid transit system in urban areas. Presumably due to the computational complexity, the prevailing literature focuses on the driver-parcel matching problems where parcels cannot hop (be transferred) between drivers. Our research fills this gap and explores People and Freight Integrated Transportation (PFIT) problems with the consideration of multiple hops. As a result, drivers and parcels can be matched without requirements of sharing a similar destination or parcel destination that are positioned on or near the driver’s route. Instead, parcels can move towards their destination one hop at a time. The multi-hop principle makes our approach suitable for instances with longer distances, such as intercity transportation.

From the standpoint of a shipping company (or a consortium of shippers), this paper considers a problem where the shipper provides freight transportation services via a pool of approved drivers with spare capacity. This crowdsource business setting has a potential cost advantage because thousands of drivers are commuting between home and businesses with spare space in their cars, and those drivers pay for their own cars, gas, insurance, and maintenance. It also creates opportunities for faster deliveries and thus enhances customer satisfaction. Traditionally, for a shipping company’s business-to-customer (B2C) model to be profitable, a critical mass of customers need to be engaged for the provision of the service. Having the crowd as potential means, the time and effort necessary for arranging economically sustainable delivery may be substantially less.

From the ecological and social standpoint, this paper can provide desirable logistics solutions that exploit unused capacities along the existing transportation flows of the crowd. The resulting deliveries require less parcel-miles, which may help alleviate the traffic congestion problem and reduce emissions. The booming development of e-commerce results in fragmented package logistics, since the number of single parcel deliveries is growing (Rougès and Montreuil 2014). As such, a more direct connection between parcel-miles and vehicle-miles for parcel delivery can be foreseen, which makes the proposed model more attractive from the perspective of reducing the ecological impact of logistics. Although it is out of the scope of this paper, we would like to point out that crowdsoured shipping can also be used to provide peer-to-peer (P2P) delivery, as seen recently with examples as Deliv, Walmart and Amazon. Such a delivery platform is considered by Arslan et al. (2016). We would also like to comment on the environmental and social benefits of crowdsourced shipping. Without the condition of using the existing vehicle flows, such services (e.g., Uber) may also induce additional movements and thus do not necessarily reduce congestion and air pollution.

The goal of this paper is to provide the means for a shipping company (or a consortium of shippers) to match its demand for freight transportation with people transportation with a particular focus on using spare capacities of the existing private vehicle flows with the objective to minimize the total cost of delivering all the parcels on time. To achieve this goal, we present a mixed integer programming formulation for matching and scheduling such a combined system. Considering the combination with existing planned routes of the drivers, we limit our attention to the offline problem: given all drivers and known delivery requests (i.e., origin, destination, earliest departure time and latest arrival time), find an optimal plan to deliver all the parcels on time, ignoring possible future request. In contrast to P2P platforms where users usually expect a direct response, we focus on periodic planning to benefit from resource consolidation, which makes sense from a shipper’s perspective. The offline setting enables us to batch incoming requests smartly and facilitates the multi-driver multi-parcel matching. Even a driver with a completely different destination can take the parcel to an intersection where the parcel could be transferred to other vehicles that travel closer to the destination. Furthermore, we provide two heuristics for solving non-trivial problem instances of the considered NP-hard optimization problem, which are the time compatibility based heuristic and the time expanded graph based heuristic. These heuristics use different approaches to handle timetable information of the drivers. As a result, they deviate from the exact solution approach due to the consideration of different solution spaces and also require different levels of computational efforts. In this paper, we explain the pros and cons of both heuristics and provide an extensive experimental comparison of the two approaches.

The remainder of the paper is organized as follows. In the next section, we position our research in the context of the relevant literature. After introducing the Multi-Driver Multi-Parcel Matching Problem (MDMPMP) in Sect. 3, the mixed integer programming formulation is presented in Sect. 4. We propose two heuristics for solving the MDMPMP in Sect. 5. Section 6 presents the experimental settings. Section 7 reports the results obtained from extensive computational experiments. The paper ends with concluding remarks in Sect. 8.

2 Literature review

As far as the application is concerned, the design and planning of the driver-parcel matching problem described in this paper falls into the field of People and Freight Integrated Transportation problems (PFIT problems). Despite the increasing interest in practice, an integrated people and freight transport solution to short-haul (intra and intercity) transportation has not been sufficiently taken into consideration in the literature (Lindholm and Behrends 2012; Ghilas et al. 2013). Three ways of integration (i.e., public transport, taxi, and private vehicles) are proposed in the literature. We subsequently discuss each of them in the following paragraphs.

Public transport, such as bus, train, metro and other light rail systems, operates according to predetermined routes and schedules. Ghilas et al. (2013) investigate the opportunity of making use of available public transport as a part of the freight journey of logistics service providers, which operates according to predetermined routes and schedules. An arc-based mixed integer program is presented and it is amenable to solve by CPLEX. The numerical analysis shows significant reductions in operating cost and carbon dioxide emission, and the potential for mitigating traffic congestion. Along the same vein, Shen et al. (2015) conduct a case study on the Yuantong Express, one of the major national logistics enterprises in China, to explore the feasibility of the proposed public transit-based freight system using the existing bus network in Zhenjiang City in China. Such an integrated system results in a significant reduction in the fleet size required for good delivery service. Masson et al. (2014) design a two-tiered distribution system that uses the buses spare capacity combined with a fleet of near-zero emissions city freighters to deliver parcels to shops and administrations located in congested city cores.

A taxi carries passengers and(or) parcels between locations of their choice, which differs from the abovementioned modes of public transport where the pick-up and drop-off locations as well as the schedules are determined by the service provider. Li et al. (2014) propose to integrate parcel transportation into a taxi service, which is defined as the Share-A-Ride Problem, an extension of the dial-a-ride problem. For the sake of reducing the computational complexity, they also propose a method to optimize the insertion of parcel requests into the predefined taxi routes. Nguyen et al. (2015) build upon the model from Li et al. (2014) and conduct a case study on the Tokyo-Musen Taxi company in Tokyo city. Typically, a taxi driver has to comply with the service levels for both the passenger and the parcels. In common practice, parcel deliveries should not interfere with passenger transport, the core business of running a taxi.

When it comes to private vehicles, drivers have absolute control of the routes and schedules, and parcels can never travel without a driver. A closely related work by Arslan et al. (2016) studies the incorporation of crowdshipping into the last-mile delivery system within an urban area. The differentiating feature of our work is the consideration of transfers, which makes our approach typically more suitable for instances with longer distances, e.g., transport between urban areas. To support this, we have to make sure that parcels are not left unattendedly due to the presence of transfers. These requirements strengthen the interdependency between drivers and parcels.

Methodologically, our research belongs to the family of ride-sharing problems, and more specially the multiple driver, multiple rider arrangement (Agatz et al. 2012). Gruebele (2008) describes such multi-hop and multi-passenger routing systems in detail. Herbawi and Weber (2011) consider a single rider version of the multi-hop ride-sharing problem where drivers do not deviate from their routes and schedules. As such, the set of drivers’ routes form the transportation network for the rider who aims at minimizing time, cost and number of transfers. The problem is modeled as a multi-objective shortest path problem on a time-expanded graph representing the drivers’ offers. They propose an evolutionary multi-objective route planning algorithm to solve the problem, and show that this approach can provide good quality solutions in reasonable runtime. The multi-hop ride-sharing problem is a lot more difficult when also considering the routing of the drivers (Agatz et al. 2012). Herbawi and Weber (2012) extend the previous work to match multiple riders with multiple drivers having time windows and allowing a possible detour from their routes. They propose a genetic algorithm and show that it can be used to solve the model in reasonable time. Drews and Luxen (2013) show that the problem studied by Herbawi and Weber (2012) can also be solved by exploiting time-expanded graphs representing the drivers’ offers. In this paper, we consider a problem with (1) multiple drivers, (2) multiple parcels, (3) time windows, (4) the routing of the drivers, and (5) multiple hops of the parcels. Additional complexity is introduced in our problem due to the requirement of keeping parcels attended all the time.

The contribution of this paper is multi-fold. First, we provide one of the earliest modeling efforts on matching the demand for freight transportation with people transportation by utilizing spare capacities of the existing private vehicle flows. Second, we consider the possibility of transfers, which makes our approach suitable for instances with longer distances. Third, we show that the proposed model can by solved by two very distinct heuristics and provide a comprehensive comparison of the pros and cons of using them.

3 Problem description

As e-commerce grows and evolves, shipping companies need to deliver a large number of small-to-medium freight volumes and home deliveries every day, while thousands of drivers are commuting between home and businesses with spare space in their cars. To reduce shipping costs and efforts, shipping companies consider to pay these independent drivers to deliver the parcels for them on the way. To accommodate the parcels, the driver has to make a detour and make extra stops. The length of the detour and the number of extra stops are determined by the driver’s willingness to extend his trip with respect to both distance and time. Drivers may take a single parcel or multiple parcels (sequentially or simultaneously) along the journey, as long as the capacity of their vehicle is not exceeded. Similarly, parcels may be carried by a single driver from their origins to their destinations or may be transported by multiple drivers and transferred from one to another en route to their destinations. We propose the Multi-Driver Multi-Parcel Matching Problem (MDMPMP) based on the Multi-Hop Ride Sharing Problem.

The MDMPMP is defined on a directed graph \(G = ({\mathcal {N}}, {\mathcal {E}})\), where \({\mathcal {N}}\) is the set of nodes representing the possible locations for departure, arrival or transfer, and \({\mathcal {E}}\) is the set of edges that directly connect two aforementioned locations, i.e., represents the road network. With each edge \((i,j)\in {\mathcal {E}}\), a distance \(d_{ij}\) and a travel time \(t_{ij}\) are associated. Furthermore, we are given a set of drivers \({\mathcal {Q}}\) and a set of parcels \({\mathcal {P}}\). Driver \(q\in {\mathcal {Q}}\) will travel from his origin \(o^Q_q\) to his destination \(w^Q_q\) and \(SP_q\) represents the set of edges belonging to his shortest path from \(o^Q_q\) to \(w^Q_q\). An earliest time \(E^Q_q\) at which he can depart from his origin \(o^Q_q\) and a latest time \(L^Q_q\) at which he has to arrive at his destination \(w^Q_q\) are also associated with driver q. Driver q has \(V_q\) spare space available for parcels. Similarly, each parcel \(p\in {\mathcal {P}}\) will travel from its origin \(o^P_p\) to its destination \(w^P_p\). An earliest time \(E^P_p\) at which it can depart from its origin \(o^P_p\) and a latest time \(L^P_p\) at which it has to arrive at its destination \(w^P_p\) are also associated with parcel p. Each parcel has a volume of \(v_p\).

To cope with realistic requirements, our model has the following features. First, drivers are allowed to deviate from their shortest path to pick up and drop off parcels, as long as their detour is at most a fraction \(\delta\) of their shortest path length, and thus the routing of the drivers also need to be considered. Second, parcels are not allowed to be left unattendedly. As a result, the waiting time of the driver who needs to handover the parcel at a certain station (and thus the subsequent possible paths) depends on the arrival time of the following driver, and so on. Third, parcels are not as time sensitive as riders in the ride sharing problem, as long as they are delivered within the associated time windows. Therefore, assigning longer paths to the parcels may facilitate the system-wide matching. To avoid making too many unnecessary transfers, parcels are not allowed to pass the same node more than once in our model. To avoid departing from their shortest path too much, drivers are also not allowed to visit the same node twice, on top of the aforementioned restriction on the length of their detour. We are aware that multiple visits at the same node might help to reduce the travel distance of a driver for picking up a parcel in some cases, but the possibility as well as the associated impact is limited. Therefore, we make it as a design choice to simplify the problem. We will revisit this assumption at the end of Sect. 4, where we will point out a way to relax this assumption. From an algorithmic viewpoint, the first two features make the assignment of parcels to drivers more complicated because the validation of the possible paths for different drivers are intertwined.

While it costs the shipping company \(c_p\) to deliver parcel p itself, it can also let the crowd do it by paying them a compensation for the service. Our goal is to help the shipper deliver all the parcels on time with minimum overall cost, which consists of (1) the shipping costs, and (2) the compensation for drivers’ traveling cost and inconvenience due to the parcel delivery. Table 1 summarizes all the relevant parameters and variables used in the MDMPMP. For expository purposes, all the edge-related parameters and variables are defined for all combinations of i and j. However, the corresponding values are zeros if \((i,j)\notin {\mathcal {E}}\).

4 Mathematical model for the MDMPMP

In this section, we develop the mathematical model for the MDMPMP from a shipping company’s perspective. In Sect. 4.1, we describe the procedure of finding possible routes for drivers given the maximum detour \(\delta\). This procedure is used to obtain the x matrices in solving the mixed-integer program presented in Sect. 4.2 and to build the subgraph in the time compatibility based heuristic (TC-heuristic) to be presented in Sect. 5.1. As stated in Table 1, each element of x (i.e., \(x_{qij}\)) is a parameter that indicates whether (ij) is an edge that can be used for driver q. This means that \(x_{qij}=1\) if and only if \((i,j)\in {\mathcal {E}}\) and also belongs to the set of paths of driver q, with lengths no more than \((1+\delta )r_q\).

4.1 Finding possible routes

Taking the maximum detour into account, the goal of this subsection is to find all the possible paths for drivers in terms of travel distance. For any driver q, the shortest path \(SP_q\) is found through the unidirectional A* algorithm (Hart et al. 1968). Then, a variant of the depth-first search (DFS) strategy (Cormen et al. 2009) is used to enumerate all possible paths that are no longer than the maximum detour, with respect to the shortest path that the driver is willing to take. These possible paths constitute a subgraph of the original graph. Figure 1 provides an illustrative example for two drivers. Figure 1a is the original graph with 10 stations, where driver 1 needs to travel from Station 1 to Station 8 and driver 2 needs to travel from Station 1 to Station 9. The number associated with each edge represents the travel distance between the two nodes connected by the edge. Each driver is willing to take a detour of at most 10% of his/her shortest path (\(\delta =0.1\)). There are three options to travel from Station 1 to Station 8, which are \(1\rightarrow 2\rightarrow 7\rightarrow 8, 1\rightarrow 2\rightarrow 6\rightarrow 8\) and \(1\rightarrow 3\rightarrow 8\), and the corresponding travel distances are 9, 9.5 and 16, respectively. Since the maximum distance driver 1 is willing to travel is \(9.9 ({=}1.1\times 9)\), only \(1\rightarrow 2\rightarrow 7\rightarrow 8\) and \(1\rightarrow 2\rightarrow 6\rightarrow 8\) are possible paths for driver 1. Therefore, we obtain \(x_{1,1,2}, x_{1,2,7}, x_{1,7,8}, x_{1,2,6}, x_{1,6,8} = 1\), and 0 for the rest of the elements. Similarly, the only possible path for driver 2 is \(1\rightarrow 4\rightarrow 5\rightarrow 9\), and thus \(x_{2,1,4}, x_{2,4,5}, x_{2,5,9} = 1\), and 0 for the rest of the elements. Figure 1b describes the resulting subgraph for the MDMPMP. This procedure efficiently reduces the size of the problem by removing unnecessary edges.

Fig. 1
figure 1

An example of building a subgraph a The original graph b The subgraph

4.2 Mathematical formulation

In this subsection, we present a mixed-integer program for the MDMPMP from a shipping company’s perspective. With this model, the shipping company can determine (1) the optimal matching plan between drivers and parcels for the whole planning horizon (e.g., one day), (2) the optimal path of each driver and each parcel, and (3) the time schedule for the drivers and the parcels to be delivered by independent drivers. Depending on the availability of the drivers, many parcels might still need to be delivered by the shipper itself (see numerical results from Sect. 7). The driver-parcel matching requires a seamless coordination among drivers, parcels, and the freight transportation network, which motivated us to design this MDMPMP model.

Table 1 Parameters and decision variables for the MDMPMP model

The objective is to minimize the overall cost of the shipping company related to the parcel delivery service, which consists of the shipping cost incurred from self delivery and the four weighted costs of compensating the crowd. The compensation includes (1) the transportation cost compensation for the kilometers that the drivers travel with parcels, (2) the risk and inconvenience associated with the number of parcel transfers, (3) the waiting time for transferring parcels, and (4) the extra kilometers traveled. The last two components are the compensation for the system-wide opportunity costs incurred by all the drivers due to the parcel delivery. Accordingly, the objective function in our formulation of the MDMPMP is written as follows. Each of the five terms has a weight attached.

$$\begin{aligned} \min \quad \sum \limits _p c_pW_p&+ w_1\sum \limits _q \sum \limits _p \sum \limits _{i,j} d_{ij}Y_{pqij} + w_2\sum \limits _p\sum \limits _q\sum \limits _{i \ne o^P_p} S_{pqi} \nonumber \\&+ w_3\sum \limits _q \left( \left( A^Q_{q,w^Q_q} - D^Q_{q,o^Q_q}\right) - \sum \limits _{i,j} t_{ij}Z_{qij}\right) \nonumber \\&+ w_4\sum \limits _q\left( \sum \limits _{i,j} d_{ij}Z_{qij} - r_q\right) \end{aligned}$$
(1)

The MDMPMP is confined by two sets of constraints: (1) spatial constraints and (2) capacity and time constraints.

Constraints for spatial issues

$$\begin{aligned}&\sum \limits _j Z_{qij} = 1 \quad \forall q, i=o^Q_q \end{aligned}$$
(2)
$$\begin{aligned}&\sum \limits _i Z_{qij} - \sum \limits _k Z_{qjk} = 0 \quad \forall q, \forall j\in {\mathcal {N}}\setminus \left\{ o^Q_q, w^Q_q\right\} \end{aligned}$$
(3)
$$\begin{aligned}&\sum \limits _i Z_{qij} = 0 \quad \forall q, j=o^Q_q\end{aligned}$$
(4)
$$\begin{aligned}&\sum \limits _i Z_{qij} \le 1 \quad \forall q,j\end{aligned}$$
(5)
$$\begin{aligned}&Z_{qij}\le x_{qij} \quad \forall q,i,j\end{aligned}$$
(6)
$$\begin{aligned}&\sum \limits _{i,j} d_{ij}Z_{qij}\le r_q(1+\delta ) \quad \forall q\end{aligned}$$
(7)
$$\begin{aligned}&\sum \limits _q\sum \limits _j Y_{pqij} + W_p = 1 \quad \forall p, i=o^P_p\end{aligned}$$
(8)
$$\begin{aligned}&\sum \limits _i\sum \limits _q Y_{pqij} - \sum \limits _q\sum \limits _k Y_{pqjk} = 0 \quad \forall p, \forall j\in {\mathcal {N}}\setminus \left\{ o^P_p, w^P_p\right\} \end{aligned}$$
(9)
$$\begin{aligned}&\sum \limits _q \sum \limits _i Y_{pqij} = 0 \quad \forall p,j=o^P_p\end{aligned}$$
(10)
$$\begin{aligned}&Y_{pqij}\le Z_{qij} \quad \forall p,q,i,j\end{aligned}$$
(11)
$$\begin{aligned}&S_{pqj}\ge \sum \limits _i Y_{pqji} - \sum \limits _i Y_{pqij} \quad \forall p,q,j\end{aligned}$$
(12)
$$\begin{aligned}&Z_{qij}, Y_{pqij}, W_p, S_{pqi} \in \{0,1\} \quad \forall p,q,i,j \end{aligned}$$
(13)

Constraints (2)–(13) are imposed to find the feasible matches between drivers and parcels based on the spatial information (i.e., origins and destinations). Constraints (2) and (3) ensure that each driver will take one and only one path, and this path is continuous. Constraints (4) ensure that no driver will return to his/her origin. Constraints (5) prevent the drivers returning to already visited nodes. Constraints (6) guarantee that drivers only use edges of paths that comply with the maximum detour constraint. Constraints (7) are the maximum detour constraint for the drivers. By Constraints (8) and (9), each parcel will be delivered from origin to destination either by drivers or by the shipping company itself. Constraints (10) ensure that no parcel will return to its origin. Constraints (11) ensure that the parcels that are scheduled to be delivered by drivers cannot travel without a driver. Constraints (12) keep track of the stations where parcels are picked up by drivers. Constraints (13) are domain constraints.

Constraints for capacity and time related issues

$$\begin{aligned}&\sum \limits _p v_pY_{pqij}\le V_q \quad \forall q,i,j \end{aligned}$$
(14)
$$\begin{aligned}&A^Q_{qj}\ge D^Q_{qi} + t_{ij} - M(1- Z_{qij}) \quad \forall q, \forall i\in {\mathcal {N}}\setminus \left\{ w^Q_q\right\} , \forall j\in {\mathcal {N}}\setminus \{o^P_p\}\end{aligned}$$
(15)
$$\begin{aligned}&D^P_{pi}\ge E^P_p (1-W_p) \quad i=o^P_p, \forall p\end{aligned}$$
(16)
$$\begin{aligned}&A^P_{pj}\le L^P_p (1-W_p) \quad j=w^P_p, \forall p\end{aligned}$$
(17)
$$\begin{aligned}&D^P_{pi}\ge A^P_{pi} \quad \forall i\in {\mathcal {N}}\setminus \left\{ o^P_p, w^P_p\right\} ; \forall p\end{aligned}$$
(18)
$$\begin{aligned}&D^Q_{qi}\ge E^Q_q \quad i=o^Q_q, \forall q\end{aligned}$$
(19)
$$\begin{aligned}&A^Q_{qj}\le L^Q_q \quad j=w^Q_q, \forall q\end{aligned}$$
(20)
$$\begin{aligned}&D^Q_{qi}\ge A^Q_{qi} \quad \forall i\in {\mathcal {N}}\setminus \left\{ o^P_p, w^P_p\right\} , \forall q\end{aligned}$$
(21)
$$\begin{aligned}&D^P_{pi} - D^Q_{qi} \le M\left( 1 - \sum \limits _j Y_{pqij}\right) \quad \forall p,q,\forall i\in {\mathcal {N}}\setminus \left\{ w^P_p, w^Q_q\right\} \end{aligned}$$
(22)
$$\begin{aligned}&D^P_{pi} - D^Q_{qi} \ge - M\left( 1 - \sum \limits _j Y_{pqij}\right) \quad \forall p,q,\forall i\in {\mathcal {N}}\setminus \left\{ w^P_p, w^Q_q\right\} \end{aligned}$$
(23)
$$\begin{aligned}&A^Q_{qi} - A^P_{pi} \le M\left( 1 - \sum \limits _j Y_{pqji}\right) \quad \forall p,q,\forall i\in {\mathcal {N}}\setminus \left\{ o^P_p, o^Q_q\right\} \end{aligned}$$
(24)
$$\begin{aligned}&A^Q_{qi} - A^P_{pi} \ge -M\left( 1 - \sum \limits _j Y_{pqji}\right) \quad \forall p,q,\forall i\in {\mathcal {N}}\setminus \left\{ o^P_p, o^Q_q\right\} \end{aligned}$$
(25)
$$\begin{aligned}&D^Q_{qj} - D^P_{pj} \ge -M\left( 1 - \sum \limits _i Y_{pqij}\right) - y_{pj}K \quad \forall p,q, \forall j\in {\mathcal {N}}\setminus \left\{ w^P_p, w^Q_q\right\} \end{aligned}$$
(26)
$$\begin{aligned}&A^Q_{qj} - D^P_{pj} \ge -M\left( 1 - \sum \limits _i Y_{pqij}\right) - y_{pj}K \quad j=w^Q_q,\forall p,q\end{aligned}$$
(27)
$$\begin{aligned}&A^P_{pj} - A^Q_{rj} \ge -M\left( 1 - \sum \limits _k Y_{prjk}\right) - K(1-y_{pj}) \quad \forall q,r\in {\mathcal {Q}},\forall p,\forall j\in {\mathcal {N}}\setminus \left\{ w^P_p, w^Q_r\right\} \end{aligned}$$
(28)
$$\begin{aligned}&D^Q_{qi}, D^P_{pi}, A^Q_{qi}, A^P_{pi}\ge 0 \quad \forall q,p,i\end{aligned}$$
(29)
$$\begin{aligned}&y_{pj}\in \{0,1\} \quad \forall p,j \end{aligned}$$
(30)

Constraints (14)–(30) concern the capacity and time related issues. Constraints (14) are capacity constraints for the drivers. Constraints (15) calculate the arrival times of drivers based on the associated departure times. Constraints (16) and (17) ensure that each parcel that is to be delivered by the crowd departs after the corresponding earliest departure time and arrives before the corresponding latest arrival time. Clearly, the departure time cannot be earlier than the arrival time at the same station, which is considered by Constraints (18). Similarly, the time compatibility issues for the drivers are enforced by Constraints (19)–(21). Constraints (22) and (23) ensure that the departure time of a parcel equals the departure time of the driver who will carry it. Constraints (24) and (25) guarantee that the arrival time of a parcel equals the departure time of the driver who will carry it. Thus, Constraints (22)–(25) ensure the time consistency of a parcel and all the drivers carrying it. Constraints (26) ensure that the departure time of the driver who brought the parcel to a particular node is no earlier than the departure time of the parcel. Constraints (27) deal with the boundary situation of Constraints (26) that the driver who has arrived at his destination with a parcel has to stay until the parcel departs again. Constraints (28) guarantee that the arrival time of the driver who will carry the parcel arrives earlier than the parcel. If \(y=0\), then only Constraints (26) and (27) hold, and if \(y_{pj}=1\) then only Constraints (28) hold. This either/or behavior ensures that parcels are never left unattendedly. Constraints (29) and (30) are domain constraints.

Valid inequalities In addition, we add the following valid inequalities to the model that help us find the optimal solution faster. Although these five sets of constraints are not necessary, the scenarios we tested show that they can reduce the run time by up to 11.6%.

$$\begin{aligned}&\sum \limits _i Z_{qij} = 1 \quad \forall q, j=w^Q_q \end{aligned}$$
(31)
$$\begin{aligned}&D^Q_{qi}\le M \sum \limits _j Z_{qij} \quad \forall q, \forall i\in {\mathcal {N}}\setminus \left\{ w^Q_q\right\} \end{aligned}$$
(32)
$$\begin{aligned}&A^Q_{qi}\le M \sum \limits _j Z_{qij} \quad \forall q, \forall i\in {\mathcal {N}}\setminus \left\{ o^Q_q\right\} \end{aligned}$$
(33)
$$\begin{aligned}&D^P_{pi}\le M \sum \limits _q\sum \limits _j Y_{pqij} \quad \forall p, \forall i\in {\mathcal {N}}\setminus \left\{ w^P_p\right\} \end{aligned}$$
(34)
$$\begin{aligned}&A^P_{pi}\le M \sum \limits _q\sum \limits _j Y_{pqij} \quad \forall p, \forall i\in {\mathcal {N}}\setminus \left\{ o^P_p\right\} \end{aligned}$$
(35)

Constraints (31) ensure each driver will visit the destination once and only once. Constraints (32)–(35) prevent assigning arrival and departure times to the non-visited nodes of drivers and parcels. In fact, Constraints (6) are also valid inequalities, the purpose of which is to restrict a driver from traveling via the other drivers’ possible paths on the subgraph. This set of constraints effectively reduce the actual size of the ILP model.

In closing this section, we remark on how to relax the assumption that any driver cannot visit a node more than once. Instead of using a node-based formulation, we need to use an arc-based formulation with a set of constraints to ensure that every driver does not visit a directed arc more than once.

5 Algorithms

The MDMPMP is an extension of the Share-A-Ride Problem, which is an NP-hard problem. The computational complexity of the MDMPMP motivated us to develop heuristics to efficiently solve the problem. In Sect. 5.1, we propose the time compatibility heuristic (TC-heuristic), the basic idea of which is to assign each parcel to the shortest feasible path in the subgraph, yet checking the time compatibility on the basis of every assignment. These time compatibility checks can be computationally costly, as the dependency of the assignments increases. In Sect. 5.2, we propose the time-expanded graph based heuristic (TEG-heuristic), the basic idea of which is to use a more stable structure to model the timetable information.

5.1 Time compatibility based heuristic

The basic idea of the TC-heuristic is to assign each parcel to the shortest feasible path on the subgraph described in Sect. 5.1, where feasibility is based on the time compatibility and capacity availability between the parcel and the associated drivers on the path. For each object (either a parcel or a driver), there exists a time interval associated with a node, a time range between the earliest possible time to arrive at this node from the origin and the latest possible time to depart from this node in order to arrive at the destination on time. Time compatibility refers to the existence of an intersection between the time interval of drivers and parcels, either two drivers or a driver and a parcel. Figure 2 describes the major steps of the TC-heuristic.

Fig. 2
figure 2

Flowchart of the TC-heuristic

The parcels are sorted in decreasing shipping cost if delivered by the shipping company. As such, the more costly parcels will have bigger chances of being assigned to the crowd. Having the subgraph built, the TC-heuristic finds the shortest path of each parcel on the subgraph. Finding a physical path through the subgraph is not a sufficient condition for a match. In addition to the car capacity constraints, the time constraints of a parcel must also fit those of the drivers’. The major challenge of this heuristic is how to evaluate the time compatibility issue of a parcel and all the drivers who are assigned to deliver the parcel along the way. To this end, we need to construct time intervals of parcels and drivers on each node.

The TC-heuristic utilizes the bidirectional A* search to solve the shortest paths of parcels. For each step, forward and backward, it checks the time compatibility. The lower-bound of a parcel’s time interval in the forward A* search (the upper-bound of a parcel’s time interval in the backward A* search) at a node is represented by the earliest arrival time departing from the origin (destination). Since the path from the current node to the sink in each search direction has not been fixed yet, the time needed to travel to the sink is approximated by the time needed if traveling through “airplane distance”. As such, the exact value of the upper-bound of a parcel’s time interval in the forward A* search (the lower-bound of a parcel’s time interval in the backward A* search) can be estimated as above.

To solve the time compatibility issue for drivers, we introduce the concept of the equivalent time interval associated with a driver at a node, which is the possible time interval for the driver if he would pass the node as part of his route. These nodes do not necessary belong to the feasible paths of the driver. In order to become a “time-compatible” node on a parcel path, the intersection of the parcel’s time interval and the equivalent time intervals of those drivers who have carried the parcel must be non-empty. Figure 3 provides an illustrative example of the time compatibility check. A parcel (P) is requested to be shipped from Node 1 to Node 4. Drivers 1, 2, 3 and 4 (D1, D2, D3, and D4) travel from 1 to 5, 2 to 6, 3 to 7, and 3 to 7, respectively. The numbers in italic are inputs and the rest are obtained via calculation. The time intervals of the parcel and the equivalent time intervals associated with the drivers are calculated. The parcel has been carried by D1 and D2 to Node 3. Spatially, either Driver 3 or Driver 4 can take the parcel from Node 3 to Node 4. By checking the time compatibility at Node 4, \(P\cap D1\cap D2\cap D3 = \emptyset\) while \(P\cap D1\cap D2\cap D4 = (240,250)\ne \emptyset\). Therefore, Node 4 is a time-compatible node associated with PD1, D2 and D4. It is important to mention that the arrival time and the departure time at a node are assumed to be equal, which implies that the drivers do not wait after departure.

Fig. 3
figure 3

Time compatibility

The time compatibility is checked at each step of the algorithm with approximated values and it is checked with exact values when a path is found. If the final check of a path fails, the algorithm keeps searching for more paths, and stops when a feasible path is found or all possible paths have been checked. If no feasible path is found, the parcel will be delivered by the shipping company.

5.2 Time-expanded graph based heuristic

The pairwise time compatibility checks in the TC-heuristic might lead to a combinatorial explosion in realistic problems with more potential meeting points and more transfers. The computational complexity of the TC-heuristic motivated us to develop a second heuristic for solving larger-scale problem instances. In particular, we engineer the MDMPMP by exploiting a dynamic time-expanded graph that is typically used in public transportation to model timetable information.

Given the information associated with a driver q (i.e., \(E^Q_q, L^Q_q, o^Q_q\) and \(w^Q_q\)), we define \(l = \{s_1,s_2,t_1,t_2,q\}\) as an offer with \(s_1,s_2\in S, q\in Q, t_1<t_2, s_1\ne s_2\), meaning that driver q needs to drive from \(s_1\) to \(s_2\), departing at the earliest \(t_1\) and arriving at the latest \(t_2\). Each offer corresponds to a set of possible paths that satisfy this offer. Figure 3 provides an illustration of what an offer is. D4 travels from Node 3 to Node 7, and thus his initial offer is \(\{3,7,50,300,4\}\). After Parcel P is assigned to D4, he has to go from Node 3 to Node 7 through Node 4 within a certain time window, considering of the schedule of D1, D2 and P. Accordingly, his offers are updated as \(\{3,4,170,250,4\}\) and \(\{4,7,240,300,4\}\).

A delivery request contains an origin \(o^P_p\), destination \(w^P_p\), earliest departure time \(E^P_p\), and implicit service window \(L^P_p-E^P_p\). The time expanded graph can be defined by time nodes and time edges. A time node is denoted by a triple (nlt), representing this driver’s offer l at node n at time t. There exists a time node for every departure or arrival of a driver. Each time edge is associated with a weight that is the travel time. Note that on a TEG, a station node is represented by a set of time nodes, which are sorted according to the time of the event they represent. The time-ordered nodes of a station can be connected by so-called transfer edges that model the waiting within the station. For the details of this technique we refer to Drews and Luxen (2013). Here, we focus on the differentiating feature of the TEG-heuristic, compared to the typical TEG method.

The proposed TEG-heuristic can be divided into two parts. First, to use the drivers’ information to build a TEG based on graph G. Second, to greedily assign parcels to drivers’ offers. The critical feature of this approach is that a parcel delivery request is answered by applying some shortest-path algorithm (A* algorithm in our case) to a suitably constructed bigraph (i.e., timetable). As discussed above, parcels may be carried by multiple drivers but cannot be left unattendedly during the transfer. Hence, either the driver who carries the parcel to the transfer point or the driver who is going to pick up the parcel from there is required to wait. Given that the drivers do not have predetermined routes and schedules, this requirement makes the time that a driver has to spend on each transfer point highly uncertain, not only depending on the path he travels, but also on the path of the driver whom he is going to hand over the parcel to. In order to localize the procedure of finding the possible paths for each driver, we apply a fixed “hold time” to each driver who needs to hand over a parcel. Any transfer that takes longer than the “hold time” is not possible. At a potential price of finding less possible paths, forcing the drivers to wait a “hold time” at each transfer enables us to find the possible paths for each driver by considering only his/her own detour and time constraints, which can be efficiently done by any shortest-path algorithm. As we discuss later on, post-processing can be used to reduce the negative impact of the fixed “hold time”. Similar to slotted TEGs, on the other hand, the fixed “hold time” adds some reliability to making transfers and thus reflects arguably more realistic scenarios (Drews and Luxen 2013). Following this idea, we propose a greedy heuristic that incorporates the TEG procedure for the MDMPMP. Figure 4 describes the major steps of the TEG-heuristic.

Fig. 4
figure 4

Flowchart of the time expanded graph based heuristic

The TEG-heuristic simplifies the MDMPMP by letting drivers depart at their earliest departure times. In fact, for the realistic MDMPMP drivers are fine with any postponement of departure as long as they can arrive on time. This discrepancy leads us to develop an improved version of the basic TEG-heuristic, which we call the constrained randomized TEG-heuristic (CR-TEG heuristic). In this algorithm, the initial solution obtained by the TEG-heuristic is then improved by attempting to randomize the departure times of the drivers who have not yet had any parcel assignment. The results are also compared with a fully randomized version (R-TEG heuristic) where we attempt to find the best solution among the independent iterations of the basic TEG-heuristic with randomly generated departure times for all drivers, including those that already have parcels assigned to.

5.3 Discussion

In the previous subsections, we proposed two very different approaches that solve the MDMPMP as shortest-path problems in weighted graphs. The TC-heuristic applies a routing algorithm in a road network, while the TEG-heuristic utilizes the time-expanded graph approach that is typically used to model timetable information in public transportation where the routes and schedules are usually predetermined. As such, the most differentiating feature of the two approaches is whether the decision on a driver’s route and the corresponding time schedule affects the feasibility of another driver’s decision.

Given that drivers’ timetable information are not modeled explicitly in the TC-heuristic, a driver’s time interval at a node not only depends on the path he travels, but also on the paths of the drivers who previously carried the same parcel. Thus, the pairwise time compatibility has to be checked at every step of the heuristic. Such time compatibility checks can be computational costly. Even worse, the fulfillment of all the checks with approximate values cannot guarantee the feasibility of the candidate path in the final check. Very differently, the TEG-heuristic creates a fixed “hold time” as a buffer between any two consecutive drivers along a parcel’s path in order to localize the procedure of finding possible paths for each driver. At a potential price of finding less possible paths, forcing the drivers to wait a “hold time” at each transfer enables us to find the possible paths for each driver by considering only his own detour and time constraints.

In order to reduce the computational complexity, The TC- and TEG-heuristics are not designed to consider all the possible paths of each driver. Under the assumption that drivers do not wait after departure, the TC-heuristic loses feasible solutions with transfers that require waiting time, the impact of which is controlled by adjusting the departure time based on the assignment results, and by minimizing the number of drivers assigned to a parcel. The TEG-heuristic loses possible paths in two ways. First, due to the fixed “hold time” at each transfer, drivers’ effective travel time decreases. Second, drivers are assumed to depart at the earliest departure time in the original TEG-heuristic. Although it cannot regain the lost paths, post-processing may improve the objective value of the existing driver-parcel assignments by re-optimizing the time schedule of the given assignment. To this end, we can run the ILP by using the resulting \(Z_{qij}, Y_{pqij}\) and \(W_p\) from the TEG-heuristic as input. Moreover, these two approaches are greedy algorithms in the sense that they give matching priority to parcels that are more expensive to deliver. As such, the locally optimal assignments eliminate a subset of drivers’ possible paths, which may include the global optimum. In addition, as a starting point, a shortest path algorithm is used by both heuristics as an efficient way to generate possible paths for parcels, which deviates from the fact that parcels are not as time sensitive as people. The heuristics might lead to a better results without this rule. From a different angle, the shipping company may view it as a business opportunity to segment customers by providing even more speedy delivery service.

To summarize, the search spaces of the two heuristics intersect. However, the TC-heuristic tends to be able to generate more possible paths, and thus, it is more likely to find a better solution at the cost of computational effort, especially in small-to-medium instances where number of transfers is rather limited. Considering the potential shortcomings of the TEG-heuristic, we proposed two variants to generate different departure times aiming at mitigating the loss of possible paths, the benefits of which are shown in Sect. 7.

6 Experimental settings

In this section, the experimental settings are described. Our goal of the numerical experiments is twofold. First, we present the features of the MDMPMP and the efficiency gain by integrating crowdshipping. Second, we show that our solution methods can obtain high quality solutions in reasonable time.

Three basic factors affect the complexity of the problem: the number of drivers, the number of parcels, and the maximum detour. Two additional factors that affect the behavior of the model are the spatial distribution of the network and the planning horizon. The experiments reported here are to test the influence of these five factors. The results are analyzed from the standpoints of the shipper, drivers, parcel senders, and the society. From the shipper’s perspective, the most important performance indicator is the total cost spent on delivering all the parcels on time, either by the crowd or by itself. The compensation for drivers relates to the kilometers traveling with parcel(s), the number of parcel transfers, the waiting time during transfer, and the detour distance. Another performance indicator that can show the benefit of our model is the match rate, a ratio between the number of parcels delivered by the crowd and the total number of parcels to be delivered. For drivers, we record the maximum, minimum and mean values of drivers’ extra travel time, as well as the average capacity utilization of a driver’s car. For parcels, the average number of hops is the only performance indicator. In terms of social welfare, we use the parcel-miles saved as an indicator for the reduction of traffic congestion and \(\hbox {CO}_2\) emission. Considering the difficulty in estimating the extent of consolidation for unmatched parcels in practice, we assume that these parcels are delivered by the shipper using a traditional parcel delivery service. As such, this indicator provides an optimistic estimation of the potential social benefit of crowdsourced shipping.

We start the numerical experiments with small-scale networks with graphs of 25 nodes. Two different spatial distributed sets with 25 nodes generated from the Solomon’s benchmark problem R101 are considered: the scattered set and the clustered set. In particular, customer locations 26–50 are used to generate the scattered set, while customer locations 76–100 are used to generate the clustered set. The scattered set nicely represents the characteristics of the evenly-distributed cities, while the clustered set represents a network with city clusters. We multiply the coordinations of these nodes by 3, resulting in an area of \(210\times 210\) kilometers (roughly the size of the Netherlands) and connect them by generating the Delaunay graph (Delaunay 1934) for the two sets of 25 nodes. A Delaunay graph for a set of nodes in a plane is a graph such that no node is inside the circumcircle of any triangle in the graph. It is a geometric spanner with the best upper bound known, that is, the shortest path between any two nodes, along Delaunay edges, is known to be no longer than \(\frac{4\pi }{3\sqrt{3}}\approx 2.418\) times the Euclidean distance between them. This property can be exploited to compute shortest paths efficiently, which allows us to focus on the efficiency of the main operations such as the time to compute a match and the time to add an offer. The Delaunay graph is also used to construct road networks on given sets of nodes by Vckovski et al. (1999), Baccelli et al. (2000) and Liu (2014). The resulting graphs are depicted in Fig. 5.

Fig. 5
figure 5

The two networks used in smaller-scale test problems a Scattered network (SC), b Clustered network (CL)

The Euclidean distance is used to calculate the distances between the connected nodes. Each driver’s earliest departure time is uniformly distributed between 0 and 120 (representing the time window between 8 am and 10 am); his/her latest arrival time is the summation of the corresponding earliest arrival time plus a time slack. Any time slack is assumed to be dependent on the associated driver’s shortest travel distance \(r_q\). We assign a time slack of 30 min to the driver who has the shortest shortest path and a time slack of 120 to the driver who has the longest shortest path. For the rest of the drivers, the corresponding time slack is calculated proportionally based on the length of his/her shortest path. These numbers are reasonable regarding the network used in the experiment. The cost and capacity related parameters are summarized in Table 2. The value of the cost parameters that are used in the experiments are inspired by the real life situation in the Netherlands.

Table 2 Cost and capacity related parameters

In order to study how parcels’ time windows affect the matching performance, we consider three delivery service options, namely, the next-day, the same-day and the urgent delivery options. Table 3 provides a summary of the three delivery options concerning the earliest departure and the latest arrival times.

Table 3 Delivery service options

In order to understand the efficiency of integrating crowdshipping in a more realistic setting, we consider a case that might be faced by a shipping company operating in the Netherlands using the proposed heuristics. The network used in this more realistic case consists of 39 big cities in the Netherlands. Each city is represented by a node on the graph. We assume that transfers can only happen in the cities. All crossings/mergings of the roads within a 5-km radius of each city center are also assumed to be located at the city center as a potential transfer point. The edges between each city pair represent the travel route chosen by Google Maps under the criteria of shortest driving time. The resulting graph is depicted in Fig. 6.

Fig. 6
figure 6

The network used in the realistic case

7 Numerical results

Test instances are solved on an Intel Core i7-4790 3.60 GHz, CPU 8 GB RAM computer. The ILP is solved by using the standard CPLEX 12.4 MIP solver in AIMMS. The TC-heuristic is implemented using Delphi XE7. In order to take advantage of existing open-source libraries and frameworks to build the time-expanded graph structure, the TEG-heuristics (i.e., TEG, CR-TEG and R-TEG) are implemented in Java. Statistically, Delphi XE6 is found to be at least 3 times as fast as Java (Arudchelvam et al. 2013; Karaci 2015). Due to the performance gap between the two compilers in terms of run time, our analysis of the performance of the two heuristics concerning run time will focus on the increments rather than the absolute values.

Sections 7.1 and 7.2 study the features of the MDMPMP based on the optimal solution for different scenarios. A scenario refers to a problem setting with respect to the number of drivers and parcels, the maximum allowed detour, the set of delivery windows, and a certain network, the results of which are averaged over 10 instances. Section 7.1 analyzes the impact of crowdsourced shipping in different spatial distributions of the network from different stakeholder’s viewpoints. Section 7.2 highlights the influence of the planning horizon. In Sect. 7.3, we compare the performance of the two proposed heuristics. In Sect. 7.4, we study the more realistic case.

7.1 Results of the ILP

In this subsection, we illustrate the performance of the ILP with different maximum detours and different number of drivers and parcels, the results of which are compared with the situation where crowdsourced shipping is not implemented (denoted by NoCrowd). Figure 7 presents the total costs with varying maximum detour \(\delta\) for 15 drivers and 30 parcels. In the interest of readability, we remind the reader that the scales of the y-axis in some figures may differ for two subfigures.The total cost of NoCrowd provides an upper bound of the driver-parcel matching system; the total cost obtained by the ILP provides the best lower-bound. As \(\delta\) increases, more parcels can be delivered by the crowd, at the expense of increasing travel distances, which becomes a source of CO\(_2\) emission and traffic flow. A higher driver participation could be a socially responsible alternative, given that the drivers who participate in this problem need to travel anyway. Besides, Fig. 8 shows its economic viability. In order to illustrate the ideas in a transparent manner, the results of varying \(\delta\) in Fig. 8 is a reorganization of the results obtained by the ILP in the scattered and clustered networks that are shown in Fig. 7. Starting from the benchmark case of #driver = 15, #parcel = 30 and \(\delta \,=\,0.05\), it compares the total cost of 15 participating drivers at \(\delta =0.05, 0.1, 0.15, 0.2\), and the total cost of 15, 20, 25, and 30 participating drivers who are willing to deviate at \(\delta \,=\,0.05\). The total cost is plotted as a function of \(\delta\) and #driver, respectively. In the scattered network (SC), we find that the total cost function of #driver always has a steeper slope. Since we start from the same benchmark case, this means that the total cost of having 5 additional participating drivers is always lower than a 5% points increase in the driver’s willingness to deviate from their shortest path; the difference is increasing with increasing #driver and \(\delta\). Such a cost advantage does not always exist in the clustered network (CL).

Fig. 7
figure 7

The impact of maximum detour on total cost (#driver = 15, #parcel = 30)

Fig. 8
figure 8

The comparison of varying \(\delta\) given \(\#driver=15\), and varying \(\#driver\) given \(\delta =0.05\)

Tables 4 and 5 report on the numerical results with varying number of drivers and parcels using a maximum detour of 10%. We define the parcel-miles saved as the difference between the sum of the shortest paths lengths of all parcels that are delivered through crowdsourced shipping and the increase in driver-miles for delivering those parcels. The total cost of EA is obtained by the ILP; the total cost of NoCrowd is calculated by \(\sum _p c_pW_p\). Table 4 shows that the total cost decreases with increasing number of drivers, because the parcels can be delivered by the most appropriate driver(s) among a larger pool of them. Table 5 shows that the total cost increases with increasing number of parcels, because more parcels need to be delivered. Moreover, increasing number of drivers and parcels are both more socially desirable since the overall cost efficiency of the assigned parcels and drivers increases with increased number of parcels and drivers in the candidate pool. In order to present some joint observations in Tables 4 and 5, we define the driver-parcel (DP) ratio, the ratio between the number of drivers and the number of parcels. It seems to suggest the existence of a critical DP ratio (1 in SC and 0.33 in CL), below which, the percentage cost saving remains stable. Although the potential cost saving from the crowd is relatively robust in this case, the overall parcel-miles constantly increases. This is because more suitable parcels among a relatively larger parcel pool can be assigned to the crowd. Fleet consolidation leads to a significant reduction in overall parcel-miles, and thus reduced \(\hbox {CO}_2\) emission and traffic congestion. Above the critical DP ratio, the percentage cost saving increases as the DP ratio increases, which results from assigning parcels to more suitable drivers among a relatively larger driver pool. Note that this increased driver-parcel ratio can be translated into either an increased number of drivers or a decreased number of parcels. Although the maximum extra travel time (the average over the maximum values of each instance) for a driver varies from 6.5 to 17.8 min, the average extra time is less than 4 min for all the scenarios. Based on the basic results presented in Tables 5 and 9 studies the correlation between capacity utilization and parcel-miles saved, both resulting from varying the number of parcels. It suggests that a positive correlation exists between the parcel-miles saved and the capacity utilization, and the correlation coefficient is larger in SC.

Table 4 The exact solutions by varying the number of drivers (\(\#parcel=15, \delta =0.1\))
Table 5 The exact solutions by varying the number of parcels (\(\#driver=15, \delta =0.1\))

We observe that the cost performance and the match rate in CL is better than in SC. For instance, given the same number of drivers and parcels, the average cost reduction in CL is about 70% higher than in SC. The match rate in CL can reach 91%, when the DP ratio is 3. The average number of hops for a parcel to reach its destination is also larger in CL. These phenomena can be explained by the fact that the majority of drivers’ and parcels’ origins and destinations are close to each other within the clusters, leading to a denser subgraph consisting of drivers’ possible paths for these parcels. We also find that different key parameters in SC and CL have a different effect on the total cost. For instance, the maximum allowed detour has more impact on the total cost in CL (see Fig. 7), while the total cost in SC reacts stronger to increasing car capacity utilization (see Fig. 9). In addition, implementing crowdsourced shipping saves more parcel-miles in SC in 6 out of the 8 scenarios. This is mainly because SC is more geographically spanned, that is, the average distance between any two nodes in SC is about 48% longer than in CL. The parcel-miles saved is larger in CL only when its match rate is significantly higher, i.e., the DP ratio between 0.5 and 1 in Fig. 10.

Fig. 9
figure 9

Impact of driver’s capacity utilization on parcel-miles saved

Fig. 10
figure 10

Impact of the DP ratio on the match rate

To conclude, we find that in general (1) the total cost decreases with increasing number of drivers, and (2) increasing number of drivers and parcels are both more socially desirable. Comparing the two networks, we find that (1) the cost performance and the match rate in CL is better than in SC, and (2) crowdsourced shipping saves more parcel-miles in SC.

7.2 Impact of delivery time windows

The same-day delivery option is rare and expensive in the Netherlands. The goal of this subsection is to show that by using crowdsourced shipping, a shipper can provide affordable same-day delivery services to its customers.

Tables 6 and 7 provide a summary of the results obtained under different delivery options, including next-day delivery, same-day delivery, and 3-hour emergency delivery services. We observe similar trends of the cost reduction and the match rate in the same-day delivery and the 3-hour delivery service by varying the number of parcels and drivers. In Table 7, although the delivery window in the same-day delivery is only 1.5 hours less on average compared to the next-day delivery, the cost saving drops 4.7% (7.9%) on the SC (CL), which is 1.2 (1.4) times more than the cost saving reduction from the same-day delivery to the 3-hour delivery service. This seems counter-intuitive at first glance. However, it can be explained by the fact that the shipper mainly use the morning commute (8–10 a.m.) of the crowd to deliver parcels, yet the parcels that are delivered via the same-day delivery option are ready at 9:30 a.m. on average. It results in a drastic decrease in available drivers. Therefore, it is important for the shipper to fully understand the feature of the crowd’s schedule and select the delivery options that are compatible with crowdsourced shipping. Otherwise, the shipper may lose not only the benefit of crowdsourced shipping but also the opportunity of in-house resource consolidation. Tables 6 and 7 also show that if crowdsourced shipping can be efficiently implemented, faster delivery service options can be provided with lower costs.

Table 6 Results under different delivery options varying the number of drivers (\(\delta =0.1\))
Table 7 Results under different delivery options varying the number of parcels (\(\delta =0.1\))

7.3 Performance of the algorithms

In this subsection, we illustrate the computational performance of both the TC-heuristic and the TEG-heuristic in the small-scale numerical setting with different maximum detours as well as different number of drivers and parcels, the results of which are compared with the exact solution, and the NoCrowd solution.

Compared to the exact solution given by the ILP, the optimality gap varies between 2.9% (2.5%) and 49.9% (39.4%) for the TC (TEG) heuristic. Based on the percentage difference from the exact solution, Figs. 11 and 12 depict the quality of the solutions obtained by the TC, TEG, CR-TEG and R-TEG heuristics by varying the number of parcels and drivers. Given a fixed number of drivers (i.e., \(\#driver=15\)), Fig. 11 shows that the performance of every solution method is robust to changes in the number of parcels, compared to the best possible practice. This means that as the number of parcels increases, the percentage difference between the solution obtained by a certain heuristic and the exact solution obtained by solving the ILP does not vary a lot. In contrast, the heuristics perform less with increasing number of drivers (see Fig. 12). This is mainly due to the neglect of the increasing number of possible paths for the drivers, as the previous analysis has shown that the number of drivers is a dominant source of the computational complexity. Even so, all the proposed heuristics can be used to obtain a solution that performs much better than the NoCrowd situation. Arguably, the R-TEG heuristic outperforms the other methods in all these scenarios and its deterioration rate is the lowest among the four heuristics, as the number of drivers increases. The above results are computed using a maximum detour of 0.1. Interestingly, as seen before, Fig. 7 shows that when \(\delta\) is small, the TC-heuristic performs better than the three TEG heuristics, but it gets behind quickly as either the number of drivers or the maximum detour increases. This demonstrates the fact that when the subgraph that is constructed by drivers’ possible paths becomes better connected, the number of potential transfers for each parcel increases. As such, not being able to wait at transfer points becomes the most influential adverse factor that affects the quality of the solution. Figure 13 also shows that the TEG approaches perform consistently well as the maximum detour increases.

Fig. 11
figure 11

Impact of the number of parcels, compared to the exact solutions

Fig. 12
figure 12

Impact of the number of drivers, compared to the exact solutions

Fig. 13
figure 13

Impact of \(\delta\), compared to the exact solutions

The run time of each solution method spent in solving the different scenarios is summarized in Tables 8 and 9. We see that the number of drivers is a major source of computational complexity, compared to the number of parcels. For each instance, the CR-TEG and the R-TEG heuristics run for 100 iterations and 1000 iterations, respectively. Obviously, these two heuristics achieve a better solution at the cost of having a 100–1000 times longer run time. Therefore, we study the number of iterations needed for CR-TEG (R-TEG) to achieve a certain percentage improvement on the gap between the TEG objective and the objective of the CR-TEG (R-TEG) after 100 (1000) iterations. The results of using \(\#driver=15, \#parcel=90, \delta =0.1\) are shown in Fig. 14. We see that the CR-TEG heuristic reaches 90% improvement after 8 iterations in SC and after 10 iterations in CL. The R-TEG heuristic obtains 90% improvement after 98 iterations in SC and after 23 iterations in CL. We also studied the other scenarios and found similar patterns. The fast convergence of the heuristics shows the added value of using even more iterations is limited.

Table 8 Summary of the run time by varying the number of drivers (\(\delta =0.1\))
Table 9 Summary of the rum time by varying the number of parcels (\(\delta =0.1\))
Fig. 14
figure 14

Convergence speed of the CR-TEG and R-TEG heuristics

Based on the results of the smaller instances (i.e., 15–45 drivers and 15–90 parcels with at most 0.2 detour), we find that TC and R-TEG provide solutions with approximately the same quality. We recommend to use TC because it requires less run time.

7.4 Realistic case

In this subsection, we solve a larger-scale problem setting that a Dutch shipping company might face when using crowd based shipping within the Netherlands using the proposed heuristics. We compare the efficiency of each heuristic and also compare the results with the NoCrowd scenario that the shipper delivers all the parcels itself. Our goal is two-fold. First, we want to show that the proposed heuristics are capable of solving real life problems in reasonable run time. Second, the MDMPMP could be an economically sound alternative for a shipper, and can lead to socially desirable results.

Since the number of drivers is a major source of computational complexity, we consider scenarios with 300 parcels and varying number of drivers ranging between 100 and 900. The results are shown in Table 10. Note that the objective values are measured as percentage improvement as compared to NoCrowd. A larger percentage corresponds to a bigger improvement, and therefore is better. As explained at the beginning of Sect. 7, we focus on the increments rather than the absolute values concerning the run times. We see that the run time of the TC heuristic increases super-linearly with respect to the number of drivers, whereas the run time of the TEG-typed heuristics increases linearly. For the largest scenario that we test (i.e., 900 drivers, 300 parcels, 0.1 maximum detour and next-day delivery window), the use of the TC (TEG) heuristic leads to 53.4% (38.5%) average reduction in the overall cost compared to NoCrowd, with a run time of 43.9 (3.2) seconds. We also present the averaged values of Table 10 with varying the number of drivers and delivery options in Table 11. We find that on average TC performs 8.6 percent points better than the best result obtained by the TEG heuristics. In general, the gap is smaller in scenarios with a higher number of drivers (e.g., #driver = 700, 900) and shorter delivery time windows (e.g., urgent delivery). We also find that there is almost no impact on the run time between the next-day delivery and the same-day delivery, but a run time increment between the same-day delivery and the urgent delivery.

Table 10 Results of a realistic case under different delivery options (#parcel = 300, \(\delta \,=\,0.1\))
Table 11 Average results of Table 10 with varying number of drivers and delivery options, measured as percentage difference compared to NoCrowd solutions (#parcel = 300, \(\delta \,=\,0.1\))

As the problem scale increases, the CR-TEG outperforms the R-TEG in both quality and run time. Due to the substantial increase in the solution space, the CR-TEG has a steeper and more steady descent by fixing the existing parcel-driver assignments. Similar to a random walk, the R-TEG is better at escaping from a local minimum and achieve better solutions in principle, but the limited number of iterations compared to the solution space becomes a barrier. Furthermore, the impact of shortening the time window has the least impact on the CR-TEG, mainly because the solution is obtained based on an initial solution where drivers are considered to depart at the earliest departure time.

To conclude, TC has the better performance concerning solution quality and run time in all the tested instances up to 900 drivers and 300 parcels, as compared to CR-TEG and R-TEG. Therefore, we recommend the TC heuristic for applications using a smaller scale. However, we also see that the run time of TC increases super-linearly with respect to the number of drivers, whereas the run time of the TEG-typed heuristics increases linearly. It is foreseeable that when the number of participating drivers, the number of parcel requests and the number of cities are even larger, the TC heuristic can become computationally prohibitive to solve. Under this circumstance, the CR-TEG heuristic is the best alternative based on its overall performance with respective to quality and run time. On the other hand, if the management wants to have a reasonably good solution with short run time, then TEG should be their option.

7.5 Summary of results

In closing this section, we note that our numerical results validate the potential of crowdsourced shipping from the perspectives of total shipping cost and parcel-miles. Using smaller-scale problem instances up to 45 drivers and 90 parcels, Sects. 7.1 and 7.2 show that if crowdsourced shipping can be efficiently implemented, the shipping company can provide not only the standard delivery service but also faster service options with lower costs. Since we use the existing passenger flows and control their maximum detour, crowdsourced shipping also creates parcel-miles saving. Although a direct translation between parcel-miles of all parcels that are delivered through crowdsourced shipping and the additional miles required for a courier service to deliver the parcels is not provided in the paper, we believe that there exists a positive correlation between them. Therefore, crowdsourced shipping can also mitigate the ecological impacts of logistics such as emissions of greenhouse gas, and traffic congestion. Such ecological benefits differ among shipping companies, depending on many parameters in operations, such as the number of vehicles used for delivery, the location of the depots, the service area, and the time windows for pickup and delivery. Our analysis also points out the importance of a high participation. Increasing the number of drivers and parcels are both more cost efficient and more socially desirable. Results from the realistic case conducted in Sect. 7.4 also confirms that an increasing number of participating drivers improves the efficiency of the system.

Rather than replacing the traditional logistics services, crowdsourced shipping by using existing passenger flows can become part of greener logistics networks. It offers a promising alternative to courier services, parcel deliveries in rural areas, and parcel deliveries with short time-windows (e.g., same day deliveries). A common feature of these applications is that they are not able to utilize efficient hub-and-spoke networks as typically used by the large postal and parcel service providers.

In addition, our numerical results in Sects. 7.3 and 7.4 provide guidelines in selecting the most suitable heuristic according to the instance scale. That is, TC is preferred up to the scale of 900 drivers and 300 parcels, after which CR-TEG becomes the best alternative.

8 Conclusion

In this paper, we consider the problem where a shipper (or a consortia of shippers) uses crowdsourced shipping for home deliveries of small-to-medium freight volumes. In particular, we take advantage of the spare capacity in the private vehicles from crowdsourced drivers along their scheduled trips. We provide a general ILP formulation for the multi-driver multi-parcel matching problem, which can be viewed as an extension of the multi-hop ride sharing problem. The model incorporates driver’s maximum allowed detour, vehicle capacities, and the option of transferring parcels between drivers.

Due to the high computational complexity of the problem, the ILP can be solved to optimality only for small instances. This motivates us to develop two heuristics: the time compatibility heuristic and the time-expanded graph heuristic. The time compatibility heuristic assigns each parcel to the shortest feasible path on a network that consists of drivers’ possible physical paths, yet checking the time compatibility for each step can be computationally costly. The time-expanded graph heuristic uses an approach that is typically used to model timetable information in public transportation where the routes and schedules are usually predetermined. The most differentiating feature of the two approaches is whether the decision on a driver’s route and the corresponding time schedule affects the feasibility of another driver’s decision. We explain the pros and cons of both heuristics and provide an extensive experimental comparison of the two approaches.

Assuming the participating drivers need to travel anyway, the numerical results show that an increasing number of participating drivers is beneficial for the shipper, and socially desirable due to reduction in \(\hbox {CO}_2\) emissions and traffic congestion. In addition, the results suggest that it is desirable to analyze the characteristics of the system before implementing a crowdsourced shipping service. For instance, the spatial characteristics of the logistical network, and the spatial distribution of the origin and destination of the participating drivers and parcels can affect the performance of the matching system as well as the response to key parametric changes. Finally, we show that the TC-heuristic performs well in the small-to-medium sized problems, while the CR-TEG is recommended for larger-scale problems.

Future research can be done in three lines. First, future work can be done in finding a search direction regarding the choice of departure time that gives a faster convergence for the TEG approach. Second, as an extension towards a semi-online model environment, a rolling-horizon approach can be introduced. Finally, a shipping company may consider to collaborate with companies that provide storage services (e.g., locker systems) at convenient locations, which can loosen the time synchronization restriction among drivers and parcels.