# Double-Track One-Direction Operation Mode for Overnight Trains on High-Speed Railway
## 3 Model Formulation
### Algorithm  
There are many variables and constraints in the mode and optimization model established in this paper, and the solution is complicated. In order to simplify the calculation and facilitate the algorithm, the start and stop additional time and pass-through time are used constantly. Two other variables are defined. The sum of the train stop time in all stations of the down direction is \(Dp=\sum_{n=1}^{N-1}d_{n}^{p}\), and the sum of the train stop time in all stations of the up direction is \(Dq=\sum_{n=1}^{N-1}d_{n}^{q}\). It is assumed that a section of high-speed railway implements the operation mode of the double-track one-direction. There are N subsections, and each subsection has three variables including \(d_{i}^{p}\), \(d_{i}^{q}\), and X to further control the computational complexity. Combined with the actual situation of the line and station scale, the value ranges of variables are given respectively: \(d_{i}^{p}\in[0,p]\), \(d_{i}^{q}\in[0,q]\), \(X\in[x_{1},x_{2}]\). There are \((x_{2}-x_{1}+1)[(p+1)(q+1)]^{N}\) alternative schemes in total, and it is relatively difficult to solve directly. In order to reduce the amount of computation, a three-stage heuristic algorithm [18] was designed to solve the model based on the correlation and hierarchy of multiple objective functions, and it was realized through programming. An improved tabu search algorithm [19] was used to find the best total stop time in the first stage as Algorithm 1 shows. In order to avoid falling into local optimum, the method of random generation was used to regenerate the solution. The scale of the problem was manageable, the taboo table did not clear after recording, no cycle was generated, and the convergence speed was improved. In the calculation of the first two stages, \(X=x_{1}\) if it had no limit to \(X\). The simulated annealing algorithm is widely used in the optimization of high-speed railway operation schemes [20; 21]. The simulated annealing algorithm [22] was used in the second stage of the algorithm to determine the specific stop time at each station as shown in Algorithm 2. Two matrices, \(dp=[d_{1}^{p},d_{2}^{p},\ldots,d_{N-1}^{p}]\) and \(dq=[d_{1}^{q},d_{2}^{q},\ldots,d_{N-1}^{q}]\), were built to represent the stopping scheme in both directions from the first station to station \(N\). Within a given value range, random numbers \(dp0\) and \(dq0\) with 1 row and \(N\) columns that satisfied Equations (1) and (2), and \(\sum_{n=1}^{N-1}d_{n}^{p}=Dp\), \(\sum_{n=1}^{N-1}d_{n}^{p}=Dq\) were randomly generated as the initial solution, which shows the stopping time of the train from stations 1 to \(N\). The new solution was generated in the same way as the original solution. The cooling method adopted an equal ratio of uniform speed cooling \(T_{k+1}=\alpha T_{k}\). ```
Input: Record form \(U\); Taboo form \(F\); The maximum number of iterations \(max\_i\); Output:\(Dp\), \(Dq\); for\(i\) in [0, \(max\_i\)] and all \(D_{An}\) in \(U\) are different do \(Flag=1\); forFlag = 1 or \(Dp_{n}\), \(Dq_{n}\) in \(F\)do  Randomly generate initial solutions \(Dp_{0}\), \(Dq_{0}\) with Equations (10) and (11); \(Flag=0\) endfor  Calculate \(f_{1}(Dp_{n},Dq_{n})\); if\(i=0\)then  Store \(f_{1}(Dp_{n},Dq_{n})\), \(Dp_{n}\) and \(Dq_{n}\) in the form \(U\);  Store \(Dp_{n}\) and \(Dq_{n}\) in the form \(F\); endif if\(f_{1}(Dp_{n},Dq_{n})<f_{1}(Dp_{0},Dq_{0})\)then  Store \(D_{An}\), \(Dp_{n}\) and \(Dq_{n}\) in the form \(U\); endif if\(D_{An}>D_{A}\)then  Store \(Dp_{n}\) and \(Dq_{n}\) in the form \(F\); endif endfor
```  
**Algorithm 1** Improved tabu search algorithm to calculate total duration  
Parameters of the simulated annealing algorithm are as follows: initial temperature \(t_{0}=1000\), temperature decay function parameter \(\alpha=0.95\), length of Markov chain \(L=100\), final temperature \(t_{end}=0.001\).