## 3 Model and Methods
### The Mathematical Model
Constraint (22) ensures that at most one of the binary variables can be equal to one. \[d_{w}^{s_{L}}\geq\delta_{w}\forall\;w\in W \tag{3}\]8  
\[d_{w}^{s_{L}}\geq\delta_{w}\forall\;w\in W \tag{3}\]9  
Constraints (29) and (30) introduce the definition of binary meeting variables for the stations with two secondary lines. Constraint (29) is active when \(c^{s}_{e,w}=1\), which is when eastbound train \(e\) arrives at station \(s\) before westbound train \(w\). Constraint (30) is active when \(c^{s}_{e,w}=1\), which is when westbound train \(w\) arrives at station \(s\) before eastbound train \(e\). In case of simultaneous arrival, the model will treat the situation as if the westbound train arrived first. The station or siding capacity constraints will be given as follows, first for the stations with one secondary line and then for the stations with two secondary lines. These constraints are based on the enumeration of the possible situations such that the station or siding capacity is exceeded. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]0  
Constraint (31) dictates that no eastbound train can overtake more than one eastbound train at station \(s\), which has one secondary line. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]1  
Constraint (32) is the same as Constraint (31), but for westbound trains. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]2  
Constraint (33) dictates that an eastbound train cannot overtake an eastbound train and meet with a westbound train at station \(s\), which has one secondary line. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]3  
Constraint (34) is the same as Constraint (31), but for two westbound trains and one eastbound train. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]4Constraint (35) is active when eastbound train \(f\) (slower than \(e\)) enters station \(s\) (with one secondary line) after eastbound train \(e\), and it then dictates that train \(f\) can enter the station only after train \(e\) clears the station. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]5  
Constraint (36) is the same as Constraint (35), but for two westbound trains. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]6  
Constraint (37) is active if eastbound train \(e\) enters station \(s\) (with one secondary line) after (slower) eastbound train \(f\) and will not overtake eastbound train \(f\) at station \(s\). It then dictates that eastbound train \(e\) can enter station \(s\) only after eastbound train \(f\) departs. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]7  
Constraint (38) is the same as Constraint (37), but for two westbound trains. \[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]8  
_Capacity Constraints for Stations with Two Secondary Lines-2:_  
\[\tau_{e}\geq a_{e}^{s_{L}}-\alpha_{e},\forall\;e\in E \tag{4}\]9  
Constraints (39) and (40) prevent any train from overtaking more than two trains at station \(s\), which has two secondary lines. _Capacity Constraints for Stations with Two Secondary Lines-3:_  
\[\hat{\tau}_{w}\geq a_{w}^{s_{F}}-\hat{\alpha}_{w},\forall\;w\in W \tag{5}\]0  
Constraint (41) prevents more than two westbound trains from \"giving way to\" the same eastbound train at station \(s\), which has two secondary lines. \[\hat{\tau}_{w}\geq a_{w}^{s_{F}}-\hat{\alpha}_{w},\forall\;w\in W \tag{5}\]1  
Constraint (42) is the same as Constraint (41), but for more than two eastbound trains and one westbound train.