Research on Computer-aided Adjustment and Optimization of Train Service Plan based on Passenger Flow Assignment

According to the complex characteristics of the mutual influence of passenger flows between different train adjustment schemes, a computer-aided train service plan adjustment optimization model based on passenger flow assignment is proposed with the goal of minimizing the remaining passenger turnover. The actual operating effects of trains and the impact between different adjustment measures and between trains are also considered. A computer iterative optimization algorithm with 2 stages based on the greedy principle is designed. The computer processing is divided into two stages: train adjustment plan selection and passenger flow information analysis. The selection of adjustment schemes is feedback-corrected based on the results of passenger flow assignment. Finally, taking the train operation plan of the Beijing-Shanghai high-speed railway as the research object, an example is demonstrated, and the results show that the model and algorithm can effectively obtain the optimal train adjustment scheme under the current conditions.


Introduction
Due to various impact factors including passenger flow characteristics, technical conditions, capacity utilization efficiency and capacity resource input, the optimization and adjustment of train service plan (TSP) is very complicated.In addition, compare to other high-speed railway (HSR) system, Chinese HSR has the larger scale of road network and more complex passenger flow structure, which increases the complexity of the optimization and adjustment of TSP.The purpose of this work is to maximize the efficiency of train operation under limited resource allocation, so as to improve the overall service quality and improve the efficiency of railway enterprises.It is based on the detailed analysis of the influence of different adjustment schemes on passenger flow and the mutual influence results of train adjustment.The conventional approach of TSP optimization in the current research is to solve a new TSP based on the existing passenger flow data, and then compare it with the current TSP and propose adjustment measures.Cacchiani [1] et al. studied the relationship between TSP and potential passenger demand under the premise of given existing passenger flow and focused on different demand scenarios by using robust technology.Canca [2] et al. aimed at maximizing the total profit of train operation, considering the diversion and comparison of different routes between each OD pair under the constraints of train service, capacity and passenger flow demand.In order to improve the matching degree between train capacity and passenger demand, Xu [3] et al. proposed an optimization method for high-speed railway station planning according to passenger demand in different time periods.Under the constraint of given passenger service level, Shi Feng [4] et al. coupled travel demand with train departure time and optimized the TSP considering the changing characteristics of passenger flow over time.Starting from the change of passenger flow demand in different time periods, Su Huanyin [5] comprehensively considers the influence of trains and passengers themselves, constructs an optimization model of operation plan with the goal of minimizing time cost, and optimizes the operation plan from the dimension of time.Starting from the potential line pool of TSP, Fu Huiling [6] discussed the mixed integer model and algorithm of TSP optimization.In the actual railway operation, the adjustment of TSP mostly needs to consider the actual operation effect of the train, take into account the mutual influence of different train adjustment schemes on passenger flow, and realize the redistribution of passenger flow and capacity so as to reduce the cost of train adjustment effectively.Based on the adjustment of the TSP, Jiang Jieying [7] studied the relationship between the adjustment measures and the optimization of the high-speed rail network capacity and verified the effectiveness of the model and algorithm.In the process of optimizing the TSP, Huang Jian [8] considered the dynamic changes of passenger flow and designed a comprehensive optimization model and algorithm based on the dynamic adjustment of passenger flow.The above research provides a good reference for train adjustment.However, there is limited research on the impact of various train adjustment plans on passenger flow through refined analysis.The interaction between train adjustment schemes is very complicated.Whether the affected passenger flow can be taken away after adjustment rely on the choice of other train adjustment measures, and the passenger flow will also influence each other.Therefore, this paper proposes an adjustment method considering the interaction of different train adjustment plans and passenger choice.It proposes a generation method of train adjustment potential line pool firstly based on the adjustment principles of the TSP.On this basis, the effect of different adjustment scheme combinations on the actual passenger flow of the TSP is further analyzed.The adjustment and optimization model of the TSP based on passenger flow assignment is constructed, and a two-stage iterative optimization algorithm based on greedy strategy is designed.Finally, the Beijing-Shanghai high-speed railway operation plan is taken as the object for case study.

