# Dynamic Demand-Responsive Feeder Bus Network Design for a Short Headway Trunk Line
## 3 Methodology
### Algorithm
**Step 8: For the next passengers:**

Step 7.1: Add the next passenger to the path

Step 7.2: IF arrival time to current passenger > Earliest pick up time of the passenger THEN go to step 9, otherwise go to step 10

**Step 9:**Arrival time to the passenger= time + traveled distance/speed

Time = Arrival time to the passenger

**Step 10: The vehicle should wait for the passenger**

Time = Arrival time to the passenger

**Step 11:**Total traveled distance= Total traveled distance+ distance to current passenger

**Step 12:Check to see if the cost of coming back to the station is better than continuing to board passengers (for the last passenger)**

If the cost of coming back to station is less than continuing to board passengers THEN go to step 13, otherwise go to step 15

**Step 13: Check to see coming back to station does not makes the path infeasible**

If in case of coming back to the station the updated latest pick up time of the next passenger is accepted THEN go to step 14, otherwise go to step 15

**Step 14:**Add station as the next visited node**

Step 14.1: Time = Arrival time to the station

Step 14.2: used_capacity = 0

Step 14.3: Update total traveled distance

Step 14.4: Calculate waiting times of boarded passengers

**Step 15:**Accept continue to board the next passenger**

Step 15.1: Update used_capacity = used_capacity + 1

Step 15.2: Update maximum_used_capacity

IF used_capacity > maximum_used_capacity  maximum_used_capacity  END IF

Step 15.3: go to step 8

**Step 16:**Calculate waiting times of current boarded passengers

**Step 17:**END

## 4 Hypothetical Network

A hypothetical rail transit line that has four stations fitted to urban and suburban conditions was developed to examine and evaluate the efficiency of the algorithm. In this example, the headway of the train is assumed to be 5 min, and the travel time between two stations is assumed to be 2 min. Three buses are assigned to each station initially, and a total of 12 buses are available in the model. Passengers' boarding and alighting times at the nodes and the stations were waived in this study. Figure 4 shows the geographical distribution of the passengers in the hypothetical network where the circle points represent passengers, and the four yellow boxes are stations. Table 2 represents the number of boarding and alighting (B/A) passengers for each station and each train. The origins and the destinations of the boarding and alighting passengers are randomly generated around the rail line for four trains. In this paper, it is assumed that the average speed for feeder buses is 30 km/h and for trains is 60 km/h; each bus has a 12-passenger capacity, and the distance between stations is 1 km. The duration time for the model was considered as one hour; therefore, there would be 12 train sets according to the 5 min headway of trains. The travel time monetary value for each passenger was assumed as USD 20 per hour, and USD 5 per kilometer for vehicles was used as the feeder bus operating costs. The inputs of the example are passenger locations, passenger schedules, headway for arrival trains, vehicle speed, trains' schedules, stations' coordination, and velocity of trains. Accordingly, the outputs would be passengers' travel time, vehicles' traveled distance, assigned buses in each station in each time window, relocated buses, and routes. ## 5 Results and Analysis

The proposed SA started with the initializing of inputs and clustering of the passengers. It is important in this algorithm that the cost calculation process includes three parameters: without relocation to other stations, considering relocated bus(es) from the previous station, and considering relocated bus(es) from the following station. Table 3 shows the results of the computations for the model. Figure 5 shows the results of the feeder bus movements including relocation of the buses for stations. In this figure, the travel path is indicated by arrows, with the arrow's beginning signifying the starting point and its end denoting the end of the trip.