## 5 Timetable Calculation and Adjustment
### The Matching Method
#### 5.2.2. Matching and Adjusting Method  
When matching the stop plan with the primary train-set circulation plan, something needs to be considered. First, the number of schemes in the primary train-set circulation plan may be different from the number of schemes in the stop plan. Second, although we have reserved the stop time when calculating the primary train-set circulation plan, it is still possible for the train to exceed the prescribed operation hours when it ends operation. In order to ensure that the timetable meets the actual requirements, we design a matching and adjusting method for the above situations, as shown in Figure 12.  
As shown in Figure 12, the matching and adjusting method of the stop plan and the primary train-set circulation plan are divided into three parts. 1. Firstly, we compare the number of schemes in the stop plan with the number of schemes in the primary train-set circulation plan and take these data as input data. In the matching process, we adjust the scheme according to the comparison results. If the number of schemes in the stop plan is more than the number of schemes in the primary train-set circulation plan, the number of schemes in the stop plan will be reduced. We follow the principle of meeting the travel demands of passengers to the greatest extent and give priority to canceling the scheme with fewer stops. If the number of schemes in the stop plan is less than the number of schemes in the primary train-set circulation plan, it indicates that the carrying capacity of the primary train-set circulation plan is greater than the travel demands of passengers. In this case, we generate the stop scheme for these schemes in the primary train-set circulation plan. These extra schemes in the stop plan only serve boundary stations, because these stations serve more passengers. If the number of trains in the stop plan is the  
Figure 11: The schematic diagram of the interconnection relationship. Figure 12: The matching and adjusting method. same as the number of schemes in the primary train-set circulation plan, then go to the next step directly. 2. The timetable can be calculated after the number of schemes in the stop plan is equal to the number of schemes in the primary train-set circulation plan. When calculating the timetable, the matching relationship between the stop plan and the schemes of the primary train-set circulation plan should be determined first. There are differences in the travel demands of passengers at different periods within a day. To meet the travel demands of passengers more accurately, we divide a day into serval periods, and decompose the passenger travel demands in the time dimension, based on the result of space decomposition result. It is a reference to evaluate the matching result because it can show whether the timetable meets the passenger travel demands, which is very important in HSR operation. We have obtained the space decomposition result in Section 4.3, and the \(S_{k}\) can be divided as:  
\[S_{k}^{(x)}=\frac{Q_{k}^{(x)}}{Q_{k}}\times S_{k} \tag{24}\]  
where \(S_{k}^{(x)}\) means the number of stops of station \(k\) in \(x-th\) period of a day, \(Q_{k}^{(x)}\) means the number of passengers served by station \(k\) in \(x-th\) period. After that, we calculate the matching relationship by GA. GA is widely used in the research in TRP and TTP, like literature [14; 16; 39], and the results show that the GA has good performance. We take the matching relationship of the primary train-set circulation plan and stop plan as a gene fragment. The GA steps are as follows:  
**Step 1. ** Initial feasible solutions for the matching relationship, and decompose the passenger travel demands. **Step 2. ** Calculate the timetable for each solution by CPLEX according to the safety operation constraints in real life. **Step 3. ** Crossover operation. We take a matching relationship as a gene. A multi-point crossover method is used in the algorithm. We cross over the matching relationship based on the periods of time, and the probability of cross over is 0.9. **Step 4.