Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path

We present an algorithm to insert a train path in an existing railway timetable close to operation, when we want to affect the existing (passenger) traffic as little as possible. Thus, we consider all other trains as fixed, and aim for a resulting train path that maximizes the bottleneck robustness, that is, a train path that maximizes the temporal distance to neighboring trains in the timetable. Our algorithm is based on a graph formulation of the problem and uses a variant of Dijkstra’s algorithm. We present an extensive experimental evaluation of our algorithm for the Swedish railway stretch from Malmö to Hallsberg. Moreover, we analyze the size of our constructed graph.


Introduction
Over the last decades, both passenger traffic and freight traffic volumes in Sweden increased-from 1996 to 2016 by 82% (from about 7000 to 12800 passenger kilometers) and by 23% (from about 55 to about 68 million ton-kilometers), respectively, see (Grimm 2012;Trafikanalys 2017a, b).In all of Europe, freight traffic volume increases, and while the volume transported via railway within the EU has stagnated over the last years, see Eurostat (2017), the European commission sees the potential to revitalize rail freight (Commission of the European communities 2007): road congestion and the high oil price make road transport more expensive, railway transport is much safer, and increasing environmental concerns favor railway over road traffic.On the other hand, today's wagon load traffic is ineffective and marshalling complicates the transport-these problems need to be alleviated to comply with a political vision of increased freight traffic volumes.
One problem for the freight traffic is the long planning horizon.Today, an annual timetable is constructed, for which train path requests should be submitted up to more than 1.5 years in advance.Freight train operators often have a hard time to estimate transport volumes, and need to make frequent updates of the timetable ad-hoc.Further, the shunting plans for yards and terminals are normally made on a daily basis.
As a consequence, a typical real-world scenario is a train completed at the departing yard one or more hours ahead of its scheduled departing time.Sending it off earlier would not only release capacity at the shunting yard and in the network, but also give a valuable buffer for subsequent delays.Both the infrastructure manager (IM) and the railway undertaking (RU) are interested in this.Today, such a request is answered manually by looking a few stations ahead, and if the freight train will not interrupt operations on this limited considered stretch, an earlier departure will be permitted.This procedure hardly takes into account the already congested rail network, where freight traffic interacts with passenger traffic with much higher requirements on punctuality, nor does it ensure that the receiving yard or terminal has capacity to accommodate the train when arriving.
To make sure both that the existing (passenger) traffic is not affected by the train path of the freight train and that the freight train actually obtains a feasible train path to its destination, it is essential to optimize the process.We aim at a method for finding that train path, which minimizes the risk that other traffic in the deregulated market is affected.If that train path is still insufficiently robust, we advise the IM to reject the late application.
In this paper, we propose an algorithm that computes a maximum robust train path for inserting an additional train into an existing railway timetable (at a time).That is, the algorithm computes the train path with maximum temporal distance to all other existing trains, in particular, to the two neighboring trains on each line section, in the timetable (we further discuss the relation between robustness and the risk for disturbances in Sect.2.1).
We transform our problem to an equivalent network formulation and use a variant of Dijkstra's algorithm to compute the maximum robust train path by 1 3 Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path computing the maximum bottleneck path.Nodes are possible departing times at stations, edges represent feasible spatial or temporal movements, where edge costs give the temporal distance to the surrounding traffic.The objective of maximum robustness (plus using a graph representation of the existing timetable) is the main novelty of this paper.
This algorithm might be used for a freight train in the scenario described above, with the objective to influence the already scheduled trains as little as possible.Moreover, it may also be used for special passenger trains, which need to be added, but where the insertion follows the same objective of not disturbing existing trains.We assume that all other trains are fixed, that is, their train paths may not be altered.
In addition, because of our network formulation,-though we do not do so in the experiments in this paper-we can easily consider alternative routes within or between stations, which often causes problems when using Mixed Integer Linear Program (MILP) formulations.Our graph formulation inserts edges between stations, whenever inserting a train path between two adjacent trains on that line section is possible.Here, it does not play a role if all edges use the same sequence of stations or not.Hence, a different geometry, that is, an alternative route via different stations, can easily be integrated in the graph formulation, and does not influence the algorithm.
In general, several optimality criteria could be considered: we could aim for the earliest possible arrival time of the inserted train, or the shortest possible runtime of the train between the starting and end station, etc.
The remainder of this paper is organized as follows: In Sect. 2 we present related work, Sect. 3 gives necessary notation for our problem.We present an algorithm to compute the maximum bottleneck robust train path for the inserted freight train in Sect. 4. In Sect. 5 we present detailed experiments for the Swedish railway stretch between Malmö and Hallsberg for our algorithm and analyze its runtime in Sect.6.We give an improvement on the actual path selection of our algorithm in Sect.7, before we conclude in Sect.8.