Generation of Train Service Plan Adjustment Alternative Set
The potential line pool of TSP adjustment refers to the collection of all possible alternative adjustment plans for the train.According to the relevant indicators such as trains, stations and potential passenger flow, this paper makes qualitative and quantitative analysis and constraint judgment on all possible adjustment measures of trains, generates all possible adjustment schemes of different trains in advance, and takes them as input of the model.In addition, considering that the impact of passenger flow changes caused by route adjustment, train operation period adjustment and origin-destination adjustment in the actual adjustment process is more complex, this paper will focus on the method of train stop adjustment, add or reduce trains and formulation adjustment of trains.For the adjustment of train stop plan, it is necessary to determine the range of stop times according to the passenger flow and service distribution of the stations, and then determine the specific addition and subtraction stations of the train according to their actual operation effect, and finally generate the stop adjustment plan.Train adding/reducing adjustment needs to consider the influence of train efficiency, EMU routing efficiency, potential passenger flow, network capacity and other factors.When the train and EMU routing efficiency are poor and the train is at any ends of the routing, and the number of alternative trains is not 0, it can be considered to be cancelled.When the potential passenger flow of the station is high and the capacity is sufficient, it can be considered to add trains.As to formulation adjustment, when the train benefit is poor and the train is in the middle of EMU route, the long train formation can be considered to be changed into the short train formation.On the contrary, the short train formation can be considered to be changed into the long train formation.According to the above basic principles, the generation method of TSP adjustment potential line pool is as follows: Step1 Determine the principle of train adjustment and analyse the influencing factors of each adjustment measure.
Step2 Construct an index system for the selection of adjustment measures for TSP and determine the influence relationship between adjustment measures and related indicators.
Step3 Calculate the value of each index and combine the relevant qualitative indicators (the dotted line part in Figure 1).If the numerical combination of each index meets the constraints of the adjustment measures, an alternative adjustment scheme of the corresponding train is obtained.
Step4 Traverse all the adjustment trains, and finally obtain the TSP adjustment potential line pool.A system was developed to help user to analyse the impact of adjustment on passengers and determine the possible TSP adjustment scheme to construct potential line pool, shown as Figure 1.

Optimization Analysis of Train Service Plan Adjustment
The optimization and adjustment of TSP is a complex and comprehensive problem considering many influencing factors.The interaction process between different adjustment measures and between trains is very complex, which will directly affect the effect of the whole adjustment scheme on passenger flow.As shown in Figure 2, it is assumed that the three trains A, B and C correspond to three adjustment modes Ai, Bj and Cn, respectively.Among them, train A corresponds to station reduction measures, train B corresponds to station addition measures, and train C corresponds to cancelling measures.

