# Investigation of Railway Network Capacity by Means of Dynamic Flows
## 3 Optimization Model for Determining a Network-Wide Capacity
### Mathematical Formulation of the Model
#### 3.3.3 Constraints  
**Scheduled trains. ** All trains in \(K_{sch}\) are scheduled. \[ \begin{split} y^{k}=1\\ \forall\ k\in K_{sch}\end{split}  \tag{4}\]  
**Departure frequencies of scheduled trains. ** For each route number \(n\), for which trains are defined in the set \(K_{sch}\), it is ensured that within each hour of the time horizon, a certain number of trains \(f_{n}\) start their journey at their (common) origin vertex. The formulation of these constraints assume that one time step corresponds to one minute. \[ \begin{split}\sum_{k\in K_{st}\cap K_{sch}}\sum_{t=z\cdot 60}^{(z+1 )\cdot 60-1}x_{((o(k),a),(o(k),t))}^{k}=f_{n}\\ \forall\ n\in N,\forall\ z\in\left\{0,1,\dots,\frac{T}{60}-1\right\} \end{split}  \tag{5}\]  
**Start and end of train journeys. ** Each train (scheduled by the model, i.e. \(y^{k}=1\)) starts its journey in the source of its origin vertex and ends it in the sink of its destination vertex. \[ \begin{split}\sum_{t=0}^{T}x_{((o(k),a),(o(k),t))}^{k}=\sum_{t=0} ^{T}x_{((d(k),t),(d(k),a))}^{k})=y^{k}\\ \forall\ k\in K\end{split}  \tag{6}\]  
**Flow conservation. ** Flow conservation holds for every vertex (except for the sources and sinks) and every train in the time-expanded network. \[ \begin{split}\sum_{a\in\delta^{+}((i,t))\ |\ a\in A^{T,k}}x_{a}^{k}-\sum_{a\in\delta^{-}((i,t))\ |\ a\in A^{T,k}}x_{a}^{k}=0\\ \forall\ (i,t)\in V^{T}:\ t\in\{0,1,\dots,T\},\ \forall\ k\in K \end{split}  \tag{7}\]  
**Train routes through the network. ** Each (scheduled) train follows its assigned route through the network. \[ \begin{split}\sum_{t=0}^{T-\tau_{ij}^{k}}x_{((i,t),(j,t+\tau_{ij} ^{k}))}^{k}=y^{k}\\ \forall\ k\in K,\ \forall\ (i,j)\in A^{k}\end{split}  \tag{8}\]  
**Available station tracks. ** Station capacities are respected at any time. \[ \begin{split}\sum_{k\in K\ |\ i\in V^{k}}x_{((i,t),(i,t+1))}^{k} \leq\kappa_{i}\\ \forall\ i\in V_{c},\ \forall\ t\in\{0,1,\dots,T-1\}\end{split}  \tag{9}\]  
**Dwell times in stations. ** Minimum and maximum dwell times of (scheduled) trains in stations are complied with. \[ \begin{split} w_{min,\ i}^{k}\cdot y^{k}\leq\sum_{l=0}^{T-1}x_{(( i,t),(i,t+1))}^{k}\leq w_{max,\ i}^{k}\\ \forall\ k\in K,\ \forall\ i\in V^{k}\end{split}  \tag{10}\]  
**Route conflicts in stations. ** As described in Section 3.2.2, the parameter \(\mu\) can take the values '\(a^{\prime}\) or '\(d^{\prime}\) depending on whether it indicates a station arrival or departure. Because each route conflict is defined for exactly two route numbers, each of which can be represented in the conflict by an arrival or departure, four cases need to be distinguished in the formulation of the constraints below. Two station arrivals (route number \(n\) from direction \(j\) and route number \(n^{\prime}\) from direction \(j^{\prime}\)) must be at least \(\Delta t\) time steps apart. \[ \begin{array}{c}\sum_{k\in K_{n}}\sum_{t^{\prime}=t\ |\ \tau^{k}_{j}\leq t^{ \prime}\leq T}^{t+\Delta t-1}x_{((j,t^{\prime}-\tau^{k}_{j}),(i,t^{\prime}))} ^{k}\\ +\sum_{k\in K_{n^{\prime}}}\sum_{t^{\prime}=t\ |\ \tau^{k}_{j}\leq t^{\prime} \leq T}^{t+\Delta t-1}x_{((j,t^{\prime}-\tau^{k}_{j}),(i,t^{\prime}))}^{k} \leq 1\\ \forall i\in V_{c},\ \forall((j,n,\mu),(j^{\prime},n^{\prime},n^{\prime}))\in C _{i}:\ \mu=n^{\prime}=a^{\prime},\ \forall t\in\{0,1,\dots,T\}\end{array}  \tag{11}\]  
One station arrival (route number \(n\) from direction \(j\)) and one departure (route number \(n^{\prime}\) in direction \(j^{\prime}\)) must be at least \(\Delta t\) time steps apart. \[ \begin{array}{c}\sum_{k\in K_{n}}\sum_{t^{\prime}=t\ |\ \tau^{k}_{j}\leq t^{ \prime}\leq T}^{t+\Delta t-1}x_{((i,t^{\prime}),(j,t^{\prime}+\tau^{k}_{j}))} ^{k}\\ +\sum_{k\in K_{n^{\prime}}}\sum_{t^{\prime}=t\ |\ 0\leq t^{\prime}\leq T-\tau^{k}_{ j^{\prime}}}^{t+\Delta t-1}x_{((i,t^{\prime}),(j^{\prime},t^{\prime}+\tau^{k}_{ j^{\prime}}))}^{k}\leq 1\\ \forall i\in V_{c},\ \forall((j,n,\mu),(j^{\prime},n^{\prime},n^{\prime}))\in C _{i}:\ \mu=a^{\prime}\ \wedge\ \mu^{\prime}=a^{\prime},\ \forall t\in\{0,1,\dots,T\}\end{array}