1 Introduction

As population and personal travel activities continue to increase, traffic congestion has remained as one of the major concerns for transportation system agencies with tight resource constraints. The next generation of transportation scheduling initiatives aims to integrate various demand management strategies and traffic control measures to actively achieve mobility, environment and sustainability goals. Various approaches hold promises of reducing the undesirable effects of traffic congestion due to driving-alone trips. In this research, we mainly focus on providing a time-dependent and state-dependent path searching engine to serve the demand-responsive ride-sourcing/urban transit services in next-generation transportation on demand applications.

In general, there are two classes of the vehicle routing problem (VRP): (1) designing line haul services for customers from the depot and back haul services for customers to the depot, and (2) transporting passengers or goods between specific origins and destinations with possible requested time windows. VRPLite can cover the above two types of problems, but our discussion below focuses on the second class without loss of generality. There are a number of excellent reviews on vehicle routing problems with pickup and delivery by Cordeau et al. [1], Parragh et al. [2] and Psaraftis et al. [3]. When each transporting request is defined by determinate pickup and delivery points, the VRP becomes the vehicle routing problem with pickup and delivery (VRPPD). Practical applications of the VRPPD can be commonly found in urban rail transit management, to name a few, rail transit line planning [4, 5], policy decision making [6, 7], train operation management [8, 9], train timetabling [10, 11], and metro-based freight transportation [12]. In the emerging peer-to-peer ride-sharing service, a passenger can ask the driver to take him/her directly to the destination, and the passenger may also share this ride with one or more passengers. The ride-sharing problem can be mathematically modeled by the classic vehicle routing problem with pickup and delivery with time windows (VRPPDTW) [13]. Previous research has made a number of important contributions along different formulations or solution approaches. On the other hand, there are a number of modeling and algorithmic challenges for a large-scale deployment of vehicle routing and scheduling algorithms, especially for regional networks with various road capacity and traffic delay constraints on freeway bottlenecks and signal timing on urban streets.

In the field of operations research, a few previous studies directly consider the underlying transportation network with time of day traffic congestion, while the majority of studies define the VRPPDTW on a directed graph with fixed shortest travel distance or least travel time routes between origin–destination pairs. Due to the complexity of variables and constraints, it is difficult to seek optimal solutions for large-scale VRPs. The generalized VRP problem also has a number of rich applications on the urban transit and other related scheduling or logistics problems [14, 15]. For example, the most featured one is the transit vehicle assignment and routing problem, which is usually studied as the generalized VRP problem. Other related problems include crew scheduling, aircraft fleeting and routing, fleet itinerary scheduling as well as network-wide train timetabling which assigns trains to different routes.

In this paper, we introduce our proposed algorithm from the perspective of shortest path algorithms, which has rich applications in the field of transportation network modeling [16]. The physical network can be denoted by \(\left( {N, A} \right)\), where N is the set of nodes and A is the set of arcs, and then the shortest path problem is to find a path with the minimal cost that consists of a sequence of links \(\left( {i, j} \right) \in A\) connecting origin node o to destination node d. The shortest path problem can be represented as the minimal cost network flow problem by sending one unit of flow from o to d. A binary variable xi,j is used to denote whether the flow passes the link \(\left( {i, j} \right)\) or not. The mathematical formulation of the shortest path problem with node flow balance constraints is listed below [17].

$$\hbox{min} z = \mathop \sum \limits_{{\left( {i,j} \right) \in A}} c_{i,j} x_{i,j}$$
(1)

s.t.

