An intelligent design framework for customized bus networks integrating capacity-constrained clustering and route optimization
Abstract:
With the rapid expansion of high-speed railway networks and the continuous growth in urban travel demand, the efficiency of first/last-mile connections at transport hubs has become a critical factor constraining the performance of integrated transportation systems. Demand-responsive customized bus services dynamically match passenger demand with available capacity, providing a feasible solution for improving travel flexibility. However, in practical applications, the rational design of customized bus networks remains challenging due to heterogeneous spatial demand distributions, vehicle capacity limitations, and various operational constraints. This study proposes an integrated methodological framework for customized bus network design that combines three key components: stop identification, route optimization, and simulation-based validation. First, a hybrid clustering approach that integrates density-based clustering with centroid partitioning is employed to extract potential stop locations from passenger origin–destination data. A capacity-constrained mechanism is further introduced to regulate clustering results, ensuring that stop sizes are compatible with vehicle carrying capacity. Based on the identified stops, the network design problem is formulated as a vehicle routing problem with time window constraints, where operational cost, passenger travel time cost, and environmental impact are jointly considered as optimization objectives. A genetic algorithm is adopted to solve the model. A case study involving a feeder service between a high-speed rail station and the urban core business district is conducted, and the proposed framework is validated through simulation using the AnyLogic platform. The results demonstrate that the proposed method improves vehicle utilization and route efficiency while maintaining service quality and system stability. This research provides a practical technical pathway and decision support for the intelligent design and operation of demand-responsive customized bus services.1. Introduction
Since 2016, China’s high-speed railway network has continued to expand, the operating mileage of high-speed railways has increased significantly, and the passenger flow at hub stations has continuously grown, which puts forward higher requirements for efficient connection and evacuation capacity. In this context, existing conventional bus and metro systems have gradually shown limitations in timeliness and peak-hour carrying capacity, making it difficult to meet passengers’ demands for rapid and comfortable travel. To improve hub connection efficiency, demand-responsive customized bus services have gradually emerged. This mode integrates passengers’ personalized travel demands and provides point-to-point or quasi-direct feeder services, and has become an important supplementary form for improving the integrated transportation system. Existing studies mainly focus on customized bus applications in commuting scenarios, while introducing them into high-speed railway hub feeder systems has important practical significance for improving overall transportation system efficiency and reducing travel costs.
Regarding the operation mode of customized buses, scholars have conducted extensive research, mainly focusing on two key issues: stop location and route planning. Wu et al. [1] proposed a real-time planning method based on multi-agent deep reinforcement learning for the real-time route planning problem of responsive customized buses. By modeling multi-route planning as a multi-agent Markov decision process and adopting an encoder–decoder network with policy gradient training, the method achieved lower operating costs, better service quality, and millisecond-level real-time decision-making capability compared with traditional methods. Ma et al. [2], considering the scenario where link travel time impedance is uncertain, designed a multi-objective robust optimization model for customized bus routes. Combined with the Bertsimas–Sim robust optimization theory, the robust counterpart transformation was performed for the model with uncertain parameters, and then a three-stage hybrid encoding Nondominated Sorting Genetic Algorithm II (NSGA-II) was applied for solution. Joaquín et al. [3] constructed a bi-objective vehicle routing optimization model for rural school bus routing that simultaneously minimized operating costs and the maximum riding time of students, and proposed a hybrid heuristic algorithm combining NSGA-II and local search. Pareto optimal solutions were obtained through real rural cases, providing an effective decision-making method for balancing scheduling efficiency and service fairness. Shen et al. [4] considered passengers’ travel preferences and constructed a customized bus route planning model for real-time travel demand. First, a column generation algorithm was used to solve the vehicle stop-line planning problem with time windows, and then an improved Hospital–Resident bilateral matching algorithm was used to match passengers’ travel demand with vehicles one by one, improving the attractiveness of customized buses. Huang et al. [5] constructed a bi-level decision planning model to analyze the interaction between vehicle operating enterprises and passengers. The customized bus stop-line planning problem was treated as a mixed-integer programming problem, with operator revenue maximization as the optimization objective, and service deviation constraints were added to the model. Zeng et al. [6], for the bus signal priority scenario, proposed a people-oriented signal timing optimization model considering stochastic bus arrival time and variable cycle length. Through robust optimization and a hybrid strategy of deterministic and rule-based green extension, total passenger delay was minimized within a fixed planning horizon, significantly reducing bus passenger delay while having little impact on private vehicle delay. Sun et al. [7] optimized urban customized bus services based on a probabilistic model, considering the randomness of customized bus arrival time. With bus load and time windows as constraints, the total cost of enterprises and passengers was minimized. A mixed-integer model was constructed and solved using a hybrid genetic algorithm combined with an adaptive neighborhood search algorithm. Lee et al. [8] established a flexible bus service planning model with multiple vehicle types, taking maximum revenue and minimum sum of time cost and operating cost as objective functions. Profit optimization was achieved while considering detour cost, and the model was solved using a gradient algorithm and greedy search method. Xiong et al. [9], to solve the routing and departure time optimization problem for demand-responsive feeder services between bus stops and metro stations, constructed a mixed-integer programming model with the objective of minimizing total system cost, and solved it using tabu search and variable neighborhood search algorithms. Yu et al. [10] classified customized bus service modes into suburban type, radial type, and circular type based on geospatial distribution characteristics, and proposed a stop-line planning method based on large-scale travel data Empirical analysis verified its effectiveness in reducing traffic pollution emissions. By analyzing the communication path issues in Network Mobility (NEMO), Zhao et al. [11] conclude that the existing routing takes detours, and therefore route optimization is needed. Zhu et al. [12], using a genetic algorithm to establish a picking path optimization model, compared with the traditional S-shaped picking route, this method can significantly shorten the picking distance and time, thereby improving warehouse picking efficiency. By adopting mathematical programming and heuristic algorithms to construct CB-Planner, Lyu et al. [13] concluded that this framework is capable of automatically designing customized bus stops, routes, and schedules, thus enhancing service efficiency and economic benefits. Using real-time visual gesture recognition and a virtual environment framework for the design of a rehabilitation training prototype, Avola et al. [14] concluded that this system can help therapists quickly customize and modify personalized rehabilitation exercises. Ye et al. [15], proposing a dynamic customized reputation system called DC-RSF, combined with a reputation calculation model and a blockchain module, conclude that this framework can evaluate the trustworthiness of cloud service providers according to user needs and prevent reputation data from being tampered with. Umasha et al. [16], proposing a five-stage Nadi signal preprocessing method, conclude that this method can effectively remove noise and achieve 88.9\% accuracy in diabetes diagnosis experiments. Itani et al. [17], establishing an optimization framework for bus bridging under capacity constraints, conclude that, compared with empirical scheduling, this method can more reasonably determine bridging vehicles and source routes, reducing delays and queues during disruptions. Liu & Chen [18], combining Petri nets, a design structure matrix, and the Stochastic Disturbance Particle Swarm Optimization (SDPSO) identification algorithm, conclude that this method can identify and model complex coupling structures in business processes. Black et al. [19], using AnyLogic to establish a passenger flow simulation model for a railway passenger station and proposing optimization schemes, conclude that after optimization, the passenger flow lines are clearer, cross-interference is reduced, and station capacity is improved.
In summary, existing studies have achieved relatively rich results in customized bus route optimization and scheduling methods, but systematic research for high-speed railway hub feeder scenarios is still relatively limited, especially in demand spatial clustering, coordination of capacity constraints, and network-level optimization, where further improvement is still needed. Based on this, this paper takes demand-responsive customized buses for high-speed railway stations as the research object. On the basis of analyzing their operational characteristics, passenger reservation travel data are used as the core input to construct a multi-objective optimization model considering enterprise, passenger, and social benefits. A clustering method is introduced for stop location, and a genetic algorithm is combined for route optimization. Finally, the model results are validated using the AnyLogic simulation platform, in order to provide a reference for the optimized design and practical operation of customized bus systems.
2. Problem Description and Core Assumptions of Customized Bus Operation Mode
Customized buses, as an innovative service mode relying on reservation demand, have core advantages reflected in their differentiated positioning compared with traditional buses and ride-hailing services. By integrating travel demands with similar origins and destinations, they provide flexible, efficient, and higher-quality travel services, mainly presenting the following characteristics.
In terms of operational efficiency, customized buses pursue “quasi-direct” services or limited-stop fast operation and rely on priority access to bus-only lanes, thereby significantly improving travel reliability and timeliness. In terms of riding experience, the reservation mechanism actively matches supply and demand, effectively controls the number of passengers on board, and aims to provide a more spacious and comfortable riding environment than conventional buses. From an economic perspective, the ride-sharing mode makes the per-capita travel cost far lower than that of ride-hailing services and private cars, achieving optimized cost performance. At the same time, this intensive travel mode helps reduce the number of small motor vehicles on the road, which not only alleviates traffic pressure but also reduces per-capita pollutant emissions, reflecting a green and sustainable travel concept. Most importantly, the stop setting and route planning of customized buses are not fixed, but can be flexibly adjusted according to passengers’ dynamic reservation demands, thereby truly responding to diverse personalized travel scenarios.
At present, customized buses in China have developed various service types, including commuting, community, campus, event feeder, and rapid trunk line services. Commuting routes effectively alleviate travel pressure during peak hours, community micro-circulation routes solve the “last-mile” connection problem, and dedicated services for large-scale events or campuses demonstrate the flexibility of scenario-based applications. Nevertheless, their development still faces multiple practical constraints. On the one hand, services show a significant regional imbalance, with resources highly concentrated in a few large cities. On the other hand, operational efficiency is greatly affected by external factors such as traffic conditions and weather, and punctuality and reliability face challenges. Meanwhile, demand fluctuations and information asymmetry on the demand side also lead to unstable load factors. In addition, current services mainly focus on commuting peak periods, and the coverage capability during off-peak periods and non-typical travel demand scenarios is obviously insufficient. These factors jointly restrict the process of large-scale and sustainable operation.
The operation process of customized buses begins with the accurate acquisition of passenger travel demand. Different from conventional buses that rely on historical data prediction, customized buses directly collect personalized information such as origins, destinations, and travel time submitted by passengers through online platforms, providing core data support for subsequent planning. After obtaining demand, the process enters the stop and route planning stage. Enterprises transform passengers’ origin–destination information into geographic coordinates and determine ride-sharing stops and service population using clustering analysis and other methods. On this basis, with the objective of minimizing comprehensive cost, and considering constraints such as vehicle capacity and time windows, a model is established to solve specific feasible route schemes. To ensure service implementation, supporting personnel scheduling and fare setting are also required. Driver shifts need to match flexible and variable routes, and fares usually adopt a distance-based pricing method, with prices between conventional buses and ride-hailing services, in order to balance operating cost and market attractiveness. Finally, after reaching the minimum number of passengers required to open a route, enterprises release detailed departure time, stops, routes, and fare information to passengers through the platform. Passengers can purchase tickets online and board at designated stops with electronic vouchers, thus completing the closed loop from demand reservation to service experience.
The detailed operation planning process of customized buses is shown in Figure ~\ref{fig1}.
In customized bus stop-line planning, the selection of stopping locations is a key link, which directly affects the quality and efficiency of subsequent route design. Reasonable stop setting needs to balance operating cost and passenger demand: too many stops will lead to longer operating time and higher cost, reducing overall efficiency; too few stops will limit service coverage, making it difficult to meet diversified travel demand and weakening the attractiveness of customized buses. Therefore, precise stop selection is not only the basis of operation planning, but also the premise for coordinated optimization of enterprise benefits and passenger satisfaction. For the reservation demand response characteristics of customized buses at high-speed railway stations, the stop location problem in this paper is defined as follows: within a specific area, according to origin–destination coordinate data submitted by passengers through intelligent terminals, several demand aggregation areas are divided through clustering analysis, and the center location of each area is determined. On this basis, combined with actual traffic conditions and road facility conditions, the specific locations of ride-sharing stopping points are finally selected. The clustering schematic of stopping points is shown in Figure 2.