Related work
In this section we give a literature overview on timetable planning with focus on robustness, followed by some few examples from the literature on methods for inserting an additional train in an existing timetable.

Robust railway timetabling
Railway timetabling is a problem that has been extensively studied for many years, see e.g.Hansen and Pachl (2014), Harrod (2012), or Törnquist (2006) for an overview.Normally a complete timetable is constructed in one single timetabling process, where the infrastructure capacity is assigned to rail undertakings and maintenance contractors according to some principles.Often, the problem is formulated as a MILP, where ordering variables are integer (binary), and time is continuous.When the timetable is assumed to have a cyclic structure, as is often the case in passenger traffic, a Period Event Scheduling Problem (PESP) can be formulated, see, e.g., Liebchen (2008).
Models applied closer to real-time are typically focused on rescheduling in case of disturbances and disruptions.The aim then often is formulated as to quickly re-obtain a feasible timetable of sufficient quality.For an overview of models of this kind, we refer to, e.g., the survey article by Cacchiani et al. (2014).Andersson et al. (2013) and Khoshniyat and Peterson (2017) show two examples of how rescheduling methods can be used on a more tactical level to redistribute available runtime margin and buffer time to increase stability.
Improving stability, however, may impair other timetable qualities, such as the average speed, heterogeneity and capacity utilization.UIC ( 2004) illustrate, in a frequently cited "Figure 1-Capacity balance", how railway capacity depends on the balance of these four factors.Zhang (2015) has developed a mathematical programming framework for line capacity studies, which aims at the minimization of heterogeneity and running time as well as the maximization of reliability and analyses Pareto optimal solutions in an application for the Beijing-Shanghai high-speed railway.
When we are inserting a new train into an existing timetable, capacity utilization will inevitably increase.Heterogeneity is an expression for the spread in travel speed among the trains in the timetable, and the effect of inserting an additional train depends on the difference in speed profile to adjacent trains sharing the same infrastructural resources.Homogenizing, i.e., decreasing heterogeneity, is considered to be desirable in timetabling.An attempt to quantify the heterogeneity in a timetable is made by Vromans et al. (2006).To the best of our knowledge this measure solely has never been used as target in timetable optimization problems.
In our model, the train paths for already existing trains are assumed to be fixed, and the new path must be inserted in a way that minimizes the expected impact to other traffic.Therefore, we want to find the most robust train path, and if that is not sufficiently robust, we may consider rejecting the additional request.The price for the robustness is a longer travel time, which, however, is bounded by time-windows for departure from origin and arrival to destination.Robustness might be defined in various ways, see e.g.Kroon et al. (2008).Goverde and Hansen (2013) distinguish between timetable stability, feasibility, robustness, and resilience.They define timetable robustness as "the ability of a timetable to withstand design errors, parameter variations, and changing operational conditions" and note that robustness depends on the stochastic behavior of all the underlying processes.
To assess the robustness, we must make some assumption on the stochasticity of the disturbance processes, which the timetable should be robust against.If we assume the disturbances to be uniformly distributed, identifying the train path with maximum bottleneck size, will indeed also give the most robust train path.This result follows from Goerigk and Schöbel (2014), and is essential in the motivation of our algorithm.

3
Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path

Methods for inserting a train in an existing timetable
Various authors also considered adding a new train to an existing timetable, amongst others (Burdett and Kozan 2009).Flier (2009) (see also Flier 2011) present a shortest path model using a time-expanded graph, which integrates linear regression models based on extensive historical delay data, that gives Pareto optimal train paths w.r.t.travel time and risk of delay.Ingolotti et al. (2004) consider adding new trains to a heterogeneous, heavily loaded railway network, and aim to minimize the traversal time for each additional train.Jiang et al. (2017) also add (passenger) trains: they consider a highly congested double track network line and aim to meet the passenger demand with the added trains; to that end, they can make limited alterations to the dwelling times for other, already scheduled, trains.They propose a heuristic to solve this problem.Cacchiani et al. (2010) also consider the problem of inserting a single freight train into an existing schedule of fixed passenger trains.They assume that the operator specifies an ideal time table that the IM can modify, which also includes the use of a different path.Cacchiani et al. aim to add the maximum number of new freight trains, such that their time table is as close as possible to the ideal one.To do so, they use a heuristic algorithm based on a Lagrangian relaxation of an Integer Linear Program (ILP).
To the best of our knowledge, the objective of maximizing the robustness of a train path for a train to be inserted in an existing timetable has never been considered.Moreover, other approaches either allow to adapt existing trains (which we aim to circumnavigate due to our application) and/or use heuristic approaches (instead of algorithms that guarantee to find the optimal solution).