$$\mathop \sum \limits_{{\left\{ {j:\left( {i,j} \right) \in A} \right\}}} x_{i,j} - \mathop \sum \limits_{{\left\{ {j:\left( {j,i} \right) \in A} \right\}}} x_{j,i} = \left\{ {\begin{array}{*{20}l} { - 1} \hfill & {\forall i = o} \hfill \\ {1 } \hfill & {\forall i = d} \hfill \\ 0 \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right.$$
(2)
$$x_{i,j} \in \left\{ {0, 1} \right\}\quad \forall\,\left( {i,j} \right) \in A$$
(3)

In general, there are mainly two algorithmic approaches to deal with the shortest path problem, namely label setting and label correcting algorithm [17]. Both approaches iteratively update the label cost of nodes at each step. The label cost of nodes is designated as permanent in the label setting algorithm at each iteration, while the label correcting algorithm can change the label cost of nodes at any step. This feature determines that label setting algorithm cannot solve the shortest path problem with negative arc costs, but the label correcting algorithm can deal with the shortest path problem with arbitrary arc costs. The static shortest path problem can be further extended to dynamic version with time-dependent arc costs \(c_{i,j,t}\) on link (ij) for vehicles leaving at time t, and time-dependent link travel time TTi,j,t. Ziliaskopoulos and Mahmassani [18] proposed an efficient label correcting-based algorithm to find the time-dependent shortest paths from all nodes in the network to the single destination node. Chabini [19] aims to reduce the worst-case complexity in solving the time-dependent shortest path problem by adopting the dynamic programming approach. Recently, the shortest path problem in three-dimensional networks or hyper-networks has attracted significant interests in transportation optimization problems. Mahmoudi and Zhou [20] developed a time-dependent forward dynamic programming algorithm to reformulate the VRPPD as a special version of the shortest path problem with time-dependent and state-dependent arc costs where the state represents the number of passengers on the vehicle. Liu et al. [21] further considered an extended version of household activity scheduling problem by using a cumulative space–time–state representation to reduce the number of complex constraints. A space–time–speed hyper-network and the corresponding dynamic programming algorithm are introduced by Zhou et al. [22] with applications in joint optimization of train timetables and speed profiles. A resource-space–time network was adapted by Lu et al. [23] to consider time-dependent routing applications with energy resource considerations. As an alternative representation to the high-dimension network, a decomposition approach is considered by Tong et al. [14] and Ruan et al. [24] with two coupled subproblems, i.e., a space–time network-based shortest path problem and a general assignment problem, for customized bus applications. By extending the space–time network-based time-dependent shortest path algorithms, this VRPLite package aims to solve the time-dependent and state-dependent shortest path problem. As a particular note, the cumulative service state of passengers is presented as the “state” dimension in the VRPLite package.

Table 1 provides a detailed comparison of the above shortest path algorithms from the perspectives of network representation, arc cost, data structure to the solution methods. In Table 2, we further list different state representations in the space–time–state modeling framework to show the potential of this modeling method in solving difficult transportation problems.

Table 1 Comparison of different shortest path algorithms (network representation, arc cost, data structure, and solution methods)
Table 2 Typical different state representations

The fully functional, open-source VRPLite package can be downloaded from https://github.com/xzhou99/VRPLite. The goal of this package includes the following three aspects.

  1. 1.

    Provide an open-source code base that enables transportation researchers and software developers to expand its range of capabilities to various traffic/transportation management applications.

  2. 2.

    Provide a free, educational modeling framework for students and researchers to understand the complex space–time–state network modeling process for transportation optimization applications, e.g., train timetabling, urban rail transit scheduling and ride-sharing applications.

  3. 3.

    We introduce our solution approach and related software implementation from a time-dependent and state-dependent shortest path approach.

2 Space–Time–State-Based Models

2.1 Problem Statement

The VRPPDTW problem studied in this paper can be formally defined by the following statement. Consider a physical transportation network (NM) with a finite set of nodes N and a finite set of links M, where nodes \(i,j \in N\) and directed link \(\left( {i,j} \right) \in M\). A space–time network \(G = \left( {E,A} \right)\) can be constructed for transportation network \(\left( {N,M} \right)\) under planning time horizon T considering passenger carrying state W with a finite set of space–time–state vertices V and a finite set of space–time–state arcs A according to optimization requirements. In a space–time–state setting, each vertex \(\left( {i,t,w} \right) \subset V\) simultaneously represents time, location, and vehicle carrying state; each arc \(\left( {i,j,t,s,w,w^{{\prime }} } \right) \in A\) indicates a directed space–time–state path from node i departing at time t with passenger carrying state w to node j arriving at time s with passenger carrying state \(w^{{\prime }}\). Because of the three-dimensional network structure, it is easy to model passengers’ travel requests, vehicles’ travel times changing over time, and available passenger carrying states. Given a set of passengers P and their travel requests, as pickup/delivery locations, \(o_{p} /d_{p}\), and space–time windows, \(\left[ {a_{p} , b_{p} } \right]\) and \(\left[ {a_{p}^{{\prime }} ,b_{p}^{{\prime }} } \right]\), as well as vehicle capacity constraint \(Cap_{v}\) and other routing constraints, the VRPPDTW problem aims to find optimal passenger-to-vehicle assignment, vehicle routes and timetables for each vehicle v in the vehicle set V under certain traffic conditions. The notations used in this paper are listed in Tables 3 and 4.

Table 3 Indexes and variables used to describe the VRPPDTW problem
Table 4 Indexes and variables used for the model formulation

2.2 Modeling Methodology Based on the Space–Time–State Network Representation

A simple example with two travel requests and one vehicle in our previous study [20] is used to demonstrate key modeling features of space–time–state network representation. Consider a general physical transportation network containing six nodes. Each link in this network is associated with time-dependent travel time \(TT\left( {i,j,t} \right)\). Two requests are with the same pickup node (node 2) and the same drop-off node (node 3), but with different pickup and drop-off time windows. Only one vehicle is available for serving the two requests. Moreover, we assumed that the vehicle starts its route from node 4 and ends it at node 1. One dummy origin node and one dummy destination node need to be built to correspond to its pickup node and drop-off node for each request. As shown in Fig. 1, Passenger 1 should be picked up from dummy node o1 in time window [4,7] and dropped off at dummy node d1 in time window [11,14], while Passenger 2 should be picked up from dummy node o2 in time window [8,10] and dropped off at dummy node d2 in time window [13,16]. Vehicle 1 also has the earliest departure time from its starting depot, t = 1, and the latest arrival time at its ending depot, t = 20.

Fig. 1
figure 1

a Six-node transportation network, transportation network with the corresponding dummy nodes, where [∙,∙] represents passenger time windows; b shortest paths in the space–time network, where [], [p1], [p1] and [p1, p2] represent vehicle carrying states [20]

Note that the shortest path with node sequence \((o_{1}^{{\prime }} ,4, 2, o_{1} , 2,o_{2} ,2, 5, 6, 3, d_{1} ,3, d_{2} ,3, 1, d_{1}^{{\prime }} )\) from vehicle 1’s origin to its ending depot is shown by bold arrows when it serves both requests. To use a space–time–state network representation for model formulation, the time horizon is discretized into a set of time intervals with the same time unit, e.g., 1 min. Selected arcs constituting the shortest paths from vehicle 1’s origin to its destination are demonstrated in the vehicle’s space–time network illustrated in Fig. 1 (b).

Each vehicle starts its trip from the empty state in which the vehicle carries 0 passenger. We call this empty state as the initial state w0. Each vertex in the constructed space–time–state network is recognized by a triplet of three different indexes: node index i, time interval index t, and passenger carrying state index w.

In the space–time–state transportation network, we can identify a traveling arc \(\left( {i,j,t,s,w,w^{{\prime }} } \right)\) starting from node i at time t with passenger carrying state arriving w to node j at time s with passenger carrying state \(w^{\prime}\). Accordingly, in the space–time–state network, each vertex \(\left( {i,t,w} \right)\) is connected to vertex \(\left( {j,s,w^{{\prime }} } \right)\) through arc \(\left( {i,j,t,s,w,w^{{\prime }} } \right)\).

The VRPPDTW model based on space–time–state network representation was first proposed by Mahmoudi and Zhou [20]. The model used in VRPLite is given in Eqs. (4)–(9). For more detailed information, we refer interested readers to the original research paper and the GAMS source code can be found at https://github.com/xzhou99/VRPLite/tree/master/GAMS_SourceCode.

Objective function:

$$\hbox{min} Z = \mathop \sum \limits_{{v \in \left( {V \cup V^{*} } \right)}} \mathop \sum \limits_{{\left( {i,j,t,s,w,w^{\prime}} \right) \in B_{v} }} c\left( {v,i,j,t,s, w,w^{{\prime }} } \right)y\left( {v,i,j,t,s,w,w^{{\prime }} } \right)$$
(4)

Flow balance constraints at vehicle v’s origin vertex:

$$\mathop \sum \limits_{{\left( {i,j,t,s, w,w^{{\prime }} } \right) \in B_{v} }} y\left( {v,i,j,t,s, w,w^{{\prime }} } \right) = 1\quad i = o_{v}^{{\prime }} , t = e_{v} , w = w^{{\prime }} = w_{0} , \quad \forall v \in \left( {V \cup V^{*} } \right)$$
(5)

Flow balance constraint at vehicle v’s destination vertex

$$\mathop \sum \limits_{{\left( {i,j,t,s, w,w^{{\prime }} } \right) \in B_{v} }} y\left( {v,i,j,t,s,w,w^{{\prime }} } \right) = 1\quad j = d_{v}^{{\prime }} ,s = l_{v} , w = w^{{\prime }} = w_{0} , \quad \forall v \in \left( {V \cup V^{*} } \right)$$
(6)

Flow balance constraint at intermediate vertex

$$\mathop \sum \limits_{{\left( {j,s,w^{{\prime \prime }} } \right)}} y\left( {v,i,j,t,s, w,w^{{\prime \prime }} } \right) - \mathop \sum \limits_{{\left( {j^{{\prime }} ,s^{{\prime }} ,w^{{\prime }} } \right)}} y\left( {v,j^{{\prime }} ,i,s^{{\prime }} ,t, w^{{\prime }} ,w} \right) = 0$$
$$\left( {i,t,w} \right) \notin \left\{ {\left( {o_{v}^{{\prime }} ,e_{v} , w_{0} } \right),\left( {d_{v}^{{\prime }} ,l_{v} , w_{0} } \right)} \right\}, \quad \forall v \in \left( {V \cup V^{*} } \right)$$
(7)

Passenger p’s pickup request constraint

$$\mathop \sum \limits_{{v \in \left( {V \cup V^{*} } \right)}} \mathop \sum \limits_{{\left( {i,j,t,s,w,w^{{\prime }} } \right) \in \varPsi_{p,v} }} y\left( {v,i,j,t,s,w,w^{{\prime }} } \right) = 1 \quad \forall p \in P$$
(8)

Binary definitional constraint

$$y\left( {v,i,j,t,s,w,w^{{\prime }} } \right) \in \left\{ {0, 1} \right\} \quad \forall \left( {i,j,t,s,w,w^{{\prime }} } \right) \in B_{v} , \quad \forall v \in \left( {V \cup V^{*} } \right)$$
(9)

2.3 Understanding Different Optimization Models Within VRPLite Package

The transportation optimization problem for large-scale instances gives rise to challenges requiring innovative concepts and solution techniques. Our VRPLite package tackles with routing and scheduling problems with time dimensions and incorporates theoretical models and practical methods, such as VRP, the assignment problem, the knapsack problem, time-dependent and state-dependent problem, Lagrangian relaxation solution framework, and column generation framework.

  1. 1.

    Vehicle routing problem

The family of VRP problem is a class of linear programming problems with a special structure of two layers. Specifically, when it comes to the freight transportation, each source has a fixed supply of units, which must be distributed to the destinations. Each destination has a fixed demand for units, which must be satisfied by the sources. In dial-a-ride, transportation on demand problem or VRPPDTW problem for passenger transporting, each passenger needs to be transported from his/her origin to destination in a complex transportation network.

  1. 2.

    Assignment problem

The assignment problem needs to match a number of agents to a number of tasks. Any agent can be assigned to perform any task, incurring some costs that may vary depending on the agent-to-task assignment relationship. It is required to perform all tasks by assigning agents to tasks following certain rules in such a way that the total cost of the assignment is minimized. In the VRPPDTW problem, vehicles need to be assigned to serve passengers. By following a variable splitting method introduced by Fisher [27], the complex space–time–state variables can be decomposed into assignment variables for both passengers and vehicles and space–time routing variables for vehicles. The merit of variable dimensionality reduction lies in avoiding the enumeration of vehicle states. Therefore, the assignment problem-based VRP model is superior when dealing with high-capacity transportation modes, such as customized buses, public transit and etc.

  1. 3.

    Knapsack problem

The knapsack problem refers to the common problem of packing the most valuable or useful items subject to the overall knapsack capacity constraints. In the VRPPDTW, we need to decide which passengers should be served by each vehicle because of the limited carrying capacity of vehicles or limited time budgets.

  1. 4.

    Time-dependent and state-dependent shortest path problem

In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. Interested readers could get more information on space–time network construction and computationally time-dependent shortest path algorithms in [17, 18]. In the VRPPDTW, we need to compute time-dependent and state-dependent shortest path for each vehicle.

  1. 5.

    Dynamic programming

Several efficient algorithms have been developed to compute time-dependent shortest paths in networks with time-dependent arc costs. In the path searching engine, a time-indexed dynamic programming algorithm is used to solve the shortest path problem.

  1. 6.

    Lagrangian relaxation solution framework

Lagrangian relaxation is a relaxation method which approximates a difficult problem of constrained optimization by a simpler problem. To find the optimal solution for the Lagrangian dual problem, VRPLite computes time-dependent and state-dependent least-cost path for each vehicle based on updated multipliers by calling the proposed time-dependent forward dynamic programming algorithm.

  1. 7.

    Column generation framework

Column generation, to be detailed further, provides an effective way to find solutions for linear programs with numerous variables. The predominant concept is that the primal problem is split into two problems: the master problem and the subproblem. The master problem is the original problem with only a subset of variables being considered. The subproblem is a new problem created to identify a new variable. The VRPPDTW problem can be split into set partitioning problems and time-dependent shortest path problems, which can be solved by standard optimizer and proposed time-dependent dynamic programming algorithm, respectively.

3 Software Architecture, Data Flow and Implementation

3.1 Data Flow Chart of VRPLite

The software architecture designed in VRPLite aims to integrate passenger-to-vehicle assignment and time-dependent routing into an open-source VRP modeling package. As shown in Fig. 2, there are three major modeling components, including: (1) dynamic programming based on a node-link network structure and vehicle states transition; (2) Lagrangian relaxation module, which utilizes passenger’s prices to determine vehicle’s pickup and delivery decision in (1) dynamic programming module; (3) column (i.e., vehicle paths) generation for large-scale problems. The final output includes passenger costs/profits (e.g., total waiting cost, transportation cost), passenger-to-vehicle assignment and vehicle space–time trajectories.

Fig. 2
figure 2

Software architecture with key modeling components

3.2 A Dynamic Programming Solution Framework Implemented as a Beam Search Process

Within a dynamic programming (DP) framework, Fig. 3 shows the data flow chart and the solution framework of VRPLite. In general, dynamic programming is suitable for multistep or sequential decision processes with given state transition. In our case, the time horizon serves as the stages in DP, and at current node and current time, (cumulative service) states are defined by the vehicle’s path node sequence, path time sequence, and served passenger sequence.

Fig. 3
figure 3

Data flow chart of VRPLite

Figure 4 depicts the pseudo-code of the time-indexed beam search algorithm, which is an improved version compared with the three-loop dynamic programming algorithm by Mahmoudi and Zhou [20]. Essentially, a vehicle starts from its depot at departure time and scans three loops with the index of time, the index of k for the beam search and the index of outgoing nodes from the current node. At each time, all the possible states are evaluated by the objective function and the best K partial solutions are selected to move forward. It should be noted that the current node is stored in the time-indexed vector td_state[t] [k] and only the k best solutions are selected to move forward. The final solution is output as the vehicle reaches its destination within its time window. Figure 5 depicts the process of the time-indexed beam search algorithm.

Fig. 4
figure 4

Pseudo-code of time-indexed beam search process for each v with origin o departure time T0, destination d arrival time \(T\)

Fig. 5
figure 5

The process of the time-indexed beam search algorithm, with the time dimension as the horizontal axis

To handle the demand satisfaction constraint (8) of our model, we introduce Lagrangian relaxation to relax this constraint, with added passenger profits (i.e., dual price) in the new objective function. Iteratively, passenger profits are updated according to a subgradient method, that is, checking how many times a passenger has been served during the current iteration to increase or decrease the price accordingly. For a large-scale application, we use a multi-vehicle column generation process to better define and search for feasible solutions.

3.3 Column Generation Framework for Finding Multi-vehicle Routing Solutions

The VRPPDTW, in its original arc-based form, can also be reformulated as a set partitioning problem by applying Dantzig–Wolfe decomposition. We could introduce a new set of path-based variables \(x\left( {v,p} \right)\), which equals 1 if passenger p is served by vehicle v and equals 0 otherwise. The set partitioning formulation of the VRPPDTW can be expressed as follows.

$${\text{Min }}Z = \mathop \sum \limits_{p \in P} \mathop \sum \limits_{v \in V} c\left( v \right)x\left( {v,p} \right)$$
(10)

s.t.

$$\mathop \sum \limits_{v \in V \cup V*} x\left( {v,p} \right) = 1 \quad \forall p \in P$$
(11)
$$x\left( {v,p} \right) = \left\{ {0,1} \right\} \quad \forall p \in P, v \in V$$
(12)

The objective function (10) minimizes the cost of the chosen paths. The constraint (11) guarantees that each passenger is served exactly once. The linear programming (LP) relaxation of (10)–(12) with a subset of feasible paths is called the Restricted Master Problem (RMP), which can be solved by a standard optimizer. We are also able to obtain dual prices for each passenger \(\pi \left( p \right)\) from the solution of the RMP. Those dual prices are then utilized in the objective function of the subproblem, which searches for variables with negative reduced cost. The objective function of the underlying pricing subproblem can be formulated as Eq. (13).

$${\text{Min}}\,\sigma = \mathop \sum \limits_{{i,j,t,s,w,w^{\prime}}} c\left( {v,i,j,t,s,w,w^{{\prime }} } \right)y\left( {v,i,j,t,s,w,w^{{\prime }} } \right) - \mathop \sum \limits_{p} \pi \left( p \right)x\left( {v,p} \right)$$
(13)

The pricing problem is essentially a time-dependent shortest path problem in a network with time-dependent arc costs, while several efficient algorithms have been developed to solve such a problem. Along this line, the time-dependent and state-dependent path searching engine developed based on a dynamic programming framework can be used to compute the subproblem within the general column generation framework.

As shown in Fig. 6, by solving the Restricted Master Problem, the outputting optimal solution with dual prices of passengers being its byproduct results could be served as the input of the pricing subproblem. Iteratively, the pricing subproblem is solved to generate a new path of the vehicle, as a new column to be added to the master problem. Finally, the optimized vehicle routes are obtained. For more details of column generation algorithms, especially about the branch and price framework and its final convergence criteria, interested readers are referred to Lübbecke and Desrosiers [28].

Fig. 6
figure 6

Column generation framework for finding multi-vehicle routing solutions

In the column generation algorithm, the RMP is relaxed into a linear programming problem; thus, the optimal solution we obtain might be fractional. However, the variables \(x\left( {v,p} \right)\), which represent if the vehicle v serves passenger p or not, should be binary variables. Thus we have to design branching strategies to find feasible integer solutions. When the algorithm branches on variables \(x\left( {v,p} \right)\), it indicates that \(x\left( {v,p} \right)\) is fractional and typically imposes two branches \(x\left( {v,p} \right) = 0\) and \(x\left( {v,p} \right) = 1\).

4 Numerical Experiments

4.1 The First Toy Example on a Corridor

A small corridor network consisting of 6 physical nodes and 5 physical links is shown in Figs. 7 and 6 dummy nodes and 10 dummy links are also included. The internal number of physical and dummy nodes is determined with a given labeling rule. First, all of the physical nodes are labeled from 1 to N where N is the number of physical nodes. Second, the pickup and delivery nodes of each passenger are numbered sequentially from N + 1 to N + 2P where P represents the total number of passengers. Finally, we mark the number of origin and destination depots of each vehicle in sequence from N + 2P + 1 to N + 2P + 2M. In addition, the departure and arrival time windows are specified directly beside those dummy nodes. In this example, one vehicle will travel from node 1 to node 6 to serve two passengers on its way. The first passenger A departs from node 2 and needs to alight the vehicle at node 4, while the second passenger B needs to travel from node 3 to node 5. The internal number of nodes shown in Fig. 7 is labeled in Table 5 by following our cost updating rule. In Figs. 7, 9, 11 and 13, texts in circles, rectangles and triangles denote node numbers, and texts on links represent corresponding travel costs.

Fig. 7
figure 7

Network layout and time-window settings for the basic example

Table 5 Internal number of the nodes shown in the basic example

Both the upper bound and lower bound of the small example are equal to 20, so it is proved that the optimal solution is 20. In addition, the optimal routes and schedules for the single vehicle are shown in Table 6, and the space–time trajectory of the vehicle for the basic example is illustrated in Fig. 8. It is remarked that there is no passenger waiting time or vehicle waiting time in this example. That is, in the optimal solution the vehicle can arrive at the service points just at the time when the service time windows start.

Table 6 The evolution of path node sequences and path time sequences for the basic example
Fig. 8
figure 8

Vehicle space–time trajectory for the basic example

4.2 The Second Example with Extended Link Travel Time

The travel time of links (2, 3) and (4, 5) is extended to 4, as shown in Fig. 9, and the departure and arrival time windows of passengers A and B are updated accordingly, so that no vehicle or passenger waiting time is introduced, as shown in Table 7, and the space–time trajectory of the vehicle is shown in Fig. 10.

Fig. 9
figure 9

Network layout and time-window settings for the example with extended link travel time

Table 7 The evolution of path node sequences and path time sequences for basic example with extended link travel time
Fig. 10
figure 10

Space–time trajectory of the vehicle for the example with extended link travel time

Both upper bound and lower bound of this problem are equal to 24, which increases by 4 compared to the optimal solution of the first example. Obviously, it is for the reason that the travel time of links (2, 3) and (4, 5) increases by 4 and no extra vehicle or passenger waiting time is introduced.

4.3 The Third Example with Extra Vehicle Waiting Time

In order to test the influence of vehicle waiting time on the optimal vehicle routes and schedules, the departure time window of passenger A is delayed from [5, 7] to [10, 12]. Therefore, the vehicle will have to wait at node o1 until passenger A gets ready to depart at time 10. In addition, the arrival time window of passenger A and the time windows of passenger B are modified accordingly, so that the vehicle will not wait at other places. The updated time window settings are shown in Fig. 11.

Fig. 11
figure 11

Network layout and time-window settings for the example with extra passenger waiting time with extra vehicle waiting time

The upper bound and lower bound of this example are equal to 22.5, which turns out to be the optimal solution. The optimal routes and schedules for the vehicle are shown in Table 8, and the space–time trajectory of the vehicle is shown in Fig. 12. It can be observed that the vehicle arrives at node o1 at time 5 and waits until time 10, so the vehicle waiting time is 5. Besides, the total travel time of the vehicle is 25, but the cost ratio of vehicle waiting time is only 0.5, and then the optimal value of total cost is equal to 25 − 0.5 × (10 − 5) = 22.5.

Table 8 The evolution of path node sequences and path time sequences for the example with extra vehicle waiting time
Fig. 12
figure 12

Space–time trajectory of the vehicle for the example with extra vehicle waiting time

4.4 The Forth Example with Extra Passenger Waiting Time

If the vehicle departs late from the origin deport, then the passengers will have to wait until the vehicle arrives. Therefore, the departure time window of the vehicle is delayed by 5 compared with the basic example, and the departure and arrival time windows of those two passengers are adjusted accordingly. The new time-window settings are shown in Fig. 13.

Fig. 13
figure 13

Network layout and time-window settings for the example with extra passenger waiting time

The upper bound and lower bound of this example are equal to 21.5, and the optimal routes and schedules of the vehicle are shown in Table 9, and the space–time trajectory of the vehicle is shown in Fig. 14. It is obvious that passenger A starts to wait at time 5 until the vehicle arrives at time 10, so the waiting time of passenger A is 5. In addition, because the cost ratio of passenger waiting time is 0.5 and the total travel time of the vehicle is 20, the optimal value of the total cost is 20 + 0.3 × 5 = 21.5.

Table 9 The evolution of path node sequences and path time sequences for the example with extra passenger waiting time
Fig. 14
figure 14

Space–time trajectory of the vehicle for the example with extra passenger waiting time

4.5 The Fifth Example for Branching Process Within a Column Generation Process

We test our column generation algorithm on the six-node transportation network illustrated in Fig. 1 for a scenario with three passengers and two vehicles. Table 10 shows origin–destination pairs, and passengers’ departure and arrival time windows. Terms “TW” and “TH” stand for time window and time horizon, respectively. The code and related data of this example can be downloaded at https://github.com/YaoYuBJTU/VRPLite-python.

Table 10 Passengers’ origin–destination pairs and corresponding departure and arrival time windows

Based on this scenario, we obtain a fractional optimal solution during solving the RMP. The solution, \(x\left( {1,1} \right) = x\left( {1,2} \right) = 0.5,x\left( {2,1} \right) = x\left( {2,3} \right) = 0.5,x\left( {3,2} \right) = x\left( {3,3} \right) = 0.5\) shows that three types of paths are used (two passengers can be served through the ride-sharing mode by the vehicle going through each path), but the value of the decision variable = 0.5 means that only 0.5 vehicles go through that path, which has no physical significance. As a result, branching is needed to obtain the feasible solutions, i.e., for the fractional value \(x\left( {1,1} \right) = 0.5\), we could force \(x\left( {1,1} \right)\) to be 1 and 0 as two child nodes, ensuring passenger p1 is served by vehicle v1 or not. After a branching step, column generation is used again and a series of new paths are generated through the subproblem. The feasible solution of branch \({\text{x}}\left( {1,1} \right) = 1\) is \(x\left( {1,1} \right) = x\left( {1,2} \right) = 1,x\left( {4,3} \right) = 1\), while for the other branch \({\text{x}}\left( {1,1} \right) = 0\), there are two feasible solutions, \(x\left( {2,1} \right) = x\left( {2,3} \right) = 1,x\left( {5,3} \right) = 1\) and \(x\left( {3,2} \right) = x\left( {3,3} \right) = 1,x\left( {6,1} \right) = 1\). Finally, we could obtain the feasible optimal solution,\(x\left( {3,2} \right) = x\left( {3,3} \right) = 1,x\left( {6,1} \right) = 1\), which means p2 and p3 are served by one vehicle through the ride-sharing mode and p1 is served by another vehicle.

5 Discussions and Conclusions

This research aims to improve the scheduled transportation system performance by enabling better vehicle scheduling capabilities in complex transportation on demand applications. Specifically, the VRPLite package addresses several fundamental research issues in scheduled transportation systems, which offers a set of solution platforms on holistic traveler mobility optimization, agent-based trajectory control under the new environment of shared self-driving car or automated guided vehicle (AGV) networks. This open-source and educational modeling framework could help researchers understand the complex space–time–state network modeling methodologies, especially from a time-dependent and state-dependent shortest path perspective. Because the shipping of passengers and goods by shared self-driving cars or automated urban rail trains needs to be fully coordinated and cooperative, we hope this algorithm could help to demonstrate how to reduce the transportation cost and improve the efficiency in shipping passengers or goods [29], especially in the area of city logistics [30]. In particular, if the shared self-driving cars are electrified, the gas emission caused by the transportation process could decrease to a large extent [31].

It should be highlighted that, unlike the shared self-driving cars, AGVs usually move on the visual track-based networks with specially required path topologies and two AGVs may conflict on the interactions of their paths [32] where the paths of AGVs are planned in advance to avoid all kinds of obstacles [33, 34]. In this situation, the scheduling and routing of AGVs is very similar to that of scheduled rail systems [35,36,37] where each spatial and temporal resource can only be occupied by at most one train. It can be shown that the scheduling and routing of AGVs are also a variant of the vehicle routing problem, and the readers can refer to [32, 38] for detailed reviews on the corresponding solution approach and applications of AGVs.

In addition, the VRPLite package uses a discretized space–time–state modeling approach, so it is natural to consider time-dependent link travel time in the program, such as the vehicle routing problem with time-dependent link travel time and path flexibility in the paper [39], as well as spatial and temporal conflicts between AGVs.

We hope that, the theoretical methodologies, insights and open-source tools developed from this research will be useful for modeling and optimizing new autonomous vehicle operation and control methods for metropolitan regions. In the future, a new class of ubiquitous distributed computing-based algorithms will be further studied, to include joint trip assignment, routing and scheduling problems.