Figure 2. Affected OD passenger flow.
When train A takes stop measures, the affected OD passengers in the diagram is OD1, OD2 and OD3.If train B and C do not take adjustment measures, OD1 passengers can be taken away by train B and C, OD2 and OD3 passengers can be taken away by train C.However, if train C takes a cancelling measure, train C will not be able to take away the OD2 and OD3 passengers in train A, and it will also generate multiple affected OD passenger.At this time, only OD1 of train A can be taken away by train B. Once Train B also adopts the adjustment measures of adding stations, the OD2 passengers that could not be taken away by Train B can now be taken away by Train B. Finally, the original OD3 passengers of Train A may be lost because it cannot be taken away by any other trains, as shown in Figure 3. Furthermore, in addition to the mutual influence between different adjustment schemes, the affected ODs will also interact with each other due to the limitation of related capacity.For example, OD1 and OD2 in train A pass through the same section.When the available capacity of the interval is limited, they will conflict each other.At this time, it is necessary to comprehensively consider the assignment of capacity in the section.To sum up, the interaction between train adjustment schemes is very complex.Whether the affected passenger flow can be taken away after adjustment is constrained by the choice of other train adjustment measures, and the passenger flow will also affect each other.Therefore, when selecting the optimal adjustment scheme, it is necessary to analyze the passenger flow effect of different train adjustment schemes, the interaction between adjustment schemes and the interaction between related ODs more carefully, so as to minimize the impact on the existing passenger flow and improve the operation efficiency of the train.But the main difficulties of this problem are as follows: 1) The selection of train adjustment scheme and passenger flow assignment influence each other.The remaining capacity of the train and the affected passenger flow are the necessary input conditions for accurate analysis of the final affected passenger flow, but they have to be determined after the selection of the train adjustment scheme is realized.At the same time, the influence of the final passenger flow is the main basis for the selection of the train adjustment scheme.They influence each other, which makes it very difficult to construct model and solve it.
2) The model input is complex.The train adjustment scheme is the basic input of the model.However, because there are many types of adjustment measures that can be adopted and the factors involved in each measure are more complicated, it is difficult to describe them one by the model.According to the above problems, this paper first uses a preprocessing method in the process of model construction for the complex input of the model.In fact, the adjustment measures can be finally attributed to the increase and decrease of stops and the change of the number of trains except the adjustment of formulation and operation period.For example, extending the origin-destination point is actually to add several stations before the original departure station; cancelling the train can be regarded as all the stops of the train are cancelled, and the total number of trains changes.Therefore, combining the above characteristics, each possible train adjustment measure can be transformed into the following elements:  Increase or decrease stations affected by the current measures.
 Changes in the number of trains affected by the current measures.
 The change of carrying capacity after the increase and decrease of the train station.
 OD and passengers affected by the current measures.On the passenger flow assignment problem, its main algorithm references the literature [9], and improved for this problem: Based on the above elements, each measure in the potential line pool of train adjustment schemes is transformed as the basic input of the model.Based on the previous preprocessing results, all possible selections of train service are searched for each passenger flow OD that may be affected.In this process, it is necessary to consider the original train selection characteristics of OD, such as only searching the trains within a certain range near the original OD arrival time.Secondly, the influence of the selection of each train adjustment scheme on the actual available service route and the available capacity of each route is considered.Finally, considering the decision-making of train adjustment scheme selection, a passenger flow assignment model with the goal of minimizing the remaining passenger flow turnover is constructed, and the solution algorithm refers to the literature [9].

Model Assumptions
 At most 1 potential adjustment scheme for each train can be selected  Considering the difficulty and uncertainty in accurately predicting passenger flows for individual trains, a simplified approach is adopted to estimate the corresponding passenger growth changes.It takes into account the potential growth in overall train passenger flows and daily operational experience to estimate the proportion of passenger growth. This paper mainly studies the effect of adjustment measures from the perspective of passengers affected, so the optimization goal is to minimize the affected passenger turnover.

Variable Definition and Parameter Description 1) Symbols and explanations
The train service node set is set as N , where . The set of train h in the TSP is H , the train set j H in which the train in the j th direction is represented.h W is all passenger OD set of the train h .The set of potential adjustment scheme k for train h is h K ; the reasonable route set of passenger flow OD w is w R ; the interval m set of the train h is ,the number of intervals of the train h is h  .
2) Decision variables and explanation Let k h x be the decision 0-1 variable that means whether the k alternative adjustment scheme of train h is selected.When The definition and description of the remaining parameters are described in the model and constraint conditions.

Objective Function
In general, the optimization objectives of train adjustment based on passenger flow assignment mainly include system optimization and user optimization.The system optimization is to improve the utilization of railway capacity under limited resources, and the user optimization is to ensure the consistency of passenger flow assignment and passenger demand from the perspective of passenger travel, so as to improve the quality of railway service.This paper mainly aims at the optimization of the system, redistributes the existing passenger flow and capacity, and excavates the potential of the station passenger flow while increasing the passenger flow volume, so as to ensure the maximum efficiency of the train operation.The purpose of the adjustment of the high-speed TSP is mainly to take effective targeted measures for the poor trains in the existing TSP as far as possible in the case of a small impact on the existing passenger flow, so as to improve the overall operation efficiency of the train.Therefore, in order to reflect the actual effect differences brought by different train adjustment measures, this paper takes the remaining passenger flow that cannot be taken away after passenger flow assignment as the measurement standard and takes the minimum remaining passenger flow turnover as the goal.The objective function is expressed as follows: , , min ( ) Where , h k w q $ indicates that after the current train h selects the k alternative adjustment scheme, and then comprehensively considers the selection of other train adjustment schemes, the final remaining passenger flow that cannot be taken away needs to be determined according to the selection of all train alternative adjustment schemes, which can be expressed as follows : In formula (1), h w d denotes the distance between the w passenger flow OD of train h .In formula (2), , h k w q represents the passenger flow to be allocated for the w passenger flow OD under the k alternative adjustment scheme of train h ; , , h k w r z represents whether the r path of the w passenger flow OD under the k alternative adjustment scheme of train h exists, and the 0-1 correlation matrix constant is determined by the value of k h x of the relevant train.