Freight train insertion problem
In this section we formally define our problem.

Freight Train Insertion Problem (FTI):
Given A freight train ; a starting station s 0 and an end station s M ; a desired route for from s 0 to s M , given by a sequence of stations S = (s 0 , s 1 , … , s M ) , when clear from content, we only refer to the stations by 0, … , M ; time windows w s = [w a s , w d s ] for earliest arrival and latest departure of at station s for all, or some of the, stations s ∈ S ; the train-specific running times t i,i+1 for train from station i to i + 1 ∀i ∈ {0, … , M − 1} ; the timetable of all trains in the set T : all trains that run in [w a 0 − 1 , s d M + 2 ] , where i is defined such that the trains that depart before or arrive after a possible path for at any station are included; the required safety distance c , ,s (sometimes referred to as headway with a certain buffer or clearance time) between any other train and train at station s; and an objective function F .
Remarks: In this paper, we define the train-specific running times by the trains' respective maximum speed and some driving margin, i.e., we do not include the option of letting trains run slower.For s = 0 time window w s describes all possi- ble departure times from the origin, and for s = M the time window describes all possible arrival times at the destination.A time window at an intermediate station may also be given, e.g., due to staff schedule or wagon coupling/uncoupling.
Find A train path for given by arrival times a ,s and departure times d ,s for all stations in S within the time windows w s = [w a s , w d s ] ∀s ∈ S , that meets the dis- tances c , ,s ∀ ∈ T, ∀s ∈ S , and the t i,i+1 ∀i ∈ {0, … , M − 1} , and optimizes F .
In this paper, we use robustness as F .

Maximum bottleneck robust train path
In this section, we describe how we compute a maximum robust train path for a freight train close to operation, given that the train paths of all other trains are fixed.
That is, we solve FTI with the objective to maximize the robustness.In a first step, we transform our problem to an equivalent graph problem, see Sect.4.1.We then show that we can use a variant of Dijkstra's algorithm to compute the maximum robust train path, see Sect.4.2.

