# An Algorithm for Rescheduling of Trains under Planned Track Closures
## 4 Joint Problem of Train Rescheduling and Track Closure Planning
### Mathematical Model
#### 4.5.3 Final Model and Its Analysis
Constraints imposed on track closures:  
\[y_{n}=1,\ n=1,2,\ldots,C^{\text{OB}}, \tag{1}\]  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]\[\min\{y_{n}(t_{n}^{\text{CES}}+\Delta t_{n}^{\text{C}}+T_{n}^{\text{C}}),y_{m }(t_{m}^{\text{CES}}+\Delta t_{m}^{\text{C}}+T_{m}^{\text{C}})\}\leq\max\{y_{n} (t_{n}^{\text{CES}}+\Delta t_{n}^{\text{C}}),y_{m}(t_{m}^{\text{CES}}+\Delta t_{ m}^{\text{C}})\},\\ (n,m)\in\mathbf{C}^{\text{CON}}=\{(n,m)\in\mathbf{C}\times\mathbf{C}:n \
eq m,\exists_{i,j\in\mathbf{V},k\in\mathbf{K}}(R_{n,i,j,k}^{\text{C}}+R_{m, i,j,k}^{\text{C}}=2)\}. \tag{3}\]  
Constraints imposed on train runs:  
\[x_{p}=1,\ p\in\mathbf{TR}^{\text{OB}}. \tag{4}\]  
Constraints imposed on train routes:  
\[\sum\limits_{k\in\mathbf{K}}(R_{p,i,j,k}^{\text{T}}-r_{p,i,j,k}^{\text{T}})( \Delta t_{i,p}^{\text{ARR}}-\Delta t_{i,p}^{\text{DEP}})=0,\ i,j\in\mathbf{V},p \in\mathbf{TR}, \tag{5}\]  
\[x_{p}r_{p,i,j,0}^{\text{T}}\leq\min\{e_{i,j,0},\ \frac{1+\sum\limits_{k\in\mathbf{K} \backslash\{0\}}(\sum\limits_{d\in\mathbf{TR}_{i,j,p}^{\text{CON}}}x_{q}r_{q, i,j,k}^{\text{T}}+\sum\limits_{q\in\mathbf{TR}_{i,j,p}^{\text{T}}}r_{q, i,j,k}^{\text{T}}x_{q}+\sum\limits_{n\in\mathbf{C}_{i,j,p}^{\text{C}}}r_{n, i,j,k}^{\text{C}}y_{n})}{(1+\sum\limits_{k\in\mathbf{K}\backslash\{0\}}e_{i,j,k} )}\},\\ i,j\in\mathbf{V},p\in\mathbf{TR}, \tag{6}\]  
\[\mathbf{TR}_{i,j,p}^{\text{CON}}\overset{\Delta}{=}\{r\in\mathbf{ TR}\backslash\{p\}:t_{i,p}^{\text{DEP}}+\Delta t_{i,p}^{\text{DEP}}\leq t_{i,r}^{\text{DEP}}+\Delta t_{i,p}^{\text{DEP}} \leq t_{i,p}^{\text{ARR}}+\Delta t_{i,p}^{\text{ARR}}\vee t_{i,p}^{\text{DEP} }+\Delta t_{i,r}^{\text{DEP}}\\ \leq t_{i,p}^{\text{ARR}}+\Delta t_{i,p}^{\text{ARR}}\leq\Delta t_{ i,r}^{\text{ARR}}+\Delta t_{i,r}^{\text{ARR}}\},\\ \mathbf{C}_{i,j,p}^{\text{CON}}\overset{\Delta}{=}\{n\in\mathbf{C}:t _{i,p}^{\text{DEP}}+\Delta t_{i,p}^{\text{DEP}}\leq t_{n}^{\text{CES}}+\Delta t _{n}^{\text{C}}\leq t_{i,p}^{\text{ARR}}+\Delta t_{i,p}^{\text{CAR}}\lor t_{n}^ {\text{CES}}+\Delta t_{n}^{\text{C}}\] \[\leq t_{i,p}^{\text{ARR}}+\Delta t_{i,p}^{\text{ARR}}\leq t_{n}^{ \text{CES}}+\Delta t_{n}^{\text{C}}+T_{n}^{\text{C}}\},\]  
\[\sum\limits_{j\in\mathbf{V}}\sum\limits_{k\in\mathbf{K}\backslash\{0\}}x_{p} \max(r_{p,j,k,k}^{\text{T}},r_{p,i,j,k}^{\text{T}})(1+\sum\limits_{q\in\mathbf{ TR}_{i,p}^{\text{CON}}}\sum\limits_{l\in\mathbf{V}}\sum\limits_{m\in\mathbf{K} \backslash\{0\}}x_{q}\max(r_{q,l,l,m}^{\text{T}},r_{q,l,j,m}^{\text{T}})\leq CAP _{i},\\ i\in\mathbf{V}\backslash\{0\},p\in\mathbf{TR}, \tag{7}\]  
\[\min\{r_{p,i,j,k}^{\text{T}}x_{p}(t_{i,p}^{\text{DEP}}+\Delta t_{ i,p}^{\text{DEP}})+r_{p,j,k,k}^{\text{T}}x_{p}(t_{i,p}^{\text{ARR}}+\Delta t_{i,p}^{ \text{ARR}}),\\ r_{q,i,j,k}^{\text{T}}x_{q}(t_{j,q}^{\text{ARR}}+\Delta t_{j,q}^{ \text{ARR}})+r_{q,j,k,k}^{\text{T}}x_{q}(t_{i,q}^{\text{ARR}}+\Delta t_{i,q}^{ \text{ARR}})\}\\ \leq\max\{r_{p,i,j,k}^{\text{T}}x_{p}(t_{i,p}^{\text{DEP}}+ \Delta t_{i,p}^{\text{DEP}})+r_{p,j,i,k}^{\text{T}}x_{p}(t_{j,p}^{\text{DEP}}+ \Delta t_{i,p}^{\text{DEP}}),\\ r_{q,i,j,k}^{\text{T}}x_{q}(t_{i,q}^{\text{DEP}}+\Delta t_{i,q}^{ \text{DEP}})+r_{q,i,j,k}^{\text{T}}x_{q}(t_{j,q}^{\text{DEP}}+\Delta t_{i,p}^{ \text{DEP}})\},\\ r_{p,i,j,k}^{\text{T}}(t_{i,p}^{\text{DEP}}+\Delta t_{i,p}^{ \text{DEP}})\leq r_{p,i,j,k}^{\text{T}}(t_{j,p}^{\text{ARR}}+\Delta t_{j,p}^{ \text{ARP}}),\\ p,q\in\mathbf{TR},i,j\in\mathbf{V},k\in\mathbf{K}\backslash\{0\}. \tag{8}\]  
Constraint imposed on train run times:  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]0  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]1  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]2  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]3\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]4  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]5  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]6  
Constraint imposed on both train runs and track closures:  
\[t^{\text{CES}}_{n}+\Delta t^{\text{C}}_{n}\leq t^{\text{CLS}}_{n}+M(1-y_{n}), \ \Delta t^{\text{C}}_{n}\geq 0,\ n\in\mathbf{C}, \tag{2}\]7  
The auxiliary notions used in (17) and (16) have the following meanings: \(M\)--big number, \(\mathbf{C}^{\mathrm{CON}}=\{(n,m)\in\mathbf{C}\times\mathbf{C}:n\
eq m,\exists _{i,j\in\mathbf{V},k}\in(R_{n,i,j,k}^{\mathrm{C}}+R_{m,i,j,k}^{\mathrm{C}}=2)\}\)--set of closures reporting possession of the same track, \(\mathbf{TR}_{i,p}^{\mathrm{CON}}=\{q\in\{1,2,\ldots,TR\}:t_{i,p}^{\mathrm{ARR}} \leq t_{i,q}^{\mathrm{DEP}}\leq t_{i,p}^{\mathrm{DEP}}\lor t_{i,p}^{\mathrm{ ARR}}\leq t_{i,q}^{\mathrm{ARP}}\}\)--sub-set of trains with dwell time on the station \(i\) coinciding with that of the train run \(p\), \(\  
criterion ensures the hierarchy of the decisions, i.e., the acceptance of optional closures is the most important, whereas the differences of departure times in the timetables are the least important.