Objective Function
1) Constraints on the variation range of train stops at stations.min , max ( ) Where , k n h g denotes the change in the number of stops at station n when the k alternative adjustment scheme of train h is selected.min n and max n represent the lower limit and upper limit of the number of trains stops at different stations respectively, and their values are closely related to the change of passenger flow and train service.
2) Constraints on the number of trains in different directions.min , max ( ) Where , k j h e represents the number of trains in direction j when the k alternative adjustment scheme of train h is selected.min j h and max j h represent the lower and upper limits of the number of trains in different directions, respectively.3) Constraints on the number of trains in different directions.m in , m ax ( ) The formula (5) indicates that each train can only choose one of several different adjustment schemes.
, , , In the process of passenger flow assignment, the sum of OD passenger flow assigned to each interval cannot exceed the upper limit of the available capacity of the interval.In equation ( 6), , , h m w r y denotes whether the r path of the w passenger flow OD passes through the m interval of the train h , 0-1 incidence matrix constant ; , h k m cap represents the available capacity of the m section under the k alternative adjustment scheme of train h .5) Constraints of OD passenger flow on allocation upper limit.min , max ( ) Formula (7) indicates that in the process of passenger flow distribution, the sum of the allocated OD passenger flow cannot exceed the OD passenger flow to be allocated.
6) Non-negative constraint of passenger flow assignment.
, , 0, , The formula (8) indicates that the assigned passenger flow on the path r for each passenger flow OD w must be greater than or equal to 0. 7) Decision 0-1 variable constraints.

Idea of Solution
This model contains two types of decisions: 1) which adjustment scheme should be selected; 2) Select which trains take away the remaining passenger flow after the adjustment.Therefore, this model is essentially composed of two problems, one is the combination optimization problem of train adjustment scheme selection, and the other is the passenger flow assignment problem under the established selection scheme.Due to the interaction between the two problems, whether the affected passenger flow can be taken away is constrained by the choice of other train adjustment schemes.In turn, the situation of passenger flow is used to evaluate the advantages and disadvantages of the choice of train adjustment schemes.The two problems are difficult to solve collaboratively, and the model is more complex.Therefore, in order to reduce the complexity of the model solution and improve the efficiency of the model solution, this paper divides the model into two stages: 1) In the first stage, based on the principle of greed, it is assumed that whether the affected passenger flow in the model can be taken away by other trains is not affected by the selection of other train adjustment schemes.The objective is to minimize the influence of the existing passenger flow weighting (the initial stage weight is 1) in all the existing adjustment measures, and to optimize the combination of train adjustment schemes.
2) In the second stage, according to the preliminary results of the first stage, the remaining capacity of the train and the affected passenger flow are used as data input to the passenger flow assignment model.With the goal of minimizing the turnover of the remaining passenger flow that cannot be taken away, the influence of the selection results of the first stage on the passenger flow is comprehensively evaluated, and the weight of different OD passenger flow is adjusted according to the results of passenger flow assignment, which is used as the basis for the next iteration selection of the first stage.The first stage is to solve the choice of train adjustment scheme.This stage is mainly based on the potential set of train adjustment schemes.The greedy algorithm is used to traverse and search all possible combinations of adjustment measures for trains.The mutual influence between the adjustment schemes is ignored and the current optimal combination of train adjustment schemes that meet the constraints is selected as the data input of the second stage.At this time, the first-stage optimization model can be expressed as: a) Objective function , 1 ,