From timetable to input graph
We generate a graph with a set of vertices, V s , for each station, where a vertex repre- sents a feasible departure interval at that station.We insert inter-station edges, where the robustness of an edge is always determined by the earliest and latest possible departure from the vertex at its originating station.That is, an edge, representing a feasible train path from station s to s + 1 gets assigned a weight of the time differ- ence between earliest and latest departure from station s.As we assume linear train paths, the minimum robustness will always be assumed at a station, and for any path (selected by edges) the edge weights will reflect the robustness intervals along the complete train path.Moreover, we introduce intra-station edges that represent waiting at a station for , which is important to allow overtaking, with robustness of infinity, as the robustness of any train path is not limited by waiting at a station.The vertices and edges define our graph as G = (V, E) with V = ∪ M s=0 V s .In the following, we give a formal description of our input graph creation: We generate a set of vertices V s for each station s ∈ S .Let k , k+1 ∈ T be two trains that depart from s consecutively.We add a vertex to V s that represents the gap ,s (that is, if the temporal gap between trains k and k+1 at station s is larger than the necessary safety distances between k and , as well as between and k+1 at s, i.e., if can depart from ) (that is, if the temporal distance between the arrival of train k at station s + 1 plus the safety distance to and the arrival time of train k+1 at station s + 1 minus the safety distance to is positive, i.e., if can arrive at s + 1 between k and k+1 ), and if (c) the intervals defined by (a) ] overlap with each other and with w s = [w a s , w d s ] (that is, if the possible departure times for between trains 1 3 Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path k and k+1 at s and the departure times from s that lead to possible arrival times between trains k and k+1 at s + 1 overlap with the given feasible time window for earliest arrival and latest departure for at s).That is, in case the time gap between the two trains is large enough to accommodate a departure for train and these departure times fall in w s = [w a s , w d s ] .Inequality (a) determines a feasible interval for departures limited by the center gray and the leftmost pink point in Fig. 1 ( [ 1 , 1 ] ), inequality (b) determines a feasible interval for departures limited by the rightmost gray and the center pink point in Fig. 1 ( [ 2 , 2 ] ), and the feasible time window for earliest arrival and latest departure for at s is given by the leftmost gray and the rightmost pink point in Fig. 1 ( ).Hence, feasible departures for all three criteria can take place earliest at the rightmost gray and latest at the leftmost pink point, that is, within [ 2 , 1 ] .Of course, the i and i depend on s, the safety distances and the trains k and k+1 , we only introduce them here to enhance readability of Fig. 1.In general, the earliest departure time for for this gap, D e s, k , k+1 ( = max{ 1 , 2 , w a s } ), is given by the latest departure time for for this gap, D s, k , k+1 ( = min{ 1 , 2 , w d s } ), is given by A possible departure time for train is not only determined by k , k+1 depart- ing from s, but also by trains arriving at station s, see Fig. 2 for an illustration of the following description.If we simply consider the trains that run between stations s and s + 1 , the interval for possible departures for the vertex we intro- duced is given by the dark gray interval in Fig. 2; however, departing in-between trains from station s − 1 we might not actually arrive early enough at station s to allow for a departure in an arbitrary point in the dark gray interval.If we depart = max{A e v,s , d k ,s + c k , ,s , a k ,s+1 + c k , ,s − t s,s+1 , w a s } .We add vertices and edges, the robustness of an edge is always determined by the earliest and latest departure from the vertex at its originating station (we distinguish whether a sidetrack is available for overtaking, because only with an available sidetrack waiting at a station while another train overtakes is possible): ] Let v next be the successor vertex from v on s − 1. Add an edge e from v to v next to E. Set the robustness of e: .
The first if-condition checks whether the earliest departure time for is smaller or equal than the latest departure time for .If this condition is fulfilled, which allows to depart between trains k and k+1 , we need to have a vertex that represents the arrival of this feasible departure.If a vertex for the departure interval already exists, we add an edge to that vertex, and set the robustness of that edge to the difference between latest departure time and earliest departure time for between trains k and k+1 .If no such vertex exists, we create a vertex w n in the vertex set of station s, V s , add an edge to it and set the robustness accordingly.If a departure of between k and k+1 from s − 1 to s is not possible, we check whether a side track is available at s − 1 and if it is, which indicates that can use this sidetrack and be overtaken by another train/other trains, we add an edge to the next vertex on s − 1 .Note that the robustness depends on t s,s+1 , and as we define the train-specific running times by the maximum speed of the train (see Sect. 3), the robustness uses these fixed travel times between stations.
The final step already introduced some intra-station edges, that is, edges for which both endpoints are on the same station (both in V s−1 ).We introduce further intra-sta- tion edges to E, these always represent waiting at a station for , which is important to allow overtaking.The robustness of these edges is set to infinity ( r e = ∞ ), as the robustness of any train path is not limited by waiting at a station.As intra-station edges represent waiting for overtaking, we may not add intra-station edges for stations without sidings or we may only add them if a siding is available at a specific station and time.We can now define our graph as G = (V, E) with V = ∪ M s=0 V s .Finally, we apply a postprocessing step to G and iteratively delete all vertices with either indegree zero (a vertex that cannot be reached) or outdegree zero (a vertex that cannot be left), as these cannot be part of any path from s 0 to s M .

Algorithm for bottleneck train path
Given the graph defined in Sect.4.1, we want to find a path from the first vertex on station s 0 to the last vertex on station s M .Any such path would be feasible, but we do not only aim for a feasible path, but for an optimal path.In this paper, we define the optimum as the maximum robustness, that is, we want to solve FTI with F = robustness .Thus, we want to find a feasible path that maximizes the temporal distance to neighboring trains in the timetable.This translates to finding a maximum bottleneck path: only the smallest time interval to the neighboring trains on the complete path defines the robustness.This problem is also known as the maximum capacity route problem, see Pollack (1960), or the widest path problem, and can be solved by a variant of Dijkstra's shortest path algorithm (Dijkstra 1959); the pseudocode is given in Algorithm 1.
In line 4, we initialize the values: at the starting vertex of the first station the robustness is not limited (it will be by traversing the line section to the second station between two given trains), its r-value is set to infinity, for all other vertices, we want to find the maximum value, and without any initial knowledge, we set their r-values to zero (and will successively increase this value until its maximum).R is the set of already considered vertices, that is, those vertices for which we considered already all outgoing edges.In the beginning we have not considered any edges, hence, R is initialized as the empty set.In line 5, we pick the so far not considered vertex ( v ∈ V(G) ⧵ R ) with maximum r-value.This uses subpath-optimality: a path via a vertex not in R can never increase the r-value of the picked vertex.After this step v is added to R (line 6), as we consider all outgoing edges from v to a vertex w in V(G) ⧵ R in lines 7-10: for each such edge (v, w) we check whether the r-value of the old path to w (r(w)) is smaller than that of the path via v (which is the minimum of the r-value of the path to v, r(v), and the weight of the edge from v to w, c ((v, w))).If this check is true, we need to update the r-value of w (using the path via v results in a path with higher bottleneck robustness to w) in line 9 and set the predecessor of w to v in line 10.If we have not yet considered all vertices ( R ≠ V(G) ), we go back to line 5, otherwise, all r-values are set to the optimal value.s ∈ V (G).OUTPUT: Maximum bottleneck path from s to all vertices v ∈ V (G) and their value.
Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path

