## 3 Model and Methods  
### The Mathematical Model  
We developed a MILP (Mixed Integer Linear Programming) model, which is adapted from [1]; most of the model components are explained in much greater detail there for the interested reader. In this section, we explain the essential features of the mathematical model. The model has some resemblance to job-shop scheduling, and it contains the standard constraints required for scheduling trains over a single-track railway line. These standard constraints include the minimum possible departure times, minimum running times between adjacent stations, minimum dwell times and/or train continuities within the stations and minimum headways between trains in the same direction and between trains in the opposite direction. In addition to those standard constraints and constraints that define meetings, followings and overtakes, there are some other constraints to consider regarding station and siding capacities (i.e., number of parallel tracks within stations and sidings available for meeting and overtaking operations) for realistic modeling. If a station or siding has \(n\) parallel tracks and at least \(n+1\) trains try to occupy the tracks in overlapping time periods, then the station's capacity will be exceeded. Thus, to get a comprehensive model of station capacities, we enumerated all cases where the numbers of eastbound and westbound trains add up to \(n+1\). In this study, we focused on stations having one secondary track and two secondary tracks, which covers most practical situations. Traditionally, the meeting of two particular trains in a particular station is defined by one binary variable. If this station has only one secondary line, then this is also sufficient for modeling the station capacity. However, in our model, to correctly model the station capacities of stations having two secondary lines, meetings were defined with two binary variables per train couple. This will be explained shortly. For modeling followings and overtakes, a special definition is not needed at all. The definitions in the model proposed by [PERSON] in his dissertation in 1989 will suffice [1]. Formal Mathematical Model for Scheduling Train Movements on a Single-Track Railway Line  
Before presenting the model, it is necessary to state some definitions and assumptions. The model was developed for a hypothetical line, and all trains were assumed to traverse the entire line. Two opposite directions were nominated as \"eastbound\" and \"westbound\". In the indexing scheme, stations were numbered from 1 to the total number of stations,and the station numbers increased in the eastbound direction. The number of tracks in the eastbound and westbound termini were assumed to be infinite. In the notations, if a symbol denotes a vector, then it is written in bold. The model was coded in AIMMS software using the latest version of CPLEX as the solver. The sets, indices, parameters, continuous decision variables and binary decision variables used in the model are defined in Tables 1-5, respectively. \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Definition** \\ \hline \(S\) & Set of stations \\ \(S_{1}\) & Set of stations with one secondary track. \\ \(S_{2}\) & Set of stations with two secondary tracks. \\ \(E\) & Set of eastbound trains \\ \(W\) & Set of eastbound trains \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Sets. \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Definition** \\ \hline \(e,f,g,h\) & Eastbound train indices \\ \(w,x,\,v,z\) & Westbound train indices \\ \(s,t\) & Station indices \\ \(s_{F}\) & The first station (western terminus) of the modeled railway line. \\ \(s_{L}\) & The last station (eastern terminus) of the modeled railway line. \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Indices and other symbols.