Abstract
This paper studies the real-time trains routing and platforming problem (RT-TRPP) in railway stations that arises from the unreliable arrival times of freight trains, flexible shunting operations and dynamic station layout caused by equipment failure. The feasibility of station timetable is checked before preparing a route for a train or after updating the station layout. If the station timetable is infeasible, the reassignment of trains is triggered. After introducing a problem formulation for the RT-TRPP, we propose an Integer Linear Program (ILP) that strives to minimize the number of conflicting trains. In resulting timetable, directions, arrival and leaving time remain the same with networks timetable to prevent traffic disturbance of neighboring territories. If the resulting timetable is still infeasible, conflicting trains are pointed out with the cause analysis. The method is tested on real-world complex station which receives always the overload of trains’ activities. The optimal full-day solution of 249 trains is obtained within 2 seconds. The efficiency of this method meets the time-critical nature of RT-TRPP.
Introduction
To meet increasing rail transport demands, railway networks are operated nearly at capacity margins. However, only certain critical resources are close to capacity limit. Junction center stations not only act as a customer service center but also need to balance the traffic on connecting lines and on complex rail network inside the station. As trains speed up on connecting lines, busy and complex railway station certainly becomes a critical resource. Compared with routing and scheduling problem on railway network, the buffer time and space in stations is greatly limited. To enhance capacity, new tracks and routes can be built. Except investments and space needed, such solutions are unlikely to be completed in short or medium terms. Furthermore, such extensions are usually infeasible to execute in urban areas. Thus, exploitation of pass-through capacity in stations is an economic and efficient remedy.
The traditional process to generate a timetable for a railway network is divided into several stages proposed by [12]. Firstly, an initial network timetable is generated by train activities managers (national, regional, freight) based on traffic frequencies, volume of traffic, rough layout of railway network together with the desired lines and their connection requirements [3, 8]. Then, station operators need to check whether the network timetable is feasible within the railway station while satisfying capacity, safety and customer service [6, 9]. Most of the studies focus on the generation of network timetable with a global point of view [1, 4]. In practice, initial timetables based on rough pass-through capacity of stations does not always fit to existing infrastructure and shunting plan within stations.
Reference [5] considers computational complexity of trains routing problem in railway stations. The problem is formulated as a node-packing problem and describes the relationship between the routing problem and the Fixed Interval Scheduling Problem. Based on the satisfiability problem, they deduce that the safety feasibility problem is NP-complete if each train has three or more routing possibilities. However, if each train has at most two routing possibilities, then the general feasibility problem can be solved in polynomial time. Furthermore, if the layout of the railway station is fixed, then the safety optimization problem can be solved by a dynamic programming approach in an amount of time that is polynomial in the number of trains.
Reference [9] formulates train routing problem in stations, with given arrival and leaving times of trains in a cyclic timetable (one hour) and detailed station layout, as an integer linear program based on the Node Packing Problem (NPP). The deviations δ of original arrival and departure times are permitted. Furthermore, a solution procedure is proposed for the problem, based on a branch-and-cut approach. To reduce the size of the problem, they firstly determine the admissible combinations of routing possibilities (r, δ; r′, δ′) ∈ Ft, t′ for combinations of trains t and t’, considering the safety, (un-)coupling, connection requirements and the set of allowable routing possibilities for each train. Secondly, the preprocessing step simplifies the problem by removing dominated nodes in the graph of node packing problem. Then, valid inequalities are added to tighten the problem. An initial solution is generated by heuristics method to accelerate the calculation. But the calculation of the set Ft,t’ requires a lot of calculation time O(T2*R2*δ2) in a large and busy railway station which consists of R possible paths and is passed through by a group of T trains with permitted deviation δ.
Reference [10] improves the previous model by extending the preprocessing techniques and considering routing preferences and shunting decisions. In the model, only the decision whether or not to shunt is considered without the feasibility checking on routes and tracks. If a train is to be shunted towards a parking area, the train is to have a standstill at its arrival track and a different departure track, and is to be at a track of parking area between these two standstills. The shunting decision and allocation preferences are represented by the weight coefficient of allocation variables. The node packing of maximum weight represents a feasible routing of trains with the maximal preference and maximum number of trains scheduled.
Reference [7] considers train scheduling problem for complex and busy stations. They develop a scheduling heuristics analogous to manual methods of train planners. With the progressive improvement of the search rules, the computing times fell from several hours to a few seconds, depending on the version of the algorithm and the scheduling problem, but the insolvable conflicts are removed by hand before the heuristics methods.
In our problem, each train has three or more routing possibilities. Considering the computational complexity, we solve the routing problem with the fixed arrival and leaving time in order to meet the real-time occasion. The arrival and leaving times are given by the network timetable or predicted by the current traffic. The conflicting trains are pointed out with the cause analysis.
The rest of the paper is organized as follows. This paper starts with the formalization of railway station layout and trains’ activities. We analyze the difference and relation between the network and station timetable. An integer linear programming model is described in section 3. The calculation process is introduced in section 4. In section 5, our method is tested on real cases in complex station which receives always the overload of trains’ activities. In section 6, we give a conclusion and discuss further developments and application of the methodology.
General description of the problem
This train routing and platforming problem faced by railway station managers is to generate a conflict-free timetable including train operations and shunting operations. The train routing and platforming problem in railway station studied in this paper can be described as following. Given layout of station, arrival and departure times as well as destination and origin of trains, we aim to route all trains through the station. This timetable must ensure that there are no pair of conflicting trains over routes and tracks, while allowing the coupling and uncoupling operations on tracks and respecting their tracks preferences and the accessibility of complete route of trains. This problem includes three sub-problems: routing, platforming and feasibility-checking.
Station layout
A standard station, as shown in Fig. 1, consists of signals, sections, switches and tracks next to a platform.
Sets and Objects in a station are classified in Table 1.

A standard station layout.
Sets and Objects in a station
A Train enters or leaves a railway station by a section. Both block sections and shunting tracks act as sections. A block section connects other railway stations. Used for coupling or uncoupling trains, a shunting track connects with shunting yards. Each section corresponds to a travelling direction. The railway network outside the sections is not relevant for our problem.
A Train enters by an inbound route and stops on a track to finish the planned train operations. Then it leaves by an outbound route. If the train arrives at the final station, shunting routes are used to deliver the train back to the garage. If the train departs from the original station, shunting routes are used to deliver the train to the track. Shunting routes are also used for the coupling or uncoupling operation. In practice, inbound route including switches and a track. In our model, a route only includes switches. Each route category is given an example in Table 2. Routes are named by the relevant signals.
Routes category
An inbound route includes a sequence of switches connecting a section to a track. In the opposite direction, an out bound route includes a sequence of switches connecting a track to a section. A complete route includes an inbound route, a track and an outbound route. The set of routes is denoted as P. Routes connecting the track l i with the section l e are classified in the set P(l i ,l e ).
The traffic in the railway station is defined by a set of trains T. Every train t ∈ T consists of a set of ordered movements M
t
and a set of ordered operations O
t
. The index represents the chronological order, for example,
Train activities and resource demand
Train activities and resource demand
As soon as an inbound route is prepared for the train, its route and track assignment cannot be changed anymore. So the train set has two parts: Trains with fixed route and track assignment, denoted as T
assigned
. Relevant movements classified in the set M
assigned
. New arrival trains with flexible route and track assignment, denoted as T
new
. Relevant movements classified in the set M
new
.
So we have
Movements from or to the same section l
e
are classified in the set M
l
e
. Routes selectable for movement m are classified in the set P
m
. P
m
is the set of routes for the movement m, i.e. the set of routes connecting the section
The routing problem is to assign each train to a complete route through the railway station. The same switch or track cannot be occupied by two trains at the same time. In practice, a switch is occupied from the preparation of the relevant route until the release time.
When the train arrives at the section, it reserves an inbound route leading to a track. As the train runs along the inbound route, the switches comprising the route are released sequentially. The safety rules dictate that any switches can be reserved by only one train at a time. In that case, another train cannot reserve the same switch until it is released. In principle, the reservation duration of a switch can be calculated by the length and speed of train. But the tightness of the resource distribution will easily led to interruptions of movement even collision of trains by any small perturbation. To reduce the risk, all switches in the inbound route are reserved until the train releases the route. Similarly, all switches of an outbound route are reserved until the train releases the route.
One track can be reserved by only one train at a time. Tracks are reserved from the beginning of the inbound movement until the end of the outbound movement. During standstill on a track between these movements, a minimum customer service time must be given to passengers to board or take off trains, or to transfer between trains. In addition, preferences of tracks and constraints on coupling and uncoupling of trains need also to be taken into account.
To assign a track to a train, we need consider both length and direction of trains. We need to pre-calculate
Feasibility-checking
On real-time occasion, traffic disturbance changes the arrival time of trains. Equipment failure and maintenance change the station layout. The station timetable should update according to the current occasion. So there are four occasions to regenerate the station timetable: hen a train arrives, the arrival time is different from the planned time When a train departs, the departure time is different from the planned time A new maintenance plan is delivered An equipment breakdowns or gets back to normal. If a switch is breakdown, all the relevant routes are unavailable.
Network timetable & station timetable
In network timetable, the arrival time is the time at which the train stops at a track. The departure time of a train is the time at which the train starts to leave the track. As described at the beginning of this section, the arrival or departure time of trains are generated by administrative levels and railway station manager. The time unit is minutes. In practice, the occupation of tracks in network timetable is always shorter than real occupation duration in station timetable. The occupation duration
As shown in Fig. 3, track occupation in station consists of three parts:

Network timetable.

Occupation of track in station timetable.
Part 1: As soon as the inbound route Part 2: The occupation duration of part 2 is same as defined in network timetable. Part 3: When trains start to leave the station, trains need to firstly leave the track. So during part 3, trains occupy both of tracks and outbound routes.
In our problem, we define the track occupation time [A
t
, B
t
[as below:
α m is predicted according to the current traffic.
In this section, we start to formalize the routing and platforming problem and establish an ILP model.
Notation: Sets and parameters
Set of sections Set of tracks Set of tracks accessible to the sections l
e
Set of tracks in preference order of train t Set of switches Set of routes Set of routes selectable for movement m. Set of routes connecting track l
i
with Sections l
e
Set of trains Set of trains with fixed routes and tracks assignment Set of new arrival trains with flexible route and track assignment Set of movements Set of movements with fixed routes assignment Set of movements with flexible route assignment Set of movements in chronological order of train t Set of movements entering or leaving station from block section l
e
Occupation duration of routes for movement m. Occupation duration of track for train t. Pair of conflicting routes. If p∩ p′ ≠ ø, Yp,p′ = 1. Otherwise 0. Pair of potential conflicting movements. If [ Otherwise 0. Pairs of potential conflicting trains. If [ [ Otherwise 0. Fixed track assignment of trains. ∀t ∈ T
assign
. If the track l
i
is assigned to the train t, Fixed route assignment of movements ∀ m ∈ M
assign
. If the route p is assigned to the movement m,
ILP model
The optimization problem is formulated in Eqs. (1)–(8). The objective function is to minimize the number of conflicting trains, as expressed in (1).
3.2. Variables
Track assignment of a train ∀t ∈ T
new
If the track l
i
is assigned to the train t, Route assignment of a movement. ∀m ∈ M
new
. If the route p is assigned to the movement m, Otherwise, 0. Cancellation decision of a movement. ∀m ∈ M
new
. If m is cancelled, Otherwise 0. Cancellation decision of a train. ∀t ∈ T
new
If t is cancelled, Otherwise 0.
Constraint (2) confirms the consistency of cancellation decisions between owner train and its movements. Constraint (3) assures that each train t is only assigned once to a track from its preference set. Similarly, constraints (4) ensure that at most one route is selected for each movement from its set of available routes. Constraint (5) addresses the connection between choice of routes for a movement and choice of track for its owner train t. The track
This section introduces the calculation process, as shown in Fig 4, to solve the real-time routing and platforming problem. The inputs are station timetable, station layout, arrival and departure time.
The process has three steps: Update sets and parameters according to the current traffic and station layout. Check the feasibility of station timetable before preparing an inbound route for a new train.. If conflicts are detected, solve an optimal station timetable with routes and track assignment.

Calculation process.
The station layout considered in our problem is dynamic. If equipment is breakdown or back to normal, the sets of tracks, routes, switches are recalculated. When a new skylight is delivered, relevant tracks and switches cannot be used during skylight. The station layout should be updated.
When a train nearly arrives at the station, the arrival time is update according to the distance and speed curve. The train is a new train with flexible route and track assignment, t ∈ T new . While the inbound route is prepared for it, the train is no more a new train but a train with fixed route and track assignment, t ∈ T assign .
For the trains on track, we update the departure time according to the process of train operations on tracks.
In our method, the station dispatcher set the problem scale. We could solve the routing and platforming problem in a whole day or within three hours. The problem scale define the train and movement set T and M.
The dynamical sets and parameters are summarized in Table 4.
Sets and parameters update occasion
Sets and parameters update occasion
While preparing an inbound route for a new train, the feasibility of current station timetable is rechecked. In the ILP model, all trains and movements have the fixed assignment of tracks and routs. Only the cancellation decisions of new trains are variables. If conflicts are detected in the station timetable, we go to the step III to reschedule the station timetable.
Step III: Generation of an optimal station timetable
By solving ILP model, the station timetable is rescheduled to the optimal solution. If the station timetable is feasible without conflicting trains, we update the current station timetable. If the optimal station timetable is still infeasible, the conflicting trains are pointed out.
Computational results
The experimental instances are generated based on the full-day timetable within real-world railway station which receives always the overload of trains’ activities. Set of tracks in preference order of trains are calculated with three different lengths (short, medium, long) and 16 types of trains which are described in terms of their directions and characters. As shown in Fig. 5, this station has 16 tracks, 10 sections and 144 routes.

Topology of railway station.
Our resolution methods are implemented in commercial solver CPLEX C++ version12.6 to solve the integer linear programming model. The computation time is calculated in CPU seconds on this testing computer. Computational experiments have been conducted on a 64 bits computer under Linux with Intel i5-2520M CPU at 2.5 GHz and 8GB memory RAM.
This method is tested on 320 instances. We randomly choose a group of successive trains in a real timetable. The 320 instances include 16 different scenarios from 5 to 249 trains. The first column in Table 5 indicates the number of trains in each scenario. We generate 20 test cases for each scenario. From the second column GAP, we can see that all cased are solved to the optimal solution. The third column is the average number of conflicting trains. The infeasible cases can be handled. The average computational time of each scenario is resumed in the last column. The full-day problems of 249 trains are solved in 1.26 s. The efficiency of this method meets the time-critical nature of RT-TRPP.
Computational results
As described in Reference [5], if the layout of the railway station is fixed, then the safety optimization problem can be solved by a dynamic programming approach in an amount of time that is polynomial in the number of trains. In our problem, the layout of the railway station is dynamic. We divide and conquer the problem by three steps: Update station layout. Check feasibility. Generate an optimal station timetable.
The dynamic station layout is updated in the first step. In the following step, the station layout is fixed. As shown in Fig. 6, the computation time is polynomial in the number of trains.

Computational results.
If the current station receiving ability meets the traffic situation, our method provides an optimal routes and tracks assignment on real-time. If the station receives the overload of trains’ activities, our method points out the conflicting trains. Station dispatchers focus on solving the conflicting trains.
This paper deals with real-time trains routing and platforming problem faced by railway station manager to check the feasibility of station operating plan. The infeasibility is caused by the unreliable arrival times of freight trains, flexible shunting operations and dynamic station layout caused by equipment failure. Our goal is to maximize the number of trains passing through railway stations. If the conflicts are solvable, an optimal track and route assignment is given in a rather short time. If the conflicts are unsolvable, the conflicting trains are pointed out in order to ensure the rest of trains passing through stations on time. Station dispatchers concentrate on rescheduling the conflicting trains. An integer linear programming model is proposed to formalize this problem. A dynamic calculation process is designed to meet the real-time occasion. Computational results on different sizes of problem show that the optimal decision can be found in rather a short time. This method can be used both of on-line and off-line occasion to check the feasibility of station timetable.
In future works, we try to insert the conflicting trains into the station timetable. The rescheduling methods need to be explored.
Footnotes
Acknowledgments
This work was supported by the China Railway Joint Funds of the National Natural Science Foundation of China (Grant no. U1834211) and Science Foundation for Key Scientific research project of CARS (Grant no. 2020YJ040).