Experimental study: Malmö-Hallsberg
We test our method on the Swedish railway stretch between Malmö and Hallsberg, see Fig. 4. It has a length of 447 km and covers 76 stations.Between the first and the 65th station (400 km), it is double-track, while the last 11 stations are covered by single-track railway.
The studied railway stretch is part of the Scandinavian-Mediterranean freight rail corridor, and connects continental Europe to Hallsberg, the largest marshalling yard in Scandinavia; substretches are, for example, considered in Khoshniyat and Peterson (2017) and Solinen et al. (2017), and references therein.
Both the number of trains and the heterogeneity of these trains on the stretch contribute to congestion problems.According to Trafikverket, the Swedish Transport Administration, the capacity is used to more than 80% between Malmö and Hässle- holm, 61-80% between Hässleholm and Tranås (located 2km North of Gripenberg), and below 61% between Tranås and Mjölby.Between Mjölby and Hallsberg, the double-track stretch's capacity is used below 61% , the single track stretch's capac- ity is used to more than 80% (both when considering a 24-h and the most congested 2-h period during the day).Here, Trafikverket uses the capacity model suggested by UIC (2004).
Some of the stations along the complete stretch have additional sidetracks that enable overtaking, but not all of these are suitable to use in our case.For our algorithm, a station is considered to have a sidetrack, if: 1.The complete track is electrified.2. It is possible to both enter and leave the sidetrack without changing direction.3. The siding is to the left of the main tracks in case the adjacent sections are doubletrack (a sidetrack to the right would require the train to cross the track of trains running in the opposite direction, which is difficult in a congested environment and we do not consider it here).
A station that does not fulfill these criteria does not allow to overtake other trains (with sufficiently long scheduled stops) or to be overtaken by other trains, we mark it as a no-wait-station.Moreover, we distinguish the stations by the number of sidetracks.We make a simplified classification: stations with exactly one track matching the criteria, where a train can wait if no other train occupies the track, are called single sidetrack stations; and stations with more than one track matching the criteria, are called multiple sidetrack stations.Table 1 shows how many of the 76 stations fall into which class.We assume multiple sidetrack stations to have enough capacity, but check the availability for single sidetrack stations.
The remainder of this section is organized as follows: we present our base scenario in Sect.5.1, experiments with varied time windows in Sect.5.2, experiments with different train types in Sect.5.3, and experiments with different numbers of total train departures in Sect.5.4.

Base scenario
For our first set of experiments, we set the following parameters: -Historical train data used: Tuesday, February 24, 2015 (a representative weekday) 1 3 Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path -Train type: GR421410, a freight train with a maximum weight of 1400 tons, a maximum speed of 100km/h, and multiple locomotives of type Rc4 -Earliest allowed departure time from Malmö freight terminal: 25,200 s, 07:00 AM -Latest allowed departure time from Malmö freight terminal: 47,763 s, 01:16 PM -Latest allowed arrival time to Hallsberg marshalling yard: 64,800 s, 06:00 PM -Critical distance: c , ,s = 180 s ∀ ∈ T, ∀s ∈ S The uninterrupted travel time for our chosen train type from Malmö to Hallsberg is 4 h 44 min.On February 24, 2015, 394 unique trains ran along at least one section of the route, altogether they constituted 3830 train departures from all stations.(each train is counted for all stations along this stretch that it passes).Table 2  The train path we obtain in this base scenario is shown in Fig. 5: red and light blue give the earliest and latest possible running time for , respectively.The bottleneck for the robustness is located between the stations FLP and LU, the 7th and 8th station on the stretch from Malmö to Hallsberg; the bottleneck robustness is 300 s.The train departs from Malmö at 10:57:58 and arrives in Hallsberg at 17:53:24.This results in a travel time of 6 h and 55 min.