min ( )
Among them, the goal of the first stage is to minimize the impact on the existing passenger flow, that is, the optimal train adjustment scheme combination in the first stage without considering the interaction between the passenger flow of the adjustment scheme.b) Constraint condition min , max ( ) The second stage is to redistribute the passenger flow after the train adjustment plan is adopted, which is used to evaluate and verify whether the selection of the train adjustment plan is reasonable.When the train adjustment scheme of the first stage is determined, the change of corresponding OD passenger flow, interval available capacity and stop number become known, and then can be input into the second stage, the model is transformed into a linear model, which can be solved directly by C# calling Cplex.At this time, the second stage model can be expressed as: a) Objective function 2 min ) In formula (15), h w q $ represents the remaining passenger flow that cannot be taken away under the selection of the adjustment scheme combination in the first stage.In formula (16), h w q and , h w r f are the passenger flow to be allocated under the adjustment scheme and the passenger flow assigned to the rpath respectively.b) Constraint condition , , , ( ) , , 0, , In(17), h m cap denotes the capacity of the m section of train h when the alternative adjustment scheme is determined.In summary, the two-stage solution can transform the above nonlinear problem into a linear problem.The first stage is the premise of the second stage, which provides data input for the second stage.The second stage is the quantitative result of the first stage, which is used to measure the rationality and optimality of the train adjustment scheme.In the process of multiple iterations, the two continue to feedback and find the best, and generate the final train adjustment plan.

Solution Steps based on Greedy Strategy.
Greedy algorithm is an intelligent optimization method close to human selection thinking.Its core is mainly the selection of greedy strategies.In each process, the optimal results are selected and entered into the next stage, without spending a lot of time on the global optimal search.This problem adopts the verification algorithm based on greedy algorithm.The problem is divided into two stages.After repeated iterations, the optimal train adjustment scheme is finally obtained.The algorithm based on greedy strategy is designed as follows: Step1 Data initialization processing.Different adjustment schemes are transformed into the change of section capacity, train quantity and stop quantity and affected passengers.The potential trains service routes that can take the affected passengers are pre-searched.The decision variables and scheme selection weights are also initialized.

Step2
The first stage of model optimization.In the first stage, based on the greedy strategy, with the goal of minimizing the impact of train adjustment on the existing passenger flow, the passenger flow OD weight (the OD weight of the train, the initial value is 1) is introduced as the selection basis to construct the current optimization model.The optimal solution of the model in this stage is obtained as the data input in the next stage.The first stage goal is changed to: , , ( ) Step3 Intermediate data preprocessing.The optimal adjustment scheme combination obtained in the first stage is further transformed into the affected passenger flow under the current selection and the remain capacity of each train and each section.According to the current selection, the train service route that is still valid is used as the data input of the second stage.
Step4 The second stage model optimization solution.Based on the result of the 1st stage, the optimization model is constructed with the goal of system optimization, and then the remaining untaken passenger flow is obtained.The current optimal result is recorded.If the optimal termination condition has been reached (such as the number of iterations reaching the upper limit), exit, otherwise turn to Step5.
Step5 Update the passenger flow selection weight.In the first passenger flow assignment result, the remaining untaken passenger flow turnover is sorted by their quantity.Set the adjustment weight base as the weight adjustment base: In Equation (21), i w q $ is the passenger flow w not taken away in the result i of passenger flow assignment, which is the sum of all OD passenger flows with the same origin and destination that have not been taken away.w d is the shortest distance w of the passenger flow OD.In Equation ( 22), w q represents the affected passenger flow with the same origin-destination OD corresponding to the OD of passenger flow w that has not been taken away in the current iteration.
After the above adjustment, jump to Step2.At this time, the larger the residual passenger flow turnover is, the higher the passenger flow weight is.The next time the scheme is selected, the adjustment scheme that affects the passenger flow including the OD is less likely to be selected.