In the Figure 2, blue dots and green dots represent passenger origin–destination points, where green dots represent demand points not included in the customized bus service range; red dots represent customized bus stopping points, and the circular area centered on the red dots represents the service range of customized bus stopping points. The fixed stop location problem of customized buses can be regarded as determining the specific positions and number of vehicle stopping points represented by the red dots in the Figure 2 through clustering analysis.
When planning customized bus stopping points, multiple factors need to be comprehensively considered. The primary consideration is passenger safety and comfort. Stops should avoid areas with dense pedestrian flow and narrow roads as much as possible to ensure the safety and controllability of waiting and boarding/alighting processes. Secondly, passenger convenience should be fully ensured. By optimizing stop layout, passenger walking distance and time should be minimized as much as possible, thereby improving service attractiveness and passenger satisfaction. In addition, the specific setting of stops also needs to be combined with actual road conditions, avoiding unfavorable locations such as rivers and intersections, and evaluating their impact on surrounding traffic flow. Road sections with more lanes and stronger traffic capacity should be preferentially selected to ensure smooth overall traffic operation.
The stop location of demand-responsive customized buses at high-speed railway stations based on reservation demand is ultimately determined based on passenger reservation demand data and actual road traffic conditions, which is quite different from traditional conventional buses. Based on the problem in this paper, the assumptions related to stop selection are as follows:
(1) The boarding points of all passengers are the same high-speed railway station, and the alighting points are distributed in the urban area. No new boarding orders are accepted during the trip (consistent with the high-speed railway station evacuation scenario).
(2) The constant speed assumption is not adopted. Vehicle speed is set according to the average speed during peak hours of the urban road network (e.g., urban road sections are set to 20 km/h). Travel time is calculated by dividing the shortest path distance obtained from the Gaode/Baidu Map API by the average speed.
(3) Passengers within the same clustering cluster are uniformly assigned to get off at the centroid position of the cluster, and the walking distance is within an acceptable range (e.g., within 500 m).
(4) The customized bus models dispatched by the operating enterprise are identical, the maximum passenger capacity is fixed, and the number is sufficient.
(5) Vehicles travel at a uniform speed on all routes, and the speed is a fixed value, without considering the influence of traffic conditions on vehicle speed.
3. Capacity-Constrained Customized Bus Stop Location
In the stop location (i.e., virtual stop generation) of customized buses, the core task is to merge passenger demand points that are spatially close and have consistent time windows, so as to extract centroid positions for bus stopping. Spatial clustering algorithms are commonly used methods to solve such problems. At present, the most widely used algorithms in traffic demand clustering are mainly K-means clustering and Density-Based Spatial Clustering of Applications with Noise (DBSCAN) density clustering, but both have certain limitations when directly applied to customized bus scenarios.
K-means, a typical distance-based partition clustering algorithm, is shown in Figure 3. Its core idea is: preset the number of clusters (K), and through iterative calculation, assign all data points to the nearest cluster center, and continuously update the cluster center positions until the objective function (usually the sum of squared errors from all points to their assigned cluster centers) is minimized.

