Flexible Bus Route Optimization Scheduling Model

A flexible bus route optimization scheduling model that considers the dynamic changes of passenger demand is proposed to address the large difference in demand for flexible bus passengers and real-time variability. This model uses the heuristic algorithm based on gravity model to determine the following: passenger booking; vehicle passenger capacity; team known conditions such as size, according to the dynamic changes of passenger demand for real-time iterative update shuttle travel time; vehicle operating costs (vehicle); and time cost for passengers (passengers waiting time for the vehicle, actual time of arrival, and the difference between expected and actual times of arrival) before minimization as the target. Finally, the practicabilities of the model and algorithm are verified by an example. Analysis results show that for 102 travel demands of 15 randomly generated demand points, completing all services requires 17–21 vehicles with average travel time of 24.59 minutes each. The solution time of 100 groups of data is within 25 seconds and the average calculation time is 12.04 seconds. Under the premise of real-time adjustment of connection planning time, this optimization model can thus better meet the dynamic demand of passengers compared with the current scenario. The model effectively reduces the planning path error, shortens the travel distance and passenger travel time, and achieves better results than the flexible bus scheduling model that ignores changes of connection travel time.


Introduction
How to realize optimal scheduling is the main problem faced by urban public transport operation and management. A good bus scheduling system can quickly optimize and adjust the line operation plan according to the travel needs of passengers. In addition, this system can improve the line service rate, reduce running time, and reduce travel time cost of passengers [1][2][3]. e traditional bus route optimization method is mainly designed based on experience, long-term observation, or IC card data statistical analysis. e objective is to extend, shorten, add, or delete certain lines, adjusting to the optimization and priority that meet the passenger demand of large passenger flow site. is method is mainly suitable for fixed-line bus route optimization with long cycle adjustment [4][5][6][7]. e emergence of flexible buses provides the possibility for dynamic optimization and adjustment of routes [7][8][9][10]. Vincent et al. [11] proposed a mixed-integer linear programming model and a variable neighborhood search to deal with the flexible vehicle and crew scheduling problem, by solving the problem that urban bus transport agencies have to assign their resources (vehicles and drivers) to cover timetables generated at the tactical level. Giorgio et al. [12] explored the potential contribution that the public transport agency can make to the emerging mobility as a service (MaaS) paradigm through the integration of regular collective transport services with complementary flexible transport schemes and other forms of shared-use transport. Nourbakhsh and Ouyang [13] presented an alternative flexible-route transit system in which each bus is allowed to travel across a predetermined area to serve passengers, analyzed the agency and user cost components of this proposed system in idealized square cities, and sought the optimum network layout, service area of each bus, and bus headway, to minimize the total system cost. Mulley and John [14] presented a viewpoint through their research that wellimplemented FTS has the potential to revitalise bus-based public transport services which are traditionally based on fixed networks with variable geographical coverage and levels of service. Jenny et al. [15] designed a multicommodity network flow programming model and obtained exact routing solutions using Lagrangian relaxation and a dynamic programming algorithm. Quadrifoglio and Dessouky [16] established the mixed-integer programming equation of system route optimization through analysis of key parameters of the flexible bus system. ey likewise conducted simulation verification analysis on the system route design and scheduling problems to correct the model parameters [17]. Fu et al. [18] used super network to simultaneously simulate user activities and travel behaviors and then established a bus route selection model according to user travel behavior characteristics. Koffman [19] proposed an intelligent scheduling algorithm for urban public transport based on multiobjective demands. Tsubouchi [20] used the minimum spanning tree to find the optimal bus path. Xiong [21] developed an optimization method of community bussubway connection route considering potential demand. Qian-fei et al. [22,23] established a hyperpath bus transport path adjustment model by deducing the expected waiting time of passengers and the probable number of passengers on the route. Pan [24] proposed a flexible bus route optimization and scheduling method based on long reservation. Guo [25] offered a customized bus route optimization selection method based on demand response. ese studies are all flexible bus route optimization algorithms established according to passengers' reservation needs. However, the preconditions are that passengers make advance appointments or assume that passenger needs are known, that is, the methods are all based on "static demands." However, travel often requires short or instant reservation according to passenger needs. Flexible buses need to calculate the change of vehicle connection travel time caused by changes according to the "dynamic demand" of passengers. And these buses need to adjust routes to achieve dynamic optimization. In addition, the flexible bus connection modes in almost all the research studies mentioned above are in form of "many-to-one," that is, multiple flexible stations corresponding to one target station. e case of multiple flexible sites corresponding to multiple target sites (the "many-tomany" pattern) has rarely been studied.
With such consideration, the present study proposes a flexible bus route optimization scheduling method based on passenger dynamic demand and the "many-to-many" pattern. is method considers dynamic changes of passenger demand and the resulting changes of vehicle connection travel time. A flexible bus route optimization scheduling model is constructed on the basis of the known passenger carrying capacity and vehicle fleet size. en, the connection trip time is updated in real time according to the dynamic variation characteristics of passenger demand and considering the time cost of vehicle operation and passenger travel.