Data Preparation and Processing
The paper takes the TSP of Beijing-Shanghai high-speed railway in a certain period as an example.
According to the classification rules of stations in reference literature [10], the stations along the Beijing-Shanghai high-speed railway are divided into 6 large stations, 10 medium stations and 7 small stations, which provides reference for the change of the number of trains stops and the selection of the range of addition and subtraction stations.In the process of determining the effect of different adjustment measures, the passenger OD changes caused by the reduction of stations and the stopping of trains can be directly obtained from the real train OD passenger flow information.
For the changes in OD passenger flows resulting from the adding stations or adding trains, it is necessary to be predicted based on daily work experience, the characteristics of passenger flow changes at the stations and the passenger flow structure of the trains.This can be done simplified by considering the percentage of the corresponding capacity.The expected growth of passenger flow between various stations and trains is different.The relevant parameters of the TSP adjustment optimization model are set as follows: the maximum number of iterations of the model is 100, the maximum number of ODs that can be adjusted their weight is 30, the adjustment of weight is limited to [1.01, 2.00].
The constraints of the number of stops at different stations can be determined according to the service frequency of the station, the average number of people served, the growth rate of passenger flow at the station, and the absolute growth of passenger flow.The deviation range of the mean level of all stations and different levels of stations is calculated.Considering that the station service frequency and the average number of service people have a great influence on the change of the number of stations stops, these two indicators can be given a greater weight.The greater the absolute value of the comprehensive deviation, the greater the range of the upper and lower limits of the add and subtract stations.The range of train stops at different stations is shown in Table 1.Optimization results and analysis Based on method above, the potential adjustment scheme set containing 43 trains can be obtained as the data input of the model.The C # programming algorithm is used to iteratively solve the model, and the current local optimal solution is recorded according to the greedy strategy in each iteration.The minimum objective value and the corresponding result is recorded and updated in the process.Finally, the optimal combination of train adjustment schemes under specific ranges and constraints is obtained.
The model iteration process is shown in Figure 4, and the remaining untaken passenger flow turnover is shown in Table 2.It can be seen from Figure 4 that in the first 20 iterations, the decline rate of the model is faster.As the number of iterations of the model increases, the trend of the model gradually decreases and tends to a relatively stable level.At this time, the optimal target value of the current record is 84 539 km, and the minimum value of the remaining passenger flow turnover remains unchanged in the subsequent iteration process.When the remaining passenger flow turnover of the model is the smallest, the adjustment measures taken by the high-speed TSP have the least impact on the existing passenger flow, and the operation efficiency of the train is the largest.The final high-speed train adjustment plan is shown in Table 2.By comparing the number of stop intervals greater than 30 minutes before and after optimization, it can be found that there are more stop intervals greater than 30 minutes in the train stop plan before adjustment.When the station passenger flow is large or the station passenger flow potential is good, the longer the stop interval is, the more passenger flow the station loses.In the adjusted TSP, the number of stop intervals greater than 30 minutes is reduced, and the stop interval of the station is more balanced.The overall operation efficiency of the train has been further improved compared with before.The comparison of stop balance before and after adjustment is shown in Table 3.In summary, the model can effectively solve the problem of combination selection of different adjustment measures and select the optimal train adjustment plan under current conditions from the adjustment plan alternative set.In the optimization of TSP, the interaction between different adjustment measures and between trains is comprehensively considered.The adjusted TSP can effectively improve the balance of train stops and the overall efficiency of train operation and maximize the benefits of railway operation.

Conclusion
This article analyses the impact of train adjustments on passenger flows and proposes an optimization model for adjusting TSP based on passenger flow assignment.It also introduces a two-stage iterative algorithm based on a greedy strategy, which ensures quick optimization results while minimizing the impact on existing passenger flows.This model allows for a fine-grained analysis of the passenger flow effects of different train adjustment plans, effectively improving the operational efficiency of railway enterprises, optimizing railway resource allocation, and enhancing the balance of train station stops to meet practical needs.It demonstrates good applicability in real train operation.Considering that the stability of the algorithm will decrease when the number of iterations is high, further improvements can be made in the future to enhance the stability of the train adjustment model based on this algorithm.

Figure 3 .
Figure 3. Impact of passenger flow among different adjustment plans.
 , the train h adopts the k adjustment scheme ; when 0 k h x  , it means that the train h does not adopt the k adjustment scheme.Let , , h k w r f be the decision integer variable, and the passenger flow assigned by the r path of the w passenger flow OD under the k alternative adjustment scheme of train h .

Figure 4 .
Figure 4. Iterative solution results of the model.

Table 1 .
Change range of stop times at different stations.

Table 2 .
Change range of stop times at different stations.It can be seen from TABLE II that the final train adjustment plan selects 21 trains, including cancelling 2 trains, adding 2 trains, reducing stations in 4 trains, adding stations in 7 trains and both adding and reducing stations in 6 trains.

Table 3 .
Comparison of station stop equilibrium before and after adjustment.