In the customized bus scenario, although the K-means algorithm has fast computation speed and simple principle, it has the following three fatal defects:
(1) In actual operation, before processing a batch of reservation orders, planners find it difficult to know in advance how many bus stops need to be set (i.e., the value of K). If K is set too large, it will lead to dense stops and frequent bus stopping; if set too small, it will lead to excessively long average walking distance for passengers.
(2) K-means forces all data points to be assigned to a certain cluster. If a passenger’s destination is extremely remote (i.e., spatial outlier), the algorithm will still pull it into a clustering cluster, which will not only seriously shift the centroid position of the cluster, but also force the bus to make a large detour for this single passenger, reducing overall operational efficiency.
(3) K-means performs clustering based on Euclidean distance, and usually can only discover clusters with spherical distribution. It is difficult to adapt to passenger demand distributed along streets in banded or irregular polygon shapes in urban road networks.
To address the defects of K-means, DBSCAN provides a solution closer to actual geographic characteristics is presented in Figure 4. This algorithm does not need to specify the number of clusters in advance, but finds high-density regions by setting two parameters: neighborhood radius (Eps) and minimum number of points (MinPts).

In customized bus planning, Eps can be set as the maximum walking distance acceptable to passengers (e.g., 500 m), and MinPts can be set as the minimum number of passengers required for establishing a stop (e.g., 6 persons). DBSCAN shows significant advantages in application:
(1) Adaptive determination of the number of stops: the algorithm can automatically generate a reasonable number of clustering clusters according to the spatial density distribution of real orders.
(2) Effective identification and removal of outliers: for isolated orders that have no other passengers within 500 m, DBSCAN will automatically mark them as “noise points”. In practical business logic, the system can directly reject these orders or suggest transferring to taxi/ride-hailing services, thereby protecting the efficiency of the customized bus system.
However, the standard DBSCAN algorithm has a non-negligible application defect in customized bus scenarios—lack of capacity constraint. Due to the connectivity principle of DBSCAN, as long as high-density regions are spatially connected, the algorithm will continuously merge them into a large cluster. For example, in the feeder scenario from “Beijing Chaoyang Station to Sanlitun”, the Sanlitun commercial area may gather demand from 150 passengers in a short time. The standard DBSCAN is very likely to cluster all these 150 passengers into the same cluster (i.e., generating a single alighting stop). However, the maximum passenger capacity (Q) of a conventional bus is usually only 40–50 passengers, and one vehicle cannot meet the transport demand of this cluster. This leads to an awkward situation where “the clustering result is spatially reasonable, but completely invalid in capacity scheduling.”
To more intuitively present the characteristics of the above two algorithms, Table 1 compares the performance of K-means and DBSCAN in the customized bus scenario.
In summary, although DBSCAN has obvious advantages in processing spatial points, it cannot directly satisfy vehicle capacity constraints. Therefore, this paper proposes introducing a capacity constraint mechanism based on the standard DBSCAN algorithm (Capacity-Constrained DBSCAN). As shown in Figure 5, DBSCAN is first used to remove noise and identify high-density demand regions. Then, when extracting the internal features of each cluster, if the total number of passengers (Ni) in a cluster exceeds the maximum vehicle capacity Q, an internal splitting mechanism is triggered to forcibly divide this “overloaded cluster” into N sub-clusters. This improvement retains the advantages of DBSCAN such as strong noise resistance and adaptive clustering, while fitting the capacity matching requirement of customized buses of “one vehicle–one stop/multiple stops”.
| \makecell{ComparisonDimension} | \makecell{K-meansAlgorithm} | \makecell{Density-Based SpatialClustering of Applicationswith Noise Algorithm} | \makecell{Actual Requirementof CustomizedBus Scenario} |
|---|---|---|---|
| \makecell{Determination ofcluster number} | \makecell{Need to manuallypreset K value} | \makecell{Adaptively generatedaccording to data density} | \makecell{No preset required,should be data-driven} |
| \makecell{Outlier processing} | \makecell{Forced assignment,sensitive to outliers} | \makecell{Can automatically identifyand remove noise points} | \makecell{Outliers must be removedto prevent large detours} |
| \makecell{Cluster shaperecognition} | \makecell{Limited to convex/spherical distribution} | \makecell{Can recognize arbitrarilyshaped density-connected regions} | \makecell{Need to adapt to complexroad network distribution} |
| \makecell{Number of passengersin cluster} | \makecell{No control, easy to beextremely unbalanced} | \makecell{No control, connected regionmay expand infinitely} | \makecell{Must satisfy number in cluster$\leq$ vehicle maximum capacity Q} |