Variation of time windows
Intuitively, reducing the time windows for allowed departures from Malmö and allowed arrivals at Hallsberg will lead to less robust train paths: fewer train paths will be feasible, thus, a former optimal train path might no longer be available, but all other paths have smaller or equal robustness.Moreover, the temporal location of the time windows is important, that is, the same-sized time windows will lead to train paths of different robustness depending on the time of day, as the existing congestion in the train network varies.In this subsection, we investigate the relation between time window size and resulting train path robustness.
In the first set of experiments we fix the earliest departure time from Malmö (to 07:00, as in Sect.5.1) and vary the latest possible arrival time in Hallsberg.We start with the latest possible arrival time at 24:00 and reduce it in steps of 120 s until no feasible train path can be found.The result is shown in Fig. 6: a latest arrival time in Hallsberg between 17:52 and 24:00 allows to insert a train path with robustness of 300 seconds, a latest arrival time between 16:04 and 17:50 allows to insert a train path with robustness of 147 s.The earliest feasible solution, which we obtained by running our algorithm with a resolution up to seconds, has an arrival time of 16:00:56 at Hallsberg.
If we could simply insert the train at 7 am and it could run uninterrupted, it would arrive in Hallsberg at 11:44.Thus, the earliest feasible train path arrives more than 4 h after this theoretical earliest arrival.This gap is caused by two factors: morning rush hour in the urban region around Malmö, and network congestion during daytime (due to which the train often needs to wait on sidings).During the morning rush hour between 7 and 9 there exist only five feasible time gaps of 6 min (which allow to keep the critical distance of 3 min to both the preceding and the succeeding train) between the two stations Arlöv and Burlöv just North of Malmö.In fact, when we consider stop pattern and speed of the existing trains, also these five gaps disappear: there is no feasible path that leaves Malmö before 9:00.
In the second set of experiments we fix the latest arrival time at Hallsberg (to 19:00) and vary the earliest possible departure time from Malmö.We start with the earliest possible departure time at 00:30 and increase it in steps of 120 s until no feasible train path can be found.The result is shown in Fig. 7: the robustness associated with a possible departure time varies significantly more than with the latest arrival time in Hallsberg, for a departure at 00:30 a train path with robustness of 1400 s (ca.

3
Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path 23 min) can be obtained.For the first set of departure times, may run during the night, mostly undisturbed by other trains.The robustness of the best found path is reduced dramatically for a start time between 03:00 and 04:00: from 1149 s at 03:20 to 300 s at 04:00.This is, again, caused by congestion on the stretch between Malmö and Lund: between 01:00 and 04:00 one to three other trains travel on the stretch, in the hour from 04:00 to 05:00 the traffic increases to 11 trains per hour.If we consider the variation of the arrival time in Hallsberg, all runs with a latest arrival time between 17:50 and 24:00 yield feasible solutions with identical robustness; however, they do not share the same path.The bottleneck is the same for all solutions, but the remainder of the paths differs.Several paths with different arrival times at Hallsberg between 18:00 and 20:00 all use the same bottleneck section.As our algorithm only accounts for the bottleneck, all these paths (with a feasible arrival time) are equally good solutions.By reducing the latest possible arrival time, some of the paths become infeasible, and the algorithm outputs a different path.We consider the problem of choosing the "best" path out of several feasible paths with the same bottleneck in Sect.7.
Another observation, from both Figs.6 and 7, is that there are large plateaus in the step function.That is, increasing the time window size does not necessarilyand will in fact often not-result in a train path with increased robustness.