Problem Description.
A flexible bus is a demand-based transportation system that can gather individual passengers' travel needs and provide personalized transportation services. Under the "dynamic real-time" demand mode, which is the focus of this study, the flexible bus system has high requirements on algorithm and operation cost control. e following assumptions, parameter selection, and modeling are carried out to establish a reasonable and appropriate model. Several factors such as passenger demand and operating cost are likewise considered.

Model Assumptions.
e following assumptions are proposed, with (1) and (2) as dynamic hypotheses and (3)-(6) as static hypotheses: (1) Passenger reservation demand changes dynamically at each station. (2) e travel time between stations is dynamic.
(3) Location of each site is known. (4) After booking, the time for each passenger to arrive at the target station is known. (5) e service time for passengers to board the train is constant. (6) e passenger-carrying capacity of the transfer vehicle is known. Table 1 shows the definition and description of the input and decision variables in the model.

Model Presentation.
e coordination scheduling optimization model can be expressed as the following nonlinear programming model.
Equation (1) is the objective equation, which includes the minimization of the sum of three factors: (1) travel time of all vehicles to reduce operating costs; (2) sum of waiting time of all passengers in each station; and (3) sum of waiting time of all passengers in the target station. e latter two are determined to reduce the passenger time cost.
Constraints (2) and (3) indicate that for each demand point, at least one vehicle service and at most V vehicle service are available. 2 Advances in Civil Engineering i∈H k∈K Constraint (4) means that at most V vehicles participate in the operation.
Constraint (5) indicates that in addition to the first demand point of each vehicle service, the number of vehicles entering should be equal to that leaving to serve the other demand points.
i∈H j∈D Constraints (7) and (8) ensure that each vehicle delivers passengers to their final destination. r∈R t∈T X rkt ≤ Q k , ∀k ∈ K. (9) Constraint (9) ensures that the capacity of each feeder vehicle does not exceed its rated capacity to ensure the service level.
k∈K t∈T Constraint (10) means that any requirement can only be served by one vehicle.
Constraint (11) indicates that a transfer vehicle can only connect passengers at one departure time of a target station.
Constraint (12) guarantees that all demand served is equal to the known reservation demand.
Constraints (13) and (14) indicate that if two stations are successively served by a transfer vehicle, then the arrival time of demand in the latter station is equal to the sum of the arrival time of demand in the previous demand point and the travel time between the two demand points.
Constraints (15) and (16) indicate that the time for the passenger to reach the target station at the last demand station of the connecting vehicle is equal to the sum of the travel time of the vehicle to reach the demand point and the travel time between the two demand points.
Constraint (17) ensures that the vehicle arrives at the target station no later than the departure time of the target station.

Model Solution
e flexible bus route optimization scheduling problem for multiobjective stations is a typical NP-hard problem. As the problem scale expands, the computation likewise increases exponentially.
erefore, this kind of problem is usually solved by heuristic algorithm that can guarantee calculation speed and accuracy. Inspired by the law of universal gravitation, the present study proposes a heuristic algorithm that first generates the initial solution on the basis of the gravitation model. en, the route is separately improved by the inter-route and intra-route optimization algorithm to obtain the final route. Figure 1 is the overall flow of the heuristic algorithm based on the gravity model and is the overall description of the following steps 1 to 4.

Passenger Travel Reservation and Demand Distribution.
First, the passenger travel reservation and demand allocation are completed according to the following steps.
Step 1: passengers make travel reservations according to their travel needs. Each passenger transmits his/her departure station, target station, expected arrival time, and other information to the travel reservation platform. Considering their dynamic changing characteristics, passenger demand on reservation platforms and travel time between connecting vehicle stations are updated every five minutes.
Step 2: travel reservation platform clusters all passengers according to the target station and expected arrival time of each passenger according to the principle that the actual arrival time is not later than the expected arrival time of passengers.
Step 3: results are generated according to the path in Sections 2.2 and 2.3. e arrival time of the transfer vehicle at each demand point is preliminarily estimated on the basis of several factors, including the expected arrival time of the transfer vehicle, average driving speed, position of the passenger demand point, and number of passengers at each demand point.
Step 4: the preliminarily estimated time of the connecting vehicle arriving at each demand point is sent to the passengers of the corresponding demand point. Passenger can choose whether to take the bus or wait for the connecting vehicle according to the rationality of its arrival time.