To address the spatial heterogeneity of customized bus passenger demand and vehicle physical capacity limitations, this paper proposes a two-stage hybrid clustering algorithm considering capacity constraints.
First, the DBSCAN algorithm is used for macro spatial aggregation of initial demand, adaptively identifying high-density demand clusters and filtering out discrete spatial noise points. Second, a micro-capacity splitting mechanism is introduced: when the total number of passengers in a macro cluster exceeds the maximum rated passenger capacity of a single vehicle, the number of required sub-stops is calculated according to the overload ratio, and the K-means algorithm is triggered within the cluster to reduce the high-dimensional demand set into multiple micro sub-clusters. To compensate for the defect that standard K-means cannot strictly guarantee local partition capacity, this paper designs a capacity balancing mechanism based on a greedy strategy. By identifying overflow sub-clusters, the spatial edge demand points are forcibly separated and iteratively transferred to adjacent sub-clusters with redundant capacity, ensuring that all stops strictly obey the vehicle capacity upper limit. Finally, spatial nearest-neighbor matching is used to map the purely mathematical virtual centroid topology to real road network nodes that allow buses to stop, generating a set of physically feasible stops, and providing precise input for subsequent route planning.
4. Route Planning Mathematical Model Considering Time Window Penalty
After obtaining virtual stopping points that satisfy vehicle capacity constraints through the hybrid clustering algorithm described above, the underlying planning logic of customized buses is essentially transformed into a capacitated vehicle routing problem with soft time windows (CVRPTW). To achieve global optimization of vehicle scheduling and travel routes, this section first abstracts the high-speed railway station and virtual stops into a directed network topology and defines core parameters. Second, the unrealistic assumptions of “constant speed” and “hard time windows” in traditional models are relaxed, and a multi-objective mixed-integer programming model is constructed to minimize the comprehensive operating cost of enterprises, passenger in-vehicle time cost, and asymmetric soft time window penalty cost. Finally, to ensure absolute feasibility of the mathematical solution set in the physical road network, a constraint system including node flow balance, capacity limits, and time continuity (MTZ) constraints for eliminating illegal sub-tours is systematically established, thereby providing a rigorous mathematical foundation for subsequent heuristic algorithm solutions.
Based on the above description of the customized bus route planning problem for high-speed railway stations, to ensure the rigor and scientific nature of the model, the variables involved in the model need to be clearly defined. Given a directed graph G = (V, A), where V = (0, 1, 2, …, n) represents nodes in the graph, node 0 represents the high-speed railway station, and the remaining nodes represent passenger boarding and alighting stops. The variables in the model and their meanings are shown in Table 2.
The planning and operation of demand-responsive customized buses for high-speed railway stations comprehensively considers the demands and benefits of enterprises, passengers, and society. The optimization objective of the model is to minimize the sum of customized bus operating cost, passenger travel time cost, and environmental pollution cost.
(1) Customized bus operating cost
From the enterprise perspective, while customized buses at high-speed railway stations provide convenient and efficient travel services for passengers, their own operating costs must also be considered. The customized bus operating cost considered in this paper consists of two parts: fixed cost and variable cost. Fixed cost refers to maintenance cost, depreciation cost, and staff expenditure; variable cost refers to the fuel consumption cost of customized bus operation.
(2) Passenger travel time cost
From the passenger perspective, customized buses at high-speed railway stations provide transportation services for passengers entering and leaving the station, meeting personalized and diversified travel demand, and travel time is an important factor for passengers. Passenger travel time is closely related to travel cost. The passenger travel time cost considered in this paper refers to the in-vehicle time cost of passengers.
(3) Environmental pollution cost
From the social perspective, the operation of customized buses at high-speed railway stations should reduce the emissions of harmful gases such as carbon dioxide, carbon monoxide, and sulfur dioxide as much as possible, thereby reducing environmental pollution. The environmental pollution cost considered in this paper refers to the pollution emission cost of customized buses.
In summary, the objective function of the customized bus route planning model for high-speed railway stations based on reservation demand response can be expressed as follows:
| Variable | Meaning |
|---|---|
| $P^{+}$ | Set of boarding stops |
| $P^{-}$ | Set of alighting stops |
| $P$ | Set of boarding and alighting stops |
| $D$ | High-speed railway station |
| $V$ | All stops including boarding stops, alighting stops, and high-speed railway station |
| $K$ | Vehicle set |
| $C$ | Total cost (CNY) |
| $C_1$ | Customized bus operating cost (CNY) |
| $C_2$ | Passenger travel time cost (CNY) |
| $C_3$ | Environmental pollution cost (CNY) |
| $Q_k$ | Maximum passenger capacity of vehicle type $k$ (persons) |
| $g_k$ | Fixed cost of vehicle type $k$ (CNY) |
| $h_k$ | Unit fuel consumption cost of vehicle type $k$ (CNY/km) |
| $t$ | Unit time cost of passenger travel (CNY/h) |
| $w_k$ | Unit pollutant emission cost of vehicle type $k$ (CNY/km) |
| $v$ | Operating speed of customized bus (km/h) |
| $d_{i j}$ | Actual travel distance from stop $i$ to $j$ (km) |
| $s_i$ | Service time at stop $i$ |
| $a_i$ | Left time window at stop $i$ |
| $b_i$ | Right time window at stop $i$ |
| $E$ | Left time window of high-speed railway station |
| $L$ | Right time window of high-speed railway station |
| $q_{i j}$ | Number of passengers from stop $i$ to $j$ (persons) |
| $m_i^k$ | Number of boarding passengers after vehicle $k$ arrives at stop $i$ (persons) |
| $n_i^k$ | Number of alighting passengers after vehicle $k$ arrives at stop $i$ (persons) |
| $z_i^k$ | Number of boarding and alighting passengers after vehicle $k$ arrives at stop $i$ (persons) |
| $\omega_i^k$ | Service start time of vehicle $k$ at stop $i$ |
| $M$ | A sufficiently large positive number |
| Decision Variables | Meaning |
| $x_{i j}^k$ | If vehicle $k$ travels through arc $(i, j)$, then $x_{i j}^k=1$, otherwise $x_{i j}^k=0$ |
| $y_i^k$ | If vehicle $k$ stops at stop $i$, then $y_i^k=1$, otherwise $y_i^k=0$ |
(1) Stop service constraint
When planning the stop-line of customized buses, each stopping point has corresponding boarding and alighting passengers. Therefore, vehicles need to traverse all stopping points, that is, each stop must be served by at least one vehicle.
(2) Vehicle accumulation avoidance constraint
After all vehicles arrive at a stop and complete service, they immediately depart for the next stopping point, preventing vehicles from staying too long at a certain stop and causing vehicle accumulation.
(3) Vehicle origin–destination constraint
All vehicles depart from the high-speed railway station, pass through a series of stopping points, complete the preset route, and finally return to the high-speed railway station.
(4) Vehicle capacity constraint
To ensure a good in-vehicle experience for passengers, before operation it must be guaranteed that the real-time number of passengers in the vehicle during the entire operation is less than the maximum passenger capacity of the vehicle.
(5) Stop service passenger constraint
The total number of passengers served by a vehicle at each stopping point is consistent with the number of boarding or alighting passengers at that stop.
(6) Time continuity constraint
During the service process of vehicle $k$, when traveling from stop $i$ to stop $j$, the travel time must be continuous without interruption.
(7) The service start time of vehicle $k$ at stop $i$ must be between the left and right time windows of stop $i$.
(8) The departure time of vehicle $k$ from the high-speed railway station (and the return time to the high-speed railway station) must be between the left and right time windows of the high-speed railway station.
(9) When a vehicle departs from stop $i$ and finally arrives at stop $j$, it indicates that vehicle $k$ has completed the service of stop $i$ and also completed the service of stop $j$.
(10) Decision variable constraints
Whether vehicle $k$ travels through $\operatorname{arc}(i, j)$.
Whether vehicle $k$ stops at stop $i$.
The customized bus route planning problem for high-speed railway stations based on reservation demand response constructed in this paper is a vehicle routing problem, which also belongs to an NP-hard problem. With the continuous expansion of research scale and the increasing data volume, traditional exact algorithms represented by branch and bound, branch and cut, and column generation are prone to difficulties in solving and low accuracy when solving large-scale NP-hard problems. Therefore, when facing relatively complex problems with large data scale, heuristic intelligent algorithms are selected for analysis and solution.
The steps for solving the customized bus route planning model for high-speed railway stations based on reservation demand response using a genetic algorithm are as follows, and the specific process is shown in Figure 6:
Step 1: Set the population size, maximum number of iterations, crossover probability, mutation probability, and other related parameters of the genetic algorithm;
Step 2: Use natural number encoding to encode stop chromosomes, initialize the population, set the maximum number of iterations to $amax$, and set $a=1$;
Step 3: Use the fitness function to evaluate individuals in the population one by one and calculate their fitness values;
Step 4: Determine whether $a \geq a m a x$. If satisfied, output the optimal solution and end the loop; if not satisfied, continue to the next step;
Step 5: Perform selection, crossover, and mutation on chromosomes in sequence;
Step 6: Set $a=a+1$, and return to Step 3.