Variation of train type
In our base scenario in Sect.5.1 we used a train of type GR421410, a freight train with a maximum weight of 1400 tons, a maximum speed of 100 km/h, and multiple locomotives of type Rc4.Using different train types, with different maximum speed and maximum weight restrictions, results in different runtimes for the train from station to station.Both a slower and a faster train might lead to train paths with better robustness, depending on the speed pattern of the already existing trains, see Fig. 8. Recall that in our model all trains always run with the maximum allowed speed.Using a faster train might lead to an earlier arrival at a station, which will in turn open up train path departure possibilities from that station that were not an option for a later arriving, slower train.Moreover, if the freight train is not restricted by other existing trains, a faster train will automatically obtain a shorter travel time and an earlier arrival time at the final station.
To investigate the sensitivity of a train path's robustness, we analyze nine train types, see Table 3 for an overview of their attributes.All of these types operate currently on the considered stretch, and we consider them a good representation of all the train types operating between Malmö and Hallsberg.For each train type, we allowed a latest arrival time at 18:00, and then reduced this time stepwise by intervals of 45 min.The resulting robustness of train paths found by our algorithm is given in Table 4.
The first five trains obtain paths with quite similar robustness, if we compare the travel time to our train from the base scenario (GR421410), trains GB201310 and GB402010 have a 139 s longer runtime between Malmö and Hallsberg, train GT421209 has a 2300 s longer runtime, and train GR401608 has a 4360 s longer runtime.On the other hand, trains GR400710 and GR401409 take 22 s less than GR421410, for the two passenger train types the difference is even larger: PX2-2000 and PX610016 need 6753 and 5546 s, respectively, less than the train from the base scenario.
The faster passenger trains obtain feasible train paths also for a latest arrival time at 15:00 and 15:45; on the other hand, the robustness of the obtained passenger train paths is not consistently better than that of freight trains: for arrival at 18:00 the best train path for passenger trains is 272 and 277, while freight trains yield a train path with 300 s robustness.
We take a more detailed look into this difference in robustness: in Fig. 9 we compare the earliest and latest possible train paths for the PX2-2000 and the GR421410 at the bottleneck, which for both occurs at the same station, FLP, between the same preceding and succeeding train.The main difference in robustness is not caused by the latest possible departure time (the light blue lines nearly coincide at station FLP), but by the earliest possible departure time.The earliest possible departure time is defined by the preceding train.This train is slower than both considered trains, thus, the slower of the two trains, GR421410, may depart earlier to keep the safety distance to the preceding train than the faster passenger train.Thus, the resulting robustness at the bottleneck is higher for the freight train.Hence, we can conclude that the algorithm yields higher robustness for trains with a speed similar to that of adjacent traffic.

Variation of number of train departures in the network
So far we used the time table of Tuesday, February 24, 2015 for our experiments.In this subsection, we analyze the impact of different days with different numbers of trains and time tables on the robustness of the train path of our added freight train.We analyze all days in the 2015 annual time table (December 15, 2014-December 09, 2015) with the standard time window of 06:00-18:00.Figure 10 shows the maximum bottleneck robustness for our inserted freight train for all days of the 2015 annual time table [some dates (38 days) were excluded due to incomplete input data].We can observe only a few distinct bottleneck robustness values, but these values repeat frequently over the considered time period.In particular, the maximum bottleneck robustness follows an alternating high-low value trend for weekdays/ weekends.
When we compare the number of existing trains in the time table on a specific day and the robustness obtained for the inserted freight train, we can observe a clear correlation, see Fig. 11: on days with a higher number of existing trains (usually weekdays) the maximum bottleneck robust path is less robust than on days with fewer existing trains (usually weekends).In Fig. 11 we can observe some exceptions to this rule in the two first weeks, thus, the general statement that more existing trains in the time table will always lead to a lower bottleneck value is not correct.To study the relation more closely, we performed a linear regression analysis; for the    3) yields an upper bound of 734502 on the number of vertices.However, we actually only have |V| = 6948 , that is, the inequality really includes a lot of slack or hides very small constants, and after the postprocessing step, we are left with only |V| = 3259 (less than half of the original vertices), which is significantly smaller than the given upper bound.This reduction is highlighted in Fig. 15: the number of vertices actually decreases with the number of trains, this holds for different train types as shown in Fig. 15b.The algorithm presented in Sect.4.2, and analyzed in detail in Sect.5, has one drawback: We only care about the robustness at the bottleneck, the rest of the train path is not optimized, we only know that nowhere along the path the bottleneck robustness is undercut.Thus, two train paths over five stations with robustness of 150, 150, 150, 150, 150 and 350, 300, 150, 350, 400 at the stations are equally good, and our algorithm might output the former.When we actually want to insert a freight train that influences the existing trains as little as possible, we would prefer the latter.However, this might, e.g., lead to longer total travel times for the inserted train.
We can easily adapt our algorithm to reflect this choice by increasing our storage complexity: We store a vector, R, with the robustness at all stations along the path.We still update the path in case it allows for a higher bottleneck robustness, but, if we found another path with the same bottleneck robustness for which the vector R is lexicographical larger than the vector R for the old path, we update our chosen path Railway timetabling: a maximum bottleneck path algorithm for finding an additional train path as well.See Algorithm 2 for the pseudocode of this improved algorithm.We leave an implementation of this algorithm to future work.