Generating Initial Vehicle Path Solution on the Basis of the Gravity Model.
e path search problem is transformed into the iterative problem of the site selection chain, which is most attractive to the current site based on the gravity model algorithm. e gravity between the two sites is defined as follows.
where N i is the number of passengers at station i and c ij is the travel time between station i and station j. e higher value of F ij means that the two stations have more passengers and less travel cost, thus needing priority service. erefore, station j should be set as the next station of station I. Given the rated vehicle carrying capacity, the steps of the gravity model algorithm to generate the initial path solution are as follows.
Step 1: determine the vehicle starting point. Initial k � 1. Randomly select one station with passenger boarding requirements as the starting point of vehicle k.
Step 2: determine if similar passengers are not serviced. If so, proceed to Step 3. Otherwise, proceed to Step 5.
Step 3: search for the next site. e most attractive station X is that between the current station and that in the boarding station with similar passengers. Station X is then added to the route selection chain, and the number of passengers is calculated after the vehicle arrives at the station, and the time to arrive at the target site after joining station X.
Step 4: determine whether the vehicle route is reasonable after joining station X. If the number of passengers served by the current vehicle does not exceed the on-board capacity Qk and the time to reach the target station does not exceed the time required by passengers, then station X shall be taken as a new starting point. us, Step 5 is skipped. Otherwise, proceed to Step 5. 4 Advances in Civil Engineering Step 5: determine if all classes of passengers are served.
If several passengers are not scheduled, then the next car should be dispatched, k � k + 1 and go back to Step 1. Otherwise, all current initial paths are output, and the initial vehicle path solution generation algorithm based on the gravity model is completed.

Vehicle Routing Optimization Based on Station Equilibrium and Exchange.
is section introduces the route optimization algorithm between and within routes to further improve the route quality and passenger service level. Notably, Steps 1 and 2 of the algorithm belong to inter-vehicle path optimization. During their execution, multiple feasible route solutions may be searched. If only the current optimal set of solutions is saved during the search and Step 3 is performed, the final route result may not be optimal. erefore, the proposed algorithm saves all feasible solution groups found in Steps 1and 2, and Step 3 is performed for each feasible solution group. Moreover, the objective function of all route solution groups is comprehensively evaluated so as to find the final optimal solution.
Step 1: first, the number of stations between the vehicles serving the target site and taking the same time to reach the target site is equalized. Service stations are checked for any imbalance in this number. If found, then on the premise of meeting the requirements of vehicle capacity and time to reach the target site, several vehicle routes that need to pass through more sites are transferred to the vehicle routes that need to pass through fewer sites.
us, reasonable site sequence is arranged.
Step 2: the path between vehicles that serve the target site and those that need the same amount of time to reach the target site is optimized. e main application between the two routes is the exchange of two sites and search for better routes. In the process of exchange optimization, vehicle capacity and time to reach the target site are guaranteed.
Step 3: route of each car is internally optimized. e order of the two stops is exchanged mainly within the same vehicle route to evaluate whether the objective function value is reduced. If so, then site order is exchanged. Otherwise, this exchange is abandoned. After a certain number of attempts, the algorithm is terminated and the final route result is output.
Step 4: considering the dynamic variation characteristics of passenger demand and the variation characteristics of travel time between stations, the requirements of each station are collected and recalculated every five minutes, and Steps 1-3 above are repeated.
After the above four steps, the objective function of the route scheduling model can be optimized on the premise of ensuring that passengers arrive at the target station according to the expected time. e entire service time can be reduced and the route of each vehicle is more reasonable than before. In addition, the running cost of vehicles and waiting time of passengers can be reduced while service quality and efficiency can be improved.

Advances in Civil Engineering
A small network is used as case solution to verify the accuracy and applicability of the above model. Table 2 shows the input parameter of the constant variable of a small network, whereas Table 3 shows the passenger demand of each station at the initial moment. Table 4 shows the travel time matrix between stations at the initial time, where H is the demand point and D is the target station.
en, such platforms are solved again using the method described in Section 2.2. Figure 2 shows the schematic diagram of vehicle routing results.

Conclusion
is study investigates the flexible bus route optimization scheduling problem. e proposed model is dynamically constructed on the basis of passenger needs and "many-tomany" flexible bus system (i.e., multiple flexible stations corresponding to multiple target sites). Moreover, the routes are considered according to the dynamic changes of passenger demand and real-time updated shuttle travel time.
e routes are established to maximize passenger services, minimize travel time for all passengers, and minimize operating time for all vehicles. e example shows that the flexible bus route optimization scheduling model in  response to dynamic demand can give more reasonable route optimization scheme and optimize passenger travel and vehicle operation cost compared with the model which ignores the change of passenger demand and takes the connection travel time as a fixed value.
In addition, we select more parameters in modeling and consider more factors, such as passenger demand, operating cost, etc., to make our solution to be nearer to the reality of the flexible bus system. At the same time, we focus on the actual travel demand for flexible bus scheduling in Huilongguan District of Beijing and establish the flexible bus scheduling model for multiple flexible stations and multiple target sites, which has more practicability than the "manyto-one" (i.e., multiple flexible stations corresponding to one target site) scheduling model.
For future research, we will select more areas to use our proposed flexible bus route optimization scheduling method, and then we will continually evaluate the effectiveness of the model for urban public transport operation and management and optimize the model and parameters.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request, and the reader can use MATLAB for verification.

Conflicts of Interest
e authors declare that they have no conflicts of interest.