5. Application Study of Customized Bus Stop-Line Planning for High-Speed Railway Stations Based on Reservation Demand Response
According to the steps designed in Chapter 2, a Python program is written, and the DBSCAN clustering algorithm is used to divide passenger travel demand points into several clusters. The parameters are adjusted by setting neighborhood radius (Eps = 0.45) and neighborhood density threshold (MinPts = 6). The clustering results obtain five clusters for arrival points and five clusters for departure points. Then, based on the idea of the K-means clustering algorithm, the initial number of clustering centers for arrival points and departure points is set to (k = 5), and the locations of clustering centers and the cluster set corresponding to each clustering center are obtained. Finally, five alighting stops and five boarding stops are obtained. The clustering results are shown in the following Figures~\ref{fig7}--\ref{fig9}, where Figure 7 shows the clustering effect of passenger arrival points, and Figure 8 shows the clustering effect of passenger departure points. The results are marked in the GIS map, as shown in Figure 9.



To solve the customized bus route planning model, relevant parameters need to be set, including vehicle parameters and other parameters. When assigning values to these two types of parameters, this paper combines practical conditions and refers to previous related studies to determine unknown parameters. Based on existing literature data, three vehicle types are selected. Vehicle type A has a maximum passenger capacity of 60 persons and is a diesel vehicle; vehicle type B has a maximum passenger capacity of 55 persons and is a natural gas vehicle; vehicle type C has a maximum passenger capacity of 45 persons and is an electric vehicle. The fixed cost of vehicle type A is 200 CNY, the unit fuel consumption cost is 1.62 CNY/km, and the unit pollutant emission cost is 1.52 CNY/km. The fixed cost of vehicle type B is 180 CNY, the unit fuel consumption cost is 0.80 CNY/km, and the unit pollutant emission cost is 0.75 CNY/km. The fixed cost of vehicle type C is 160 CNY, the unit fuel consumption cost is 0.38 CNY/km, and the unit pollutant emission cost is 0.38 CNY/km. The summarized vehicle-related parameter settings are shown in Table 3.
| Vehicle Type | Maximum Capacity ($Q_k$) | Fixed Cost ($g_k$) | Unit Fuel Cost ($h_k$) | Unit Emission Cost ($w_k$) |
|---|---|---|---|---|
| A | 60 persons | 200 CNY | 1.62 CNY/km | 1.52 CNY/km |
| B | 55 persons | 180 CNY | 0.80 CNY/km | 0.75 CNY/km |
| C | 45 persons | 160 CNY | 0.38 CNY/km | 0.38 CNY/km |
The above vehicle parameters and other related parameters are substituted into the constructed customized bus route planning model for high-speed railway stations and the designed genetic algorithm. The population size of the algorithm is set to 100, that is, each generation contains 100 individuals (potential route schemes). The maximum number of iterations is set to 500 generations to ensure sufficient evolutionary search. The crossover probability is set to 0.3, which controls the frequency of exchanging gene segments between parent individuals to generate new offspring. The mutation probability is set to 0.1, which determines the possibility of random mutation in offspring genes, helping maintain population diversity and avoid premature convergence. Through multiple runs and comparison of results, the optimal route planning scheme is obtained. The iteration process of the genetic algorithm is shown in Figure 10. It can be seen that with the increase of iteration number, the fitness value shows a continuous decreasing trend. When the iteration reaches the 64th generation, the value no longer changes.

According to the above model solution, the schematic diagram of the customized bus route planning scheme for high-speed railway stations based on reservation demand response is obtained. The travel paths of each route are represented by different colors, as shown in Figure 11.

(1) Agent creation
In the Main panel, import the GIS map corresponding to this area and the EXCEL table of basic information of high-speed railway station and boarding/alighting stops, and create high-speed railway station agent type, boarding and alighting stops, and vehicle agent group. Through the Initialization function, initialize the longitude and latitude coordinates of each type of stop, and also initialize the specific driving information of vehicle agents, as shown in Figure 12.
(2) Construction of vehicle agent operation logic
Yellow, green, and blue colors are used respectively to represent vehicle types A, B, and C. The parameter \text { bus\_id } is used to distinguish vehicle types, and vehicle task information is stored in the \text { Station\_collection } set. After the vehicle obtains task information, it first goes to the first task stop to pick up and drop off passengers. After completion, it judges whether there is a next task stop. If yes, it continues to pick up and drop off passengers; otherwise, it returns to the high-speed railway station to wait for task reassignment, as shown in Figure 13.
(3) AnyLogic simulation results display and analysis
The running results of the AnyLogic simulation model are shown in Figure 14.
According to Table 4, after model solution, a total of 5 routes are obtained, including all 3 vehicle types, serving a total of 200 passengers, with an average of 40 passengers served per route. The average load factor of vehicles reaches 76.92\%, among which route 1 has a load factor of 82.22\%, and route 2 has a load factor as high as 97.78\%, which better utilizes the passenger carrying capacity of customized buses. The average operating mileage of routes is 16.25 km, the maximum operating mileage is 18.70 km, and the minimum operating mileage is 14.30 km. The operating mileage is reasonable and can meet passengers’ requirements for travel distance. The average travel time of routes is 0.325 hours, the longest travel time is 0.374 hours, and the shortest travel time is 0.286 hours, with short travel time, which can meet passengers’ requirements for travel time. From the analysis of results, the opening of customized buses can meet passengers’ travel demand in time and space. The obtained route planning scheme has good performance, can satisfy all constraints of route opening, and also verifies the feasibility and effectiveness of the model and algorithm.



Through the above use of genetic algorithm to solve the model and AnyLogic software to model and simulate vehicle driving paths, the final high-speed railway station customized bus vehicle dispatching and operation planning scheme is obtained, including each route’s driving path, required vehicle type, driving time, operating mileage, number of passengers, and load factor, as shown in Table 4.
| Route | \makecell{TravelPath} | \makecell{VehicleType} | \makecell{Travel Time(hours)} | \makecell{Mileage(km)} | \makecell{Passengers(Persons)} | Load Factor |
|---|---|---|---|---|---|---|
| 1 | 0-5-7-0 | C | 0.374 | 18.70 | 37 | 82.22\% |
| 2 | 0-8-4-0 | C | 0.348 | 17.40 | 44 | 97.78\% |
| 3 | 0-10-6-0 | A | 0.286 | 14.30 | 38 | 63.33\% |
| 4 | 0-3-9-0 | B | 0.328 | 16.40 | 39 | 70.91\% |
| 5 | 0-2-1-0 | B | 0.289 | 14.45 | 42 | 76.36\% |
6. Conclusion and Prospect
This paper aims at the “last mile” personalized feeder demand of high-speed railway station passengers, and proposes a customized bus stop-line planning method based on reservation demand response. The study first constructs a stop location model based on a hybrid clustering algorithm of DBSCAN and K-means, accurately extracting the spatial aggregation characteristics of passenger flow in high-density travel areas, and on the basis of considering actual road network structure and stopping convenience, scientifically determines the physical locations of customized bus stops. Secondly, with the objective of minimizing enterprise operating cost and passenger time cost, heterogeneous vehicle types are introduced and an improved genetic algorithm is designed for route solving, realizing efficient vehicle scheduling and path optimization under the “large stop express” mode. Finally, taking Beijing Chaoyang Station to “Sanlitun–Workers’ Stadium business district” as a case, the static scheduling scheme is dynamically verified by using the AnyLogic multi-agent simulation platform. The research results show that the proposed planning model can not only effectively match passengers’ spatio-temporal travel demand, significantly improve the passenger flow evacuation efficiency of high-speed railway hubs, but also effectively control the overall operating cost of the bus system, providing scientific theoretical support and decision reference for bus enterprises to accurately operate customized feeder services.
Although this paper has carried out systematic exploration on customized bus stop-line planning for high-speed railway stations based on reservation demand response and verified the effectiveness of the model, there are still certain limitations due to research assumptions. Future work can be further improved from the following three dimensions. First, in terms of stop service mode, this paper adopts an idealized treatment and strictly divides stops into single boarding or alighting nodes. Future research can relax this assumption and introduce a mixed service mode allowing passengers to board and alight at the same stop, so as to more realistically describe complex passenger flow interaction behavior and explore system carrying potential. Second, in terms of demand response mechanism, this study mainly focuses on advance planning based on static Origin-Destination data. With the development of intelligent transportation technology, future research can explore a hybrid response mechanism combining “static global planning and dynamic local adjustment”, so as to adapt to real-time dynamic travel scenarios where passengers submit or modify itineraries. Finally, in terms of time window optimization, the existing model does not explicitly incorporate penalty costs caused by time deviation (such as waiting due to early arrival or penalty due to late arrival) into the objective function. Future work can introduce a time window penalty function and construct a more comprehensive total cost model, so as to seek a better balance between enterprise operating benefits and passenger time value, and further improve the service reliability of customized buses.
Conceptualization, L.L. and L.T.; methodology, L.T.; software, L.T.; validation, L.L., L.T., and H.B.; formal analysis, L.T.; investigation, L.T.; resources, L.T.; data curation, H.B.; writing—original draft preparation, L.T.; writing—review and editing, L.T.; visualization, L.T.; supervision, L.T.; project administration, L.T.; funding acquisition, L.L. All authors have read and agreed to the published version of the manuscript.
The data used to support the findings of this study are available from the corresponding author upon reasonable request.
The authors declare no conflicts of interest.