Conclusions and outlook
We presented an algorithm that can be implemented to insert one additional train in an existing timetable.The algorithm is fast and gives a satisfying result in reasonable time for operational use.
In our test set of experiments, we solely used the maximum bottleneck as objective.This is well-motivated from a robustness perspective, but can easily be extended to account for other goodness measures; in particular, we can easily account for the robustness on the path to and from the bottleneck section by increasing our storage complexity.Moreover, preprocessing may be applied to omit train paths with unwanted properties such as a travel time exceeding the train driver's maximum allowed working time.The study of further objectives for FTI is left as future work.
As a heuristic for inserting several trains, the algorithm may be called repeatedly.To obtain better algorithms for this scenario, we might study either the offline or the online problem in which multiple additional train paths need to be inserted within a time interval.Moreover, our approach allows for a specific, defined speed of the inserted train, and if we allow a larger number of allowed speeds (still a discrete set), this will increase the size of our graph.Hence, it might be interesting to study other types of algorithms that allow a continuous spectrum of train speed.
Funding Open access funding provided by Linköping University.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made.The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material.If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.To view a copy of this licence, visit http://creat iveco mmons .org/licenses/by/4.0/.

Fig. 1
Fig. 1 Two stations, s and s + 1 , are shown as horizontal black lines, time is depicted along the x-axis.Two existing, consecutive trains, k and k+1 , are shown in blue, the safety distances (depending on the station and the trains) in green, and the feasible time window on station s in yellow.The earliest departure and the latest departure time for on s is the maximum of the three points in time marked in gray, 2 , and the minimum of the three points in time marked in magenta, 1 , respectively

Fig. 2
Fig. 2 Three stations, s − 1 , s and s + 1 , are shown as horizontal black lines, time is depicted along the x-axis.Existing trains are shown in blue, the safety distances in green, w s = [w a s , w d s ] in yellow, and earliest departure times for inserted trains in red.Possible departure intervals at station s as defined by the arrival times from station s − 1 are shown in shades of gray

Algorithm 1 :
Maximum Bottleneck Path INPUT : Directed graph G, edge weights c : E(G) → R + , start vertex

Fig. 4
Fig. 4 Map of the Swedish railway stretch, with a selection of all stations marked, between Malmö and Hallsberg, single-track is marked in pink.(Source of figures: trafikverket.se)

Fig. 5
Fig. 5 Space/time representation of the railway timetable: existing trains are shown in blue, red and light blue denote the interval borders for .To obtain maximum robustness runs in the center of the so defined corridor.b depicts the stretch from Malmö (MGB) to BLD, a depicts the stretch from VS (followed by BLD) to Hallsberg (HRBG)

Fig. 6
Fig. 6 Robustness of the computed train path depending on the latest possible arrival time in Hallsberg

Fig. 7
Fig. 7 Robustness of the computed train path depending on the earliest possible departure time in Malmö

Fig. 8
Fig.8Existing trains between station s and station s + 1 are shown in blue, the earliest and latest possible departure for an inserted train is shown in red (limited by the safety distance to the existing trains shown in green).The distance between these two red lines defines the robustness of this section of the train path.a A slower train (right) obtains a higher robustness than a faster train (left).b A faster train (left) obtains a higher robustness than a slower train (right)

Fig. 10 3
Fig. 10 Maximum bottleneck robustness of the freight train obtained for all days fo the 2015 annual time table, except for April 3, 2015-April 6, 2015 and July 6, 2015-August 9, 2015 Fig. 12 Robustness over number of trains in the time table.Actual data points, given by days from the 2015 annual time table, are shown in orange, the linear function obtained by regression analysis is shown in black

Fig. 15
Fig. 15 Number of vertices over number of trains: a data points for different days, b comparison for different train types

18 5 .
if R = V (G) then 19 THEN GOTO 2 IF D e � s, k , k+1 ≤ D s, k , k+1 IF there exists a vertex w ∈ V s with departure interval [D e � s, k , k+1 , D s, k , k+1] Add an edge e from v to w to E. Set the robustness of e: r e = D s−1, k , k+1 n ∈ V s , add an edge e from v to w n to E.

Table 2
Station number, station code, and number of train departures for all stations on the stretch from Malmö to Hallsberg on February 24, 2015

Table 3 Train
robustness.We observe February 24 to be representative for the robustness range on the majority of weekdays in the 2015 annual time table.6Analysis:

runtime and graph size
Obviously, our algorithm is a variant of Dijkstra's algorithm and, thus, runs in O(|V| log |V| + |E|) on a given graph G = (V, E) .To analyze the runtime of our algorithm we have to determine the number of vertices and edges in our constructed graph.These values depend on the number of stations, |S | , and on the number of existing trains in the time table, |T| .We yield: