Movement Planner Algorithm For Optimal Railway Scheduling On Multi-Track Territories
Movement Planner Algorithm For Optimal Railway Scheduling On Multi-Track Territories
Movement Planner Algorithm For Optimal Railway Scheduling On Multi-Track Territories
Multi-Track Territories
Team : Xyon
Pushkar Godbole
4th year UG Aerospace Engineer
Department of Aerospace Engineering
Indian Institute of Technology Bombay
1. Introduction
The solution proposed is a 3 stage-stage approach : The first stage involves intelligent greedy routing of the
given trains. The second stage consists of MIP based optimal scheduling of the above routed trains. The third
stage imposes an iterative path swapping and optimal scheduling heuristic to improve the solution. Additionally,
to augment scalability the above 3-stage approach is nested inside a sub-problem generation block to deal with
large problem sizes.
Sub-problem generation
Greedy routing
Optimal scheduling
Iterative
improvement
Figure 1 : Overall solution approach
2. Train Routing
All the territory and train data from the input file is read into suitable data-structures. Train routing is then
achieved in the following manner.
Map generation
Trainwise Route
generation
Trainwise Route
selection
It would be very inefficient for a train to take more than 1 siding in its entire travel. Hence to eliminate this
inefficiency and to reduce the size of the path pool, all paths with multiple sidings are eliminated.
Then, all the filtered paths with appropriate origin-destination pair are inserted into the path pools of the
corresponding trains. After all paths have been inserted trainwise, following check is performed for each
train :
If the train carries Hazardous materials, all paths with sidings are eliminated
If the train length exceeds a siding length, all paths containing that siding are eliminated
All paths missing a scheduled arrival node of the train are eliminated
The new filtered path pools for each train are then doubly sorted first w.r.t. to Un-preferred track usage
and then internally w.r.t. the total number of sidings+crossovers in the path, using merge-sort. For example,
for a train with the following paths, the sorted path pool will be :
Path 1 Un-preferred track usage = No Sidings = 0 Crossovers = 0
Path 2 Un-preferred track usage = No Sidings = 1 Crossovers = 0
Path 3 Un-preferred track usage = Yes Sidings = 0 Crossovers = 1
Path 4 Un-preferred track usage = Yes Sidings = 1 Crossovers = 1
Once the individual path pools for all trains are sorted, the trains are then triply sorted first w.r.t. Tons per
operative brake exceeding 100 and then internally w.r.t. the train type (A/B/C/D/E/F in that order) and
finally w.r.t. train entry time.
For example, for the following 6 trains, the sorting will be :
B3 TOB = 125 ( > 100) Train type = B Entry time = 500sec
A2 TOB = 75 ( < 100) Train type = A Entry time = 0sec
A1 TOB = 75 ( < 100) Train type = A Entry time = 200sec
B1 TOB = 75 ( < 100) Train type = B Entry time = 100sec
B2 TOB = 75 ( < 100) Train type = B Entry time = 400sec
C1 TOB = 80 ( < 100) Train type = C Entry time = 0sec
With the pathwise and trainwise sorting done, the trains are now assigned paths in the aforementioned
sorted order.
At every step of the assignment, the assigned path is marked as taken and cannot be taken by any other
train later except TOB > 100 trains. This is facilitated by recording the unique path-id corresponding to that
path after every assignment.
The TOB > 100 trains are invariably assigned their first path i.e. the path without any siding/crossover.
The subsequent trains are assigned the first un-assigned path in their path pools.
Thus, the priority (SA and TOB > 100) trains tend to be assigned better paths over the low priority trains.
Amongst the same type trains, trains with earlier entry time tend to be assigned better paths.
tpq : Entry time of train no. p in the node no. q of its path, node no. 1 being its origin
N : Total number of trains in consideration for the MIP
p (1,N) (1)
Scheduling start horizon is 0 for the first sub-problem and end time of the preceding sub-problem for
subsequent sub-problems.
(2a)
or
(2b)
req_tpq : Minimum time required for train p to traverse arc q. Note that the number of arcs is 1 less than the
number of tps.
Now, every equality constraint reduces the number of t variables by 1.
3.3. MOW constraint
If arc q of train p is same as arc of mowi :
- mow_xi M + tpq mow_starttimei
(3a)
(1 - mow_xi ) M + tpq mow_endtimei (3b)
mow_xi {0,1}
M is a very large number here taken as 100000
3.4. Non-concurrency/Headway constraint
The non-concurrency constraint is just a subset of headway constraint. Implementing the headway constraint
will automatically take care of the non-concurrency constraint.
x : Headway precedence decision variable
3.4.1. Primary headway constraint
(5a)
(5b)
(6a)
(6b)
(7a)
(7b)
(8)
twt_xupq {0,1}
- hor_xpq M + twtupq 0
- (1- hor_xpq ) M + twtu_horslackpq 0
(12i)
(12j)
(13a)
(13b)
(13c)
(13d)
(13e)
(13f)
(13g)
(13h)
(13i)
(13j)
4. Iterative improvement
The redundant solution found in the previous block is iteratively improved in this block. This is done by randomly
swapping two paths amongst trains and checking for improvement.
The process followed is :
Randomly choose 2 trains
Check if their paths can be swapped by looking for train 2s path id in the path pool of train 1 and vice-versa.
Once found check if the newly generated combination of train paths has already been explored
Continue this process until a new combination of train paths is found or the upper-bound on the number of
search iterations is reached
Once found, this new train path combination is again optimized by the MIP optimizer. If the cost given by this
combination is less than the previous best redundant solution, the MIP optimizer is again run on the concise
(without redundant sidings) counterpart of the combination. If this solution is better than the previous best concise
solution, it is accepted and the output to the terminal.
This process is continued until an upper bound on the number of iterations or possible combinations is reached.
The script may require editing to change the address of the cplex libraries. Compilation will generate an
executable shell file named ras_main.
On execution, the code asks for an input file. The input file name should be devoid of spaces.
For example, to execute the program for DATASET 1, the file name and hence the input argument must be :
RAS_DATASET1.txt. An output text file in xml format with OUTPUT appended at end of its name would be
generated. The input file needs to be placed in the same directory as the ras_main file.
The computational results have been summarized in the following table :
Problem
set
Chunk
size
Number of
sub-problems
Final Cost
First solution
(solution to
sub-problem 1)
Run time
0.13sec
Cost of
first solution
(solution to
sub-problem 1)
762.68 $
Toy
12
example
Data set 1 12
Data set 2 13
762.68 $
1
2
Data set 3 14
1967.29 $
4108.95 + 8400 =
12508.95 $
3770.51 + 9600 =
13370.51 $
290 sec
265 sec
3215.94 $
4108.95 $
11 mins
21 mins
250 sec
3770.51 $
20 mins
0.13 sec
7. Concluding remarks
While designing the algorithm, closer attention has been paid to maintaining a balance between scalability and
solution quality. It was observed that maintaining the linearity of the MIP substantially speeds up the process. The
iterative improvement block introduces some amount of explorability in the algorithm over the initial greedy
routing. The sub-problem generation is implemented to take care of the cost intensive trains first holding the low
priority trains for later.