Optimization in Railway Scheduling
Optimization in Railway Scheduling
Abstract: Train scheduling has been a significant issue in the railway industry. Over the last few years, numerous ap-
proaches and tools have been developed to aid in the management of railway infrastructure. In this paper, we
describe some techniques, which was developed in a project in collaboration with the Spanish Railway In-
fractructure Manager (ADIF). We formulate train scheduling as constraint optimization problems and present
two filtering techniques for these problem types. These filtering techniques are developed to speed up and
direct the search towards suboptimal solutions in periodic train scheduling problems. The feasibility of our
problem-oriented techniques are confirmed with experimentation using real-life data. The results show that
these techniques enables MIP solvers such as LINGO and ILOG Concert Technology (CPLEX⃝ c
) to terminate
earlier with good solutions.
3. Topological railway infrastructure and type of straints are composed by the parameters defined by
trains to be scheduled give rise other constraints to user interfaces and database accesses.
be taken into account. Some of them are: The formal mathematical model is presented in Ta-
ble 1. Let’s suppose a railway network with r sta-
• Number of tracks in stations (to perform techni-
tions, n trains running in the down direction, and m
cal and/or commercial operations) and the num-INFORM
and a high number of variables only take integer val- problem maintains n ∗ m ∗ r integer variables (Y ′ s)
ues. As is well known, this type of model is far more and n ∗ m integer variables (X ′ s). A railway net-
difficult to solve than linear programming models. work with 100 stations and 100 trains going in each
Our filtering techniques work on the binary variables. direction generates 1.01x106 integer variables. This
These variables are grouped into two sets: technique may significantly reduce the problem size
• Variables Y ′ s. A variable Yi,j,k determines the with a reasonable maximum slack (α ≈ 20%) (given
track between station k and station k + 1 in which by railway operator).
train i crosses with train j. If Yi,j,h−1 = 1 for
h ≤ k and Yi,j,p = 0 for p ≥ k then, the crossing Theorem 2. Filtering technique 1 is sound and
between train i and train j is carried out in station complete.
k. Proof. Soundness. Filtering technique 1 is sound
due to the fact that the set of solutions given by Ta-
• Variables X ′ s. A variable Xi,j determines which ble 1 subsumes the set of solutions obtained by filter-
train (i or j) arrives earlier to the crossing station. ing technique 1. This is because it has removed a set
If Xi,j = 0 train i arrives at the crossing station of binary variables and the constraints in which these
first and train j arrives at the same station later. variables are involved.
Completeness. Filtering technique 1 does not re-
3.1 Filtering Technique 1 move any solution. Thus, this technique will find the
same solution as the one obtained by Table 1. Con-
This technique carries out a filtering over the set of straints of type (5) make the set the of removed con-
constraints from the formal mathematical model pre- straints redundant by filtering technique 1. By contra-
sented in Table 1. Many constraints of type (6) (7) and diction, we assume that there is a solution that filter-
(8) can be removed according to their departure times ing technique 1 does not find. Without loss of gener-
and maximum slacks. If a train going in the down di- ality, we assume a maximum slack of 20%. We can
rection arrives at the destination before a train going distinguish two different cases. (1) The lost solution
in the up direction departs, then both trains will not falls into the maximum slack. This os a contradiction
cross each other. Thus, a huge number of constraints because, under this threshold, the restricted problem
and integer variables we can eliminated. The original is the same as Table 1. (2) The lost solution falls out-
side the maximum slack. This solution is not valid
because it does not satisfy constraints (5.1) and (5.2). Table 2: Pseudo-code of filtering technique 2.
Therefore, filtering technique 1 does not lose any so-
lution.
Filtering technique 2
3.2 Filtering technique 2 { /*Limit the stations where two trains can be crossed,
i.e., the number of integer variables*/
Filtering technique 2 is a metaheuristic based on Fil- DeterminePossibleCrossing();
tering technique 1. This technique carries out a LinearSolution=SolveLinearProblem();
guided local search over the binary variables. Once Crossings=DetectCrossings(LinearSolution);
many integer variables have been removed by filter- n=0;
ing technique 1, a new filtering process on the re- while(Not Solution) {
Solution=SearchCrossCombination(window,Crossings);
duced problem can eliminate other integer variables
n++;
by means of a guided local search. Instead of assign- }
ing a random station as a crossing station between if (Solution)
two opposite trains, filtering technique 2 performs a FinalSolution=SolveCrossingOrder(Solution);
linearized execution where the integer variables have }
been transformed into continues ones. Thus, the
crossing between two trains may not be assigned in
stations but on a track between two stations. This will
be the initial point to start the search to find the sta-
tion where the crossing will finally be performed. The this information. With the data acquired from the
search of each crossing between two opposite trains is database, the system generates the formal mathemati-
bounded by 2n + 1 contiguous tracks. This interval cal model.
is composed by n tracks located before the obtained According to the quality of the required solution
crossing and n tracks located after the crossing. In and the problem size, a filtering technique will be ex-
this way, the resultant subproblem can be seen as a ecuted by one of the following ways:
combinatorial problem, where all combinations must 1. Complete: The process is performed taking into ac-
be performed for guarantee the best possible solution. count the entire problem. This decision is carried
If the problem has a solution, filtering technique 2 out when the number of trains and stations is low
studies the arrival order to the crossing station such or the running time is not a important. In this case,
as the objective function is minimized. Otherwise, filtering technique 1 will be selected.
the interval is increased (n + +) and the MIP prob-
2. Incremental: The process performs an incremental
lem is again solved. This technique is useful in any-
coordination of trains. It can be useful in anytime
time environment due to a solution can be found, but
systems, where the number of trains and stations
filtering technique 2 tries to find a better solution in
is not very high. In this case, filtering technique
the remaining time. To this end, each combination is
1 and 2 are appropriate due to the fact that as the
labelled with the solution obtained and the filtering
number of combinations are checked, the quality
technique searches neighbor combination in order to
of the solution is better.
improve the objective function.
Once the problem has been filtered, the optimiza-
tion process will be executed for obtaining an opti-
mal solution of the simplified problem. To this end,
4 GENERAL SYSTEM CPLEX and LINGO are executed for obtaining the
ARCHITECTURE optimal solution.
However, the system can also automatically recom-
The general outline of our system is presented in mend or select the appropriate choice depending on
Figure 2. It shows several steps, some of which re- main parameters and the complexity of the problem.
quire the direct interaction with the human user to If the mathematical model is not feasible, the user
insert requirement parameters, parameterize the con- must modify the parameters, mainly the most restric-
straint solver for optimization, or modify a given tive ones. If the running map is consistent, the graphic
schedule. First of all, the user should require the pa- interface plots the scheduling. Afterwards, the user
rameters of the railway network and the train type can graphically interact with the scheduling to mod-
from the central database (Figure 2). ify the arrival or departure times. Each interaction
This database stores the set of locations, lines, is automatically checked by the constraint checker in
tracks, trains, etc. Normally, this information does order to guarantee the consistency of changes. The
not change, but authorized users may desire to change user can finally print out the scheduling, to obtain re-
Figure 2: General scheme of our tool.
performance when this parameter increases. It must ney time in problems where the number of stations
be taken into account that running time of the form was increased from 10 to 60, and the number of trains
”> xh.” represents that the problem did not finish in and the frequency were set at 10 and 90, respectively:
x hours and the best solution found up to date is pre- < 10, s, 90 >. In this case, only stations were in-
sented in the journey time column. All running times cluded to analyze the behavior of the techniques. It
in Table 3 represent the running times of the filtering can be observed that Filtering technique 2 was bet-
techniques plus the running times of the optimization ter than Filtering technique 1 obtaining optimal solu-
techniques (CPLEX or LINGO). tions for 10 and 20 stations in lower time. Eve for
In Table 3 (a), we present the running time and the 30 stations Filtering technique 2 had better behaviour
journey time in problems where the number of trains than Filtering technique 1 (complete algorithm). It
was increased from 5 to 75, and the number of sta- is important to note the difference between the in-
tions/halts and the frequency were set at 40 and 90, stance < 10, 40, 90 > of the Table 3 (a) and the in-
respectively: < n, 40, 90 >. The results show as the stance < 10, 40, 90 > in Table 3 (b). They repre-
number of trains increased the running time of Filter- sent the same instance; however in Table 3 (b) we
ing technique 1 and 2 was worse. Filtering technique only used stations (no halts), so the number of pos-
1 obtained the optimal solution for 5,10,15 and 20 sible crossing between trains was much larger (more
trains. However for 50 and 75 trains, Filtering tech- integer variables). This item reduced the journey time
nique 1 was aborted in 5 hours while Filtering tech- from 2:20:19 to 2:20:10, using Filtering technique 1
nique 2 finished although with worse solutions. Fig- and from 2:26:04 to 2:23:36, using CPLEX and Filter-
ure 3 shows the system interface executing our Fil- ing technique 2. Nevertheless, the running time also
tering technique 2 with the instance < 10, 40, 90 >. increased from 337” to 2131 in Filtering technique 1
The first window shows the user parameters, the sec- and from 8” to 56” in Filtering technique 2, due to the
ond window presents the best solution obtained at that number of integer variables was much larger.
point, the third window presents data about the best In Table 3 (c), we present the running time and the
solution found, and finally the last window shows the journey time in problems where the frequency was de-
obtained running map. creased from 140 to 60 and the number of trains and
Table 3 (b) shows the running time and the jour- the number of stations were set at 20 and 40, respec-
Table 3: Running time and journey time in different problem instances.
CPLEX LINGO
(a) < n,40,90> Filtering technique 1 Filtering technique 2 Filtering technique 2
Trains running time journey running time journey running time journey
time time time
5 6” 2:19:48 4” 2:29:33 6” 2:30:54
10 337” 2:20:19 8” 2:22:08 12” 2:31:37
15 601” 2:20:29 12” 2:26:18 19” 2:31:51
20 1065” 2:20:34 16” 2:26:25 25” 2:31:58
50 > 5h. 2:20:43 43” 2:31:09 1098” 2:32:11
75 > 5h. 2:22:04 > 1h. 2:32:14 1590” 2:32:14
(b) <10,s,90>
10 3” 0:25:06 2” 0:25:06 4” 0:25:06
20 303” 1:04:11 5” 1:04:11 8” 1:04:11
30 > 1h. 1:45:38 6” 1:45:08 14” 1:45:38
40 2131” 2:20:10 56” 2:23:36 21” 2:24:36
60 > 3h. 3:33:15 217” 3:39:30 180” 3:40:30
(c) <20,40,f >
140 15” 2:16:19 15” 2:20:18 24” 2:16:19
120 156” 2:16:17 14” 2:16:17 23” 2:18:47
100 > 5h. 2:22:55 15” 2:23:10 28” 2:22:55
90 1065” 2:20:34 15” 2:26:25 28” 2:31:58
75 > 1h. 2:29:18 > 1h. - 25” 2:24:16
60 > 1h. 2:21:23 > 1h. - > 1h. -