1 Introduction

In the past, automated transit was regarded as personal rapid transit or automated rail transit. However, it is now referred to as autonomous vehicle technology, which for public transit means autonomous bus transit, ridesharing, and carsharing. Transportation network companies (TNCs), such as Uber, and many car manufacturers, including General Motors, have recently reported that fully automated vehicles will be available by 2020–2030 [1]. This means that carsharing and ridesharing using autonomous vehicles will become a reality within a decade. While car manufacturing and technology companies are developing and improving technologies for automated vehicles, it seems that policy, planning, and other essential elements for effective implementation of automated vehicles for transit services still lag behind the technology [2].

Autonomous and connected vehicles (CVs) will change the paradigm for transportation users and industries, as well as for public transportation (including mass transit, ridesharing, and carsharing). Not only can they improve travel safety (e.g., reducing crashes), but they also will change our lives and travel patterns. When autonomous vehicles become available, users’ travel behaviors and modal choices will become completely different. Autonomous vehicles will likely result in reductions in car ownership and increases in carsharing and ridesharing [3]. Also, small automated transit vehicles could be utilized to pick up passengers as a feeder for mass transit—such as bus, light rail transit (LRT), and metro—because of their lower operational costs due to no labor costs.

Although demand responsive feeder bus operation is possible even with human-driven vehicles, it is not very popular and is mostly available as a special service because of its high operating costs due to intensive labor costs as well as requirement for advanced real-time information technology and complicated operation. However, once automated vehicles become available, small-sized flexible door-to-door feeder bus operation will become more realistic, thanks to recent technological advances and business innovations by transportation network companies (TNCs). So, preparing for such automated flexible feeder services is necessary to take advantage of the rapid improvement of automated vehicle technology.

Before procuring and operating automated transit vehicles, it is extremely important to determine what future transit customers will want and expect from them; For example, depending on whether transit customers prefer a traditional type of transit service (e.g., fixed route) with an automated small-sized feeder transit or a more flexible service, similar to that provided by TNCs, transit agencies should prepare their future transit service accordingly while considering recent improvements in the availability of multisource and heterogeneous traffic data. These technologies will also open new opportunities for TNCs to implement automated feeder transit systems as well [4].

Although various research efforts have focused on optimization of feeder bus routes and operation, to the best knowledge of the authors, no study has considered the dynamic nature of feeder bus operation, such as the relocation of buses for multiple stations and trains. In the work presented herein, an algorithm for optimal flexible operation of small-sized automated feeder transit vehicles was developed to minimize the total costs, including agency operating costs and passenger travel costs, while guaranteeing a certain level of maximum individual travel time when handling multistation multitrain situations, with possible relocations of feeder buses if necessary. Then, in order to solve the problem, a metaheuristic algorithm was constructed for a hypothetical network.

This study serves as a basis for the evaluation of the efficiency of such automated feeder services, which can then be compared with automated ridesharing and carsharing services in the future. Eventually, these studies will help predict users’ travel behaviors and modal choices between automated ridesharing/carsharing operation and automated feeder services for mass transit.

2 Literature Review

Dantzig and Ramser [5] introduced the vehicle routing problem (VRP), for which various applications, modeling approaches, and solution methods have since been considered and widely developed. The demand responsive feeder bus routing problem stems from the vehicle routing problem with simultaneous pickup and delivery (VRPSPD), which is an extension of the VRP that considers the situation in which feeder buses can alight and board passengers simultaneously. Min [6] first proposed the VRPSPD—inspired by a distribution problem for public libraries—and applied a heuristic method to solve this real-life problem. Thereafter, many researchers have tried to solve this problem using various methods. Angelelli and Mansini [7] could solve this problem using an exact algorithm. Other studies tried to solve the problem using heuristic and metaheuristic algorithms. Since VRPSPD is an NP-hard combinatorial optimization problem, very few studies have used exact approaches, and most recent studies have focused on metaheuristic algorithms [6]. Metaheuristic approaches used in recent years to solve the VRPSPD include the genetic algorithm (GA) [8], tabu search (TS) [9], greedy particle swarm optimization [10], ant colony optimization (ACO) [11], iterated local search algorithm [12], and simulated annealing (SA) [13]. The most recent studies related to the VRPSPD are summarized in the study by Montoya-Torres et al. [14]. This section mentions only a few of the most influential studies that are most relevant to demand responsive feeder transit systems.

2.1 Trunk Service and Its Feeder Bus System

Last-mile transportation systems (LMTSs) and trunk transit services have been addressed in many studies. The pioneering study by Kuah and Perl [15] introduced an integrated feeder bus network design problem in the presence of a rail system, although this study failed to consider coordination of the feeder buses to the rail system. Chowdhury and Chien [16] first introduced a coordinated feeder bus–rail system. Thereafter, many researches tried to address this problem by minimizing total passenger and operator costs and considering various decision variables such as bus frequency, train headway, and feeder bus capacity [17,18,19,20]. In recent years, studies have focused on the development of more realistic models and the use of new solution methods. Some researchers have developed models by adding passenger wait times at trunk and feeder stops as well as transfer wait times [21, 22]. Wang [23] considered routing and scheduling in a Last Mile Transit (LMT) service and proposed a mixed-integer programming model. Mahéo et al. [24] proposed a Benders decomposition model to solve the problem by considering routing aspects of the multimodal network design problem. Recently, a new discrete space–time network-based modeling framework was proposed to optimize multimodal transportation network design, especially for urban rail transit [25]. Finally, Dou et al. [26] developed an optimization model to minimize passenger and operator costs by optimization of the schedules of a coordinated feeder bus transit (CFBT) with a rail system.

2.2 The Pickup and Delivery Problem with Time Windows (PDPTW)

The pickup and delivery problem with time windows (PDPTW) is a generalized version of the vehicle routing problem with time windows (VRPTW) that focuses on finding optimal routing solutions under capacity and time window constraints [27]. The objective function of the standard PDPTW is to minimize transportation costs while generating routes that serve all demands [28]. At first, Dumas et al. [29] solved the PDPTW using a branch-and-price algorithm and found an exact solution to the problem. After that, when introducing new objectives and constraints, the PDPTW turned out to be an NP-hard problem, and new heuristic and metaheuristic methods have been implemented for solving such problems. Recent studies implemented two-stage metaheuristic approaches by minimizing the number of routes and total travel distance. These approaches include TS [30], SA [31], large neighborhood search (LNS) [32], and guided ejection search (GES) [33]. Recently, Zhou et al. [34] developed an open-source lightweight approach to solve the vehicle routing problem pickup and delivery with time windows (VRPPDTW) using complex space–time-state network models, especially from a time- and state-dependent shortest-path perspective.

2.3 The Dial-a-Ride Problem (DARP) and Demand Responsive Transit (DRT)

Flexible demand responsive transit (DRT) services have been considered both theoretically and practically. Shuttle vans, ring-and-ride services, and dial-up buses are examples of shared demand response transport services that can serve travelers in urban and suburban areas. Past studies have proven that such systems have the potential to improve mobility efficiency in urban and suburban areas, not only for travelers in general but also for travelers with special issues, e.g., the elderly or disabled [35]. The dial-a-ride problem (DARP) is an extension of the VRPPD for transporting passengers in transit systems with a set of requests for pick-up and delivery from passengers served by transit fleets of limited size [36]. The objective functions of the DARP generally include minimization of the total routing distance of the fleet, minimization of the travel and wait times of passengers, and maximization of demand [37]. The DARP is an NP-hard problems, since the transit system is obliged to schedule vehicles to serve passengers in a determined time range, making it a dial-a-ride problem with time windows (DARPTW), which is more complex. The structure of the DARPTW is very similar to that of the PDPTW, but it is more complicated and highly sensitive to constraints.

To find near-optimal solutions to the DARPTW, past studies have implemented a range of metaheuristic methods, including ACO [38], GA [39], SA [40], and TS [41]. For further details and a comprehensive review of DARP and DARPTW models, refer to the literature review by Molenbruch et al. [42]. Although these studies have provided useful results that can minimize passenger or operator costs, there are still limitations in the implementation of these approaches in suburban and rural areas. First, most of these studies tried to increase operator revenues by scheduling vehicles on optimal routes even though individual passenger travel times and traveler preferences are important variables that can change traveler behavior. Second, these approaches did not consider relocation of the fleet service, despite the fact that, in high-demand conditions, such relocation might be required. Finally, none of these studies considered visualization tools to show optimal solutions. Although many studies have investigated demand responsive feeder transit problems, very little knowledge is available to solve these problems and design optimal transit networks and carsharing systems while considering the relocation of vehicles.

The current study offers two main innovations over the models reviewed above. First, it considers individual passenger travel times, which means that the feeder transit system can ensure that the travel time of each passenger will not exceed a maximum acceptable value. Second, the proposed model can relocate vehicles among stations (destinations) when there is higher demand at certain stations while still considering time window constraints. Table 1 presents a summary of selected studies related to demand responsive transit (DRT) systems.

Table 1 Summary of selected recent relevant studies on demand responsive feeder bus transit systems

3 Methodology

This optimal routing algorithm was specifically developed for automated demand responsive feeder transit services. The algorithm minimizes total costs, including vehicle operating and passenger travel time costs, while maximum travel times for individual passengers are limited within given maximum travel times. These features differentiate this algorithm from usual delivery–pickup algorithms, which do not consider the travel times of individual packages (in this case, passengers). Moreover, the other innovations of this study are the consideration of the relocation of buses with capacity constraint and the dynamic nature of the operation with time windows, which involves multiple stations and trains. Also, this algorithm applies the simulated annealing (SA) algorithm to solve the proposed model.

Generally, the SA algorithm works effectively in permutation-based problems such as VRP [51] because this local search algorithm uses random transformations from the neighborhood of all solutions by considering the total costs in VRP problems, which are the total dispatching and travel costs of possible solutions [52, 53]. Among metaheuristics that have provided better solutions, TS and SA are effective algorithms (especially for small-scale problems) due to their approach of finding an appropriate neighborhood [54,55,56]. The SA algorithm has been widely used as an efficient approach for solving problems similar in structure to the model developed herein [57,58,59].

3.1 Algorithm

This section presents an efficient algorithm for optimal routing of autonomous feeder transit services. To solve the problem in the model, we applied the SA algorithm, one of the most efficient metaheuristic approaches for solving the vehicle routing problem with time windows [13, 14, 54], because the local search strategy of the SA is more robust for finding high-quality solutions in VRP problems [60]. The SA algorithm uses a probabilistic acceptance strategy which includes many iteration stages to find the global optimum using a temperature-changing schedule [61]. The advantage of SA over other, similar metaheuristics is that it can easily escape from local minima and jump in the solution space to find a global optimum solution because it even accepts worse answers with a specific probability [13].

The first step of this algorithm is the clustering of passengers; it is assumed that all passengers have their own preferred stations and are assigned to certain stations. First, the algorithm creates a random series of integers to create the initial solution (a random permutation of integers from 1 to the number of passengers for the related station plus the number of feeder buses minus one). The algorithm first allocates feeder buses to passengers depending on the location of higher integers in the generated permutation, then, based on the order of integers in the generated permutation, the routes of vehicles are determined; For instance, in the presence of 2 vehicles and 10 passengers, a permutation of integers from 1 to 11 is produced. Suppose that the permutation generated is Path = (10, 1, 3, 4, 8, 11, 2, 9, 5, 7, 6). Then, the route of the first vehicle would be generated to serve passengers 10, 1, 3, 4, and 8, while the second vehicle route would serving passengers 2, 9, 5, 7, and 6. After generating an initial feasible solution (\(x_{\text{initial}}\)), the SA algorithm tries to create a neighboring solution by perturbing the initial solution according to the cost of the neighboring solution (the value of a hypothesized objective function which includes penalties corresponding to modeling constraints). If this cost (\(x_{\text{new}}\)) is less than that of the initial solution, then this new cost will be accepted; otherwise, it will be accepted with probability P = \(\mathrm{e}^{{ - \frac{\Delta f}{T}}}\), where \(\Delta f\) is the change in cost between the new and previous solution and T is the initial temperature. The SA algorithm decreases the temperature during the iteration process towards the optimal solution at a controlled ratio of (\(\alpha = 0.98\)). In each iteration, the algorithm tries to improve the solution by searching its neighborhood using common swap, insertion, and reversion methods randomly. The algorithm attempts to reduce the value of the hypothesized objective function. The original and hypothetical objective functions are calculated as follows:

$$\begin{aligned} Z^{'} & = C_{\text{O}} \times {\text{Total}}\, {\text{vehicle}}\, {\text{travel}}\, {\text{distance}} \\ & \quad + C_{\text{T}} \times {\text{Total}}\, {\text{passenger-in-vehicle}}\, {\text{travel}}\,{\text{time}} \\ Z & = Z^{'} \times \left( \begin{aligned} 1 + 0.5 \times {\text{Number}}\, {\text{of}}\,{\text{passengers}}\,{\text{not}}\,{\text{served}}\,{\text{in}}\,{\text{time}}\, {\text{window}} \hfill \\ + 5 \times {\hbox{Max}}\,{\text{number}}\,{\text{of}}\,{\text{passengers}}\, {\text{in}}\, {\text{excess}}\, {\text{of}}\, {\text{feeder}}\,{\text{bus}}\, {\text{capacity}} \hfill \\ \end{aligned} \right), \\ \end{aligned}$$

where CO is the unit operating cost of each vehicle kilometer and CT is the time value of each passenger per hour. Basically, the SA algorithm improves the solution by using two transformation methods (move and replace highest average) to explore the solution space. The move transformation explores groups of passengers who have the shortest distances closest to each other, including their destinations. It then selects a random route and allocates passengers randomly to it according to the constraints. The replace highest average transformation is based on the average distance of every group of passengers; therefore, the algorithm selects random routes and allocates selected passengers to them in order to minimize the cost. This permutation process (cooling schedule) ends when the temperature reaches below 0.001 and the final solution does not change in iterations. Finally, the best feasible solution found during the total iterations is presented as the final solution proposed by the algorithm. If the algorithm fails to find a feasible solution for a certain station, relocations of vehicles are considered. In this case, the proportion of the number of passengers to the number of feeder buses for adjacent stations is computed, and the algorithm chooses the station with lower proportion to compensate for the deficiency.

To consider the acceptable travel times and routing circuity for individual passengers, the degree of circuity (DOC) and maximum degree of circuity (Max DOC) are introduced, as shown in Eqs. (1) and (2) [62, 63]. The Max DOC and computed shortest travel times are used to define the maximum acceptable travel time for each passenger. Using those maximum acceptable travel times for passengers as constraints, optimal routings are developed for each station using the SA algorithm.

$${\text{Degree}}\,{\text{of}}\,{\text{circuity}}\, \, \left( {\text{DOC}} \right)_{i} = \frac{{\left( {{\text{Actual}} \,{\text{travel}} \,{\text{time}}} \right)i}}{{\left( {{\text{Shortest}} \,{\text{travel}}\, {\text{time}}} \right)_i}},$$
(1)
$${\text{Maximum}}\,{\text{degree}}\,{\text{of}}\,{\text{circuity }}\left( {{\text{Max}}\,{\text{DOC}}} \right) \ge { \hbox{max} }\left[ {{\text{DOC}}_{i} } \right],$$
(2)

where i is an individual passenger.

The buses at each station serve the passengers who use that particular station. We developed the optimal routings and found the optimal number of buses for that operation. So, for each station and for each train, we calculate the number of buses for the operation and compare them with the available buses. If we have more buses than needed, then the surplus will be calculated, and the bus operation will be feasible. If the more buses are needed than are available, the deficiency will be calculated, and it is necessary to examine whether there are surpluses at adjacent stations for relocation.

If the total number of buses available at all stations is more than the number needed at all stations, the entire service may be made feasible by multiple relocations. Figure 1 shows the flowchart of the algorithm, including the process for relocation of buses. In this algorithm, the relocated buses first serve alighting passengers at the station to deliver them to their destinations, then pick up passengers to take them to the goal station to minimize costs. In the algorithm of Fig. 1, s is the index for stations and S is the index for the last station. Each route must start at the initial station 0 and finish at the final station (which can be the same or another station), serve all passengers and time windows of the served passengers, and never violate the vehicle capacity constraint. The mathematical formulation is presented below:

Fig. 1
figure 1

Conceptual flowchart for the proposed algorithm to solve the problem

Variables

$$v_{k} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {{\text{vehicle}}\, k\, {\text{is}}\, {\text{used}}} \hfill \\ 0 \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right.$$
$$y_{ik} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {{\text{passenger}}\, i \, {\text{is}}\,{\text{served}}\, {\text{with}}\, {\text{vehicle}}\,k} \hfill \\ 0 \hfill & { {\text{otherwise}} } \hfill \\ \end{array} } \right.$$
$$\alpha_{ijk} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {{\text{passenger}}\, j\, {\text{is}} \,{\text{served}} \,{\text{after}}\, {\text{passenger}}\, i \,{\text{with}} \,{\text{vehicle}}\, k} \hfill \\ 0 \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right.$$
$$r_{i} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {{\text{passenger}}\, i \,{\text{starts}} \,{\text{trip}}\, {\text{from}}\,{\text{train}}\, {\text{station}}\,\left( {\text{boarding}} \right)} \hfill \\ 0 \hfill & {{\text{passenger}}\, i \,{\text{ends}}\, {\text{trip}}\, {\text{at}}\, {\text{train}}\, {\text{station}}\,\left( {\text{alighting }} \right) } \hfill \\ \end{array} } \right.$$
$$D_{ik} = {\text{distance}} \,{\text{traveled}} \,{\text{up}}\, {\text{to}} \,{\text{passenger}} \,i\, {\text{by}} \,{\text{vehicle}} \,k$$
$${\text{Total}}\,D_{k} = {\text{total}}\,{\text{distance}}\, {\text{traveled}}\,{\text{by}}\, {\text{vehicle}}\,k$$
$${\text{AT}}_{i} = {\text{Vehicle}}\,{\text{arrival}}\,{\text{time}}\,{\text{to}}\,{\text{passenger}}\,i \,{\text{node}}$$
$${\text{WT}}_{i} = {\text{In-vehicle}}\, {\text{travel}}\,{\text{time}}\,{\text{of}}\, {\text{passenger}}\,i$$
$${\text{UC}}_{i} = {\text{Used}}\,{\text{capacity}}\,{\text{of}}\,{\text{vehicle}}\,{\text{after}}\,{\text{serving}}\,{\text{passenger}}\,i$$
$${\text{IC}}_{i} = {\text{number}}\,{\text{of}}\, {\text{passengers}}\,{\text{getting}}\, {\text{on}}\,{\text{at}}\, {\text{train}}\,{\text{station}}\, {\text{onto}}\,{\text{vehicle}}\, k$$

Objective function

$$z = \hbox{min} \mathop \sum \limits_{i = 1}^{I} C_{\text{T}} \times {\text{WT}}_{i} + \mathop \sum \limits_{k = 1}^{K} C_{0} \times{\text{Total}}\,D_{k}.$$
(3)

Constraints

$$\begin{array}{*{20}c} {\mathop \sum \limits_{k = 1}^{K} y_{ik} = 1} & { i = 1,2 \ldots I} \\ \end{array}$$
(4)
$$\begin{array}{*{20}c} {\mathop \sum \limits_{i = 1}^{I} y_{ik} \le M \times v_{k} } & {k = 1,2 \ldots K} \\ \end{array}$$
(5)
$$\mathop \sum \limits_{k = 1}^{K} v_{k} \le {\text{Number}\,\text{of}\,\text{available}}\,{\text{vehicles}}$$
(6)
$$\begin{array}{*{20}c} {2\times \alpha_{ijk} \le \left( {y_{ik} + y_{jk} } \right)} & {i.j = 1,2 \ldots I;i \ne j. k = 1,2 \ldots K} \\ \end{array}$$
(7)
$$\begin{array}{*{20}c} {\mathop \sum \limits_{k = 1}^{K} \mathop \sum \limits_{j = 1}^{I} \alpha_{ijk} + \mathop \sum \limits_{k = 1}^{K} \alpha_{i0k} \ge 1 } & { i = 1,2 \ldots I } \\ \end{array}$$
(8)
$$\begin{array}{*{20}c} {\mathop \sum \limits_{k = 1}^{K} \mathop \sum \limits_{i = 1}^{I} \alpha_{ijk} + \mathop \sum \limits_{k = 1}^{K} \alpha_{0jk} \ge 1} & { j = 1,2 \ldots I} \\ \end{array}$$
(9)
$$\begin{array}{*{20}c} {D_{jk} \ge D_{ik} - M\left( {1 - \alpha_{ijk} } \right) + d_{ij} } & {i.j = 1,2 \ldots I;i \ne j. k = 1,2 \ldots K} \\ \end{array}$$
(10)
$$\begin{array}{*{20}c} {D_{ik} \ge d_{i0} y_{ik} } & {i = 1,2 \ldots I\,k = 1,2 \ldots K} \\ \end{array}$$
(11)
$$\begin{array}{*{20}c} {{\text{AT}}_{i} = \mathop \sum \limits_{k = 1}^{K} \frac{{D_{ik} }}{\text{speed}}} & { i = 1,2 \ldots I} \\ \end{array}$$
(12)
$$\begin{array}{*{20}c} {{\text{WT}}_{i} = ri \,{\text{AT}}_{i} + \left( {1 - r_{i} } \right)\left( {\frac{{{\text{Total}}\,D_{k} }}{\text{speed}} - {\text{AT}}_{i} } \right)} & { i = 1,2 \ldots I} \\ \end{array}$$
(13)
$$\begin{array}{*{20}c} {{\text{AT}}_{i} \le {\text{DOC}} \times \frac{{d_{i0} }}{\text{speed}}} & {i = 1,2 \ldots I } \\ \end{array}$$
(14)
$$\begin{array}{*{20}c} {{\text{AT}}_{i} + \frac{{d_{i0} }}{\text{speed}} \le {\text{cycle}}\,{\text{time}}} & { i = 1,2 \ldots I } \\ \end{array}$$
(15)
$${\text{UC}}_{i} = \mathop \sum \limits_{k = 1}^{K} {\text{IC}}_{k } y_{ik} + \mathop \sum \limits_{k = 1}^{K} \mathop \sum \limits_{j = 1}^{I} r_{i } \alpha_{jik} - \mathop \sum \limits_{k = 1}^{K} \mathop \sum \limits_{j = 1}^{I} (1 - r_{i} )\alpha_{jik}$$
(16)
$$\begin{array}{*{20}c} {{\text{IC}}_{k} = \mathop \sum \limits_{j = 1}^{I} y_{ik} r_{i} } & {k = 1,2 \ldots K} \\ \end{array}$$
(17)
$$\begin{array}{*{20}c} {{\text{UC}}_{i} \le C} & {i = 1,2 \ldots I} \\ \end{array}$$
(18)
$$\begin{array}{*{20}c} {{\text{Total}}\,D_{k} \ge \mathop \sum \limits_{k = 1}^{K} (D_{ik} + d_{i0} y_{ik} )} & { i = 1,2 \ldots I} \\ \end{array}$$
(19)
$$\begin{array}{*{20}c} {\mathop \sum \limits_{j = 1}^{I} \alpha_{0jk} = v_{k} } & { k = 1,2 \ldots K} \\ \end{array}$$
(20)
$$\begin{array}{*{20}c} {\mathop \sum \limits_{i = 1}^{I} \alpha_{i0k} = v_{k} } & {k = 1,2 \ldots K} \\ \end{array}$$
(21)
$$r_{i} = \left( {0.1} \right), \,v_{k} = \left( {0.1} \right),\, \alpha_{ijk} = (0.1),\, y_{ik} = (0.1)$$
$$D_{ik} \ge 0.\, {\text{Total}}\,D_{k} \ge 0. \,{\text{AT}}_{i} \ge 0. {\text{WT}}_{i} \ge 0. \,{\text{UC}}_{i} \ge 0.\, {\text{IC}}_{i} \ge 0 .$$

where I is the number of passengers, K is the number of available vehicles, \(d_{ij}\) is the direct distance between passengers i and j, \(d_{i0}\) is the direct distance between passenger i and station, CT is the value per passenger hour, CO is the unit operating cost of vehicle per kilometer, Speed is the vehicles’ speed, DOC is the degree of circuity, cycle time is 20 min, C is the vehicles’ capacity, and M is a sufficiently large number for modeling the expression.

Formula (3) is the objective function of the problem. Constraint (4) specifies that each passenger is served by exactly one vehicle. Constraint (5) ensures that, if a passenger is assigned to a vehicle, it is considered as a used vehicle. Equation (6) ensures that the total number of vehicles used does not exceed the total number of vehicles available. Equation (7) defines that each path belongs to a single vehicle. Equations (8) and (9) ensure that each passenger is assigned to a path. In these equations, \(a_{i0k}\) represents how vehicle k goes to a station after serving at the location of passenger i, and \(a_{0jk}\) means that vehicle k leaves from the station to the location of passenger j. In particular, Eq. (8) ensures that the vehicle must serve another passenger after serving a passenger or must go to the station, and Eq. (9) ensures that the new route must be constructed from the location of the last served passenger or from the station. Equations (10), (11), and (12) define the arrival time of vehicles to passengers. Equation (13) calculates waiting time for passengers, and Eq. (14) is an additional time ratio constraint. Constraint (15) is the cycle time constraint. Equations (16), (17), and (18) are capacity constraints. The total distance traveled is defined by Eq. (19). Equations (20) and (21) ensure that every route starts and ends at the station.

The developed model was coded in MATLAB. Because it contains several binary variables, the model becomes an NP-hard problem; however, the main challenges in the modeling are the constraints for the relocation of vehicles and the consideration of the DOC for each passenger. The pseudocode shown in Fig. 2 describes the steps in the SA algorithm as applied to solve the proposed model.

Fig. 2
figure 2

The developed SA algorithm to solve the model

3.2 Hypothetical Network

A hypothetical rail transit line with four stations was created to test the developed algorithm and demonstrate its efficiency. Also, we tested four trains to test and demonstrate the relocation of buses, as shown in Fig. 3, which shows a conceptual time–distance diagram with four trains going through four stations. In this figure, blue lines are the regular routes of each bus, which means that the buses will return to the origin stations; however, red lines represent routes for relocated buses that start from the assigned station but end their trip at another station. Figure 4 shows a simplified version of Fig. 3 with the time components removed for easier understanding. In this figure, each set of feeder buses leaves the station when the train arrives with alighting passengers, then comes back to the station after delivering alighting passengers and picking up boarding passengers for the next train; For instance, at station 2 for the first bus set, the blue highlighted bus leaves the station at 10:05 and, after serving passengers, heads back to the assigned station, while the red highlighted bus leaves the station 2 at 10:05 but goes to station 3 instead of station 2, because station 3 needs more buses for the second bus set.

Fig. 3
figure 3

Conceptual time–distance diagram for the example

Fig. 4
figure 4

Simplified conceptual operation of feeder buses

In this example, the headway of the train is assumed to be 20 min and the travel time between two stations is assumed to be 2 min. The capacity of each bus is assumed to be eight passengers. We also neglect the boarding and alighting times of the passengers at the nodes and stations. Table 2 presents the number of boarding and alighting (B/L) passengers for each station and each train; For example, for train 1 at station 1, 16 passengers must be picked up and get on, while 24 passengers get off and need to be at station 1 for train 1. We also assume that the average speed is 30 km/h for the feeder buses and 60 km/h for the trains, while the distance between stations is 2 km. The monetary value of travel time for each passenger is set at $20 per hour, while the operating cost of vehicles is set at $0.3 per kilometer. The origins and destinations of the boarding and alighting passengers are randomly generated around the rail line for the four trains. Four different bus sets are defined according to each time window, such that bus set 1 carries passengers arriving on the first train and those departing on the next train. Figure 5 shows the boarding (blue points) and alighting passengers (red points) around the four stations for the four trains (yellow points).

Table 2 Passenger information for each station and each train
Fig. 5
figure 5

Geographical distribution of passengers

4 Analysis and Results

The proposed SA starts by initializing the inputs and clustering the passengers. The inputs are the passenger demands (times and locations), bus and train speeds, train schedules, and station locations. In the next step, the algorithm finds the optimal solution. In this algorithm, the cost calculation process includes three scenarios: without a relocated bus, with a relocated bus from the previous station, and with a relocated bus from the next station. Finally, the outputs are the passengers’ travel times, vehicles’ traveled distances, buses assigned to each station in each time window, relocated buses, and bus routes.

As mentioned above, one aspect that can be distinguished in this research is the consideration of the maximum degree of circuity (Max DOC) of individual passengers. Unlike package delivery and pickup, passengers are likely to consider their travel time in the feeder bus when choosing this service. So, we calculate each individual passenger’s shortest direct travel time from the origin to the station (or to the destination from the station) and compute the maximum acceptable travel time in the feeder bus as a constraint for the algorithm. Those acceptable additional times are calculated and used as a ratio (travel time in the feeder bus/direct travel time to the origin or to the station). A Max DOC of 2.5 is applied in the algorithm algorithm, and the results are shown in Fig. 6 and Table 3.

Fig. 6
figure 6

Results of feeder bus routings (Max DOC of 2.5)

Table 3 Results of model with Max DOC of 2.5

Figure 6 shows the results of the feeder bus routings, including relocation of buses. For train 3, two buses are relocated, as shown by dashed lines. One bus was relocated from station 2 to station 1, and one from station 2 to station 3. The calculation times for running the algorithm in MATLAB for bus set 1 to bus set 4 were 1229.32 s, 1746.24 s, 2394.56 s, and 1374.12 s, respectively, on a computer equipped with an Intel Core i5 1.9 GHz (8 GB RAM) processor.

5 Conclusions

Although demand responsive feeder bus operation is possible even with human-driven vehicles, it is not very popular and is mostly available as a special service because of its high operating costs due to the intensive labor costs. However, once automated vehicles become available, small-sized flexible door-to-door feeder bus operation may became more realistic, and preparing for this eventuality is necessary to take advantage of the rapid improvement of automated vehicle technology. So, in this research, an algorithm for optimal flexible feeder bus routing, considering the relocation of buses for multiple stations and trains, was developed using an SA algorithm for future automated vehicle operation.

An example was developed and tested to demonstrate the developed algorithm. The algorithm successfully handled the relocation of buses when the optimal bus routings were not feasible using the buses available at certain stations. The developed algorithm also considers the maximum acceptable degree of circuity (DOC) for each passenger’s trip while minimizing the total costs including total passenger travel time and vehicle traveled distance. Unlike package delivery and pickup problems, each individual considers his/her travel time in the feeder bus, while the transit agency considers the vehicle operating costs.

This study also provides a mechanism for future evaluations of how efficient automated feeder services are and how they will compare with fast-approaching automated ridesharing and carsharing services. Eventually, these studies will help predict users’ travel behavior and modal choices between automated ridesharing/carsharing systems and automated feeder services for mass transit.

For future research, three directions could be considered. First, a feeder bus routing algorithm for trains with much shorter headways is being developed, which requires a passenger–feeder bus–train matching process in the algorithm. Second, an algorithm using smarter metaheuristics, incorporating composite heuristics for larger and real networks, will be developed and adopted. Third, temporary feeder stops [64] could be considered in the model.