An Intelligent Search Technique For Solving Train Scheduling Problems: Simulated Annealing and Constraint Satisfaction
An Intelligent Search Technique For Solving Train Scheduling Problems: Simulated Annealing and Constraint Satisfaction
An Intelligent Search Technique For Solving Train Scheduling Problems: Simulated Annealing and Constraint Satisfaction
5, pp 442{449
c Sharif University of Technology, October 2007
An Intelligent Search Technique for Solving Train Scheduling Problems: Simulated Annealing and Constraint Satisfaction
M.T. Isaai
1
This paper presents a hybrid scheduling technique for generating the predictive schedules of passenger trains. The algorithm, which represents a combination of simulated annealing and a constraint-based heuristic, has been designed using an object-oriented methodology and is suitable for a primarily single-track railway with some double-track sections. The search process gets started from a good initial solution created by the scheduling heuristic and continues, according to the simulated annealing search control strategy. The heuristic is also used in the neighborhood exploration process. This hybrid approach solves the problem in a short span of time. Simulation experiments, with the real data of manual timetables and two corridors of Iran's railway, show the superiority of the hybrid method to the heuristic designed and the manual system, in terms of the three performance measures used.
INTRODUCTION
The planning of train schedules, which is a crucial task in rail operations planning, is an optimization problem and its complexity has been addressed in various publications. For a single-line network, one solution methodology is to resolve the set of existing con icts on allocating track sections to the competing trains. It can be shown that the size of solution space grows exponentially as the number of con icts increase 1]. To resolve a con ict which involves two trains, either of the two may get precedence. Accordingly, for a problem including n con icts, the number of solution possibilities is 2 . Traditionally, train scheduling experts manually construct the timetables using a distance-time graph, which shows the progress of any train toward its destination with respect to time. It also represents the potential train con icts and possible decisions. To facilitate the scheduling process and to increase nancial returns from huge investments made in the rail industry, various classes of the problem have been investigated and a number of practical decision support systems have been developed and used in real environments. The goal of such systems would be to create appropriate timetables, investigate the robustness of
n
1. Graduate School of Management and Economics, Sharif University of Technology, Tehran, I.R. Iran.
schedules in the presence of unforeseen events and to analyze the capacity of the network with reference to a given transport demand. The simulation approach appears to have caught the attention of researchers and service-planning professionals extensively and has been embraced relatively well by the industry. A few simulation tools have been developed and used in practice. For example, VISION, SIMON, SIMU-PLAN and CAPTURE/PROVING 2-5] have been used for timetabling, TTS and LCAS 6,7] for capacity analysis and Dispatch Analysis Model 8] for both purposes. A general modeling framework has been proposed in 9] for use in simulating rail operations. The complexity of the problem and the possibility of simulating detailed aspects of the problem have contributed to the invention and use of train dispatching rules. The train scheduling problems have also been formulated using analytical or OR-based techniques, including (non-) linear (mixed) integer programming 1012] and network optimization models 13,14]. Amongst the solution techniques developed to solve the problem are branch & bound 1], heuristics 15], Lagrangian relaxation 12] and the shortest path method 11, 13]. OR-based solution techniques have provided valuable insights into the problems. However, few models have solved `real-life' problems 9] and succeeded in practice. The reasons could be in the simpli ed assumptions, the long computing time required and the di culties in including the domain's knowledge. Promising
Solving Train Scheduling Problems works in the eld of arti cial intelligence encourage further research in the eld to solve the problem more e ciently. Examples are the works of 16,17] in the eld of knowledge-based systems and 18] in constraint satisfaction methods. Additionally, AIbased search techniques have been developed by 19-21] and the combinations of knowledge-based techniques with simulation and OR-based methods are presented in 22,23]. This paper presents a hybrid train scheduling algorithm, HeuSA, which is a combination of a simulated annealing control strategy and the constraint-based heuristic introduced in 20]. The hybrid model is tested using the data of manually created timetables and the rail network of Iran. The goal is to nd appropriate solutions in a short span of time through starting the search process from a good solution and reducing the likelihood of being trapped in local optima. In addition, new performance measures can easily be used with the model. In the remainder of the paper, rst, the problem at hand is represented and brief discussions on simulated annealing and constraint propagation is provided. Then, insights into the hybrid algorithm developed are provided and simulation results are presented. Finally, concluding remarks are provided.
443 variables associated with a train are departure times at the origin and en route stations and arrival times at the destination and en route stations. Thus, stop time at each station is taken as a dependent variable with a value equal to, or greater than, a minimum time planned. The problem constraints are, as follows: 1. For each train, t, traveling between two adjacent stations, namely from s to s + 1: Arrival +1 Departure = Running time +1 : (1) 2. For each train, t, at each station, s, en route: Planned stop time : Arrival Departure (2) Planned stop time is a constant greater than, or equal to, zero. 3. For any pair of trains, t1 and t2, traveling in the same direction, either on a single or double-line track (Figure 1: a, b, c) from station s to its immediate adjacent station, s + 1: Departure 1 Arrival 2 +1 0; or: Departure 2 Arrival 1 +1 0: (3) For any pair of opposite trains, t1 and t2, traveling on a single-line track between immediate adjacent stations, s and s +1, if t1 is traveling from s to s +1 (and t2 from s + 1 to s): Departure 1 Arrival 2 Safety interval; or: Departure 2 +1 Arrival 1 +1 Safety interval; (4) where the safety interval is the time interval between consecutive occupation of a single-line track by opposite trains (in this model, safety interval = 1 minute) (Figure 1: d, e and f).
t;s t;s s;s t;s t;s t;s t ;s t ;s t ;s t ;s t ;s t ;s t ;s t ;s
PROBLEM REPRESENTATION
The problem consists of generating a predictive schedule for a set of passenger trains traveling on a primarily single-line railway that includes some double-line sections, using Iran's rail network and train data. For any train being considered, the following data is speci ed by experts: Ready time for boarding at the origin station, minimum stop time considered for reasons such as boarding and alighting at the origin and any intermediate station and point-to-point running time on the track between two adjacent stations, called a block. Data of train operations in the past can be used to work out the above train attributes. Decision
Figure 1. A distance-time graph for two trains traveling in the same direction in three situations: (a) A resource con ict exists; (b and c) The con ict is resolved using one of the above constraints; (d, e and f) Similar graphs have been drawn for opposite trains. In this type of graph, consecutive departure and arrival times of each train are connected by a line to represent train movements and stops.
M.T. Isaai Therefore, each train can be assigned a weight and the objective of a scheduling system may be to reduce the SWWT, as represented below: Trains X Minimize =1
i
(5)
The following safety constraints are added to eliminate the possibility of collisions at stations. These constraints ensure that two opposite trains, t1 and t2, approaching do not enter station s simultaneously. Arrival 1 or: Arrival 2
t ;s
Weight
Stations
t ;s
(6)
5. Each station can accommodate trains using two kinds of track, i.e., platforms and non-platforms; passenger trains stopping for boarding and alighting are planned to use platforms for the comfort of passengers and trains stopping for other reasons are routed to other lines. However, generating a tight schedule for a set of long-distance trains on a single-line railway may make the violation of such a rule inevitable, let alone the consequences of any unforeseen events in real life. For any station with p platform and n non-platform lines at any point in time, , within the scheduling horizon: The no. of trains stopped on platforms p; The no. of trains stopped on non-platforms n: (7) In cases where the above line assignment rule has to be overridden, the total number of trains stopped must be less than, or equal to, p + n. The de nition of a performance measure (mathematical objective function) can help measure the quality of any solution and compare solutions generated by di erent scheduling methods. Such measures are also used for directing moves across solution space looking for higher quality solutions. In this work, the term \imposed waiting time" is used to refer to a delay imposed on a train at a station, due to the occupation of the requested section of main line by another train. When departure time at the origin and running time on the track are predetermined, the scheduling aim could be to distribute the imposed waiting time amongst involved trains, with respect to an appropriate criterion. In this paper, SWWT, AUWT and MRWJ measures are used.
"
1# Waiting time Stations P Planned stop A : Running time + Stations Tracks The drawback of AUWT is the possibility of generating very good schedules for most trains at the expense of generating very bad schedules for a few others.
MRWJ (Maximum Ratio of Waiting Time to Journey Duration)
MRWJ is better when allocating the same amount of waiting time to a long-distance train, where a shortdistance train is undesirable and the problem includes both types of train. MRWJ is represented as: min maxTrains
0 @ P
"
1# Waiting time Stations P Planned stop A : Running time + Stations Tracks For a given schedule, the lower the maximum ratio of
0 @ P
Solving Train Scheduling Problems delay to journey duration, the higher the quality of the schedule would be. when T reaches a value close to zero.
445
446 start time gets precedence. In this process, the station capacity constraints are also taken into account. CBH tends to minimize total local waiting time over all trains involved. What is the neighborhood concept of SA in this context? For a given feasible schedule, a neighbor solution is a schedule in which the sequence of occupying a block by two requesting trains with overlapping time intervals is changed, and the destructed part of the schedule resulting from the swap is identi ed and rescheduled using the same heuristic. A move in the neighborhood of a solution is conducted using the following steps: 1. Identifying a potential move randomly, which is a train delayed at a station for another moving train to nish the occupation of the requested block; 2. Swapping the sequence of activities (occupying the block by the two trains competing); the earliest start time of the two activities are updated and constraints are posted for propagation; 3. Propagating constraints to identify the activities whose start times must be updated; this process could reveal violations of the resource constraints for the part of the schedule a ected by the swapping process. (A look-ahead propagation method is used. Further discussions are provided in 20]); 4. Repairing the schedule to modify the earliest start times of the activities a ected by the swap; 5. Evaluating the quality of the new schedule in terms of the performance measure selected; 6. Determining the new current schedule using the
M.T. Isaai simulated annealing move strategy. Checking the threshold to stop the algorithm appropriately. The search process continues as long as T is greater than a limit close to 0. However, the algorithm stops if the number of iterations exceeds a prede ned large number (i.e., 5000 used in this work).
SIMULATION EXPERIMENTS
The passenger trains scheduling model has been tested using the data of two corridors of Iran's railways. Data are working timetables of passenger trains generated by train planning experts for Tehran-Mashad and TehranTabriz, connecting the capital to two major cities in the northeast and northwest of the country, respectively. The two routes are transit lines connecting Turkey in the northwest to Turkmenistan in the Northeast. Five cases have been considered in this work, where a case includes a predictive schedule produced manually for a eet of trains. The schedule speci es origin and destination stations, departure time from the origin, running time between immediate adjacent stations en route and stop time at any station en route for reasons such as boarding, alighting and meeting opposite trains. In practice, the schedule covers about 24 hours and it is repeated daily or weekly. Table 1 shows further details of the cases solved. Tables 2 to 4 compare schedules generated by HeuSA and CBH with manual timetables in terms of SWWT, AUWT and MRWJ. Figures associated with SWWT are in terms of minutes and the gures associated with AUWT and MRWJ have been multiplied by 100 to make them more understandable
Case
P1 P2 P3 P4 P5
Table 1. The speci cations of cases solved by the HeuSA. Route Trains No. of Blocks No. of Up Down Total Single Double Stations
11 8 8 5 8 11 8 9 5 8 22 16 17 10 16 40 47 40 47 36 10 0 10 0 5 51 48 51 48 42
Route KM
926 736 926 736 795
Manual timetable (MT) Constraint-based heuristic (CBH) HeuSA CBH over MT Improvement (%) HeuSA over CBH HeuSA over MT
Case
P4
P5
447
Manual timetable (MT) Constraint-based heuristic (CBH) HeuSA CBH over MT Improvement (%) HeuSA over CBH HeuSA over MT
Case
P4
P5
Manual timetable (MT) Constraint-based heuristic (CBH) HeuSA CBH over MT Improvement (%) HeuSA over CBH HeuSA over MT
Case
P4
P5
in percent. Since random variables are incorporated into the neighborhood exploration, each case is solved using six random generator seeds and the average value is reported for each objective function. Simulation experiments show that all solutions created by CBH and HeuSA are better than the manual ones; however, the degree of improvement varies with case and objective function. Test results for CBH show that SWWT has decreased by between 5.04% and 27.34%, AUWT by between 11.21% and 27.41% and MRWJ by between 1.90% and 21.91%. On average, improvements achieved by HeuSA are between 11.09% and 27.34% for SWWT, 9.42% and 29.36% for AUWT and 4.85% and 28.05% for MRWJ. In three out of thirty experiments ( ve cases, three objective functions, two algorithms, i.e. CBH and HeuSA), HeuSA did not make any improvement over CBH, although solutions were, in terms of objective function value, only slightly di erent. In fact, the probabilistic search process started from a very good solution generated and navigated solution space by CBH and no improvement achieved by SA. SA can be tuned to progress the search process more carefully and for a longer period of time to outperform the CBH. Table 5 shows search e orts made by HeuSA in terms of CPU time and the number of visited solutions, which is represented by the number of iterations. CBH created the initial solution for each case in less than two seconds. Experimental results reveal that between 4.85% and 29.36% improvements have been achieved, whilst consuming 48 to 228 seconds CPU time of a personal computer of type COMPAQ Pentium. The gures in the above tables show that the HeuSA outper-
forms the manual system in terms of the performance measure value and schedule production time. HeuSA also outperforms CBH, since it yields better solutions in 12 out of 15 tests and the gap is very narrow in the three other tests. From a managerial viewpoint, improvements on SWWT, AUWT and MRWJ appear well enough to encourage the use of the scheduling methods presented as the advisory system for the scheduling of passenger trains. As explained previously, key algorithm knobs are T , and . The initial T value in the model is equal to ( f (Q)= log(0:6)), where f (Q) denotes the performance measure associated with the rst solution from where the search started. In fact, the probability of making an uphill move to a solution with f (Q0 ) = 2 f (Q) is set to be 0.60. The above formula is used to limit the search e ort, taking advantage of the high quality of the rst solution created by the heuristic. Another advantage is that the initial T value is automatically calculated for any problem being solved and the performance measure used.
Case P1 P2 P3 P4 P5
448
M.T. Isaai
Table 6. Parameters used to solve P1 to P5. Parameter SWWT AUWT MRWJ Iterations
0.92 1.015 1 0.92 1.02 1 0.91 1.01 1
Table 6 shows the values allocated to and for SWWT, AUWT and MRWJ. Typically, is chosen in a range between 0.90 and 0.99 30]. The initial values of and used to start the experiments for tuning the HeuSA, were 0.95 and 1.05 respectively. The nal values are shown in Table 6. The table also shows the number of iterations for each T during the search process.
CONCLUSIONS
This paper represented a combination of the simulated annealing and a constraint-based heuristic. Starting the search process from a good solution created by the heuristic, the algorithm improved solution quality while avoiding exhaustive search and reducing the possibility of being trapped in local optima. Train scheduling experts were able to run CBH or HeuSA, using the objective function desired. HeuSA was fast enough to encourage users to modify input data to enhance quality. This is the practical advantage of the automated advisory system introduced; this encourages further research to devise interactive intelligent techniques capable of tackling real world problems. Data mining can also be used to extract the knowledge of scheduling experts to create an initial solution of higher quality. In fact, technical experts who create timetables manually may nd it very di cult to explain the heuristics they use or might be reluctant to transfer their expertise; in such cases, existing train schedule databases, created in the past, can be explored using data mining techniques to learn about rules and facts used by experts.
REFERENCES
1. Higgins, A. Kozan, E. and Ferreria, L. \Optimal scheduling of trains on single line track", Transportation Research-B, 30(2), pp 147-161 (1996). 2. Mcguire, M. and Linder, D. \Train simulation on British rail", in Proc. COMPRAIL 94, 2, pp 437-444, Madrid, Spain (Sept. 1994). 3. Backman, J. \Railroad capacity and tra c analysis using SIMON", in Proc. COMPRAIL 96, 1, pp 183192, Berlin, Germany (Aug. 1996). 4. Klahn, V. and Dannenberg, H. \Computer aided construction of timetables on long route sections", in Proc. COMPRAIL 94, 1, pp 27-34, Madrid, Spain (Sept. 1994).
5. Wardrop, A.W. et al. \Timetable capture and train ow modeling", in Proc. COMPRAIL 92, 1, pp 177190, Washington DC, USA (Aug. 1992). 6. Liden, T. \The new train tra c simulation program developed for Banverket and its design", in Proc. COMPRAIL 92, 1, pp 533-544, Washington DC, USA (Aug. 1992). 7. Van Dyke, C.D. and Davis, L.C. \Computer dispatching simulation of high density, mixed freight and passenger train operations", in Proc. COMPRAIL 92, 2, pp 119-130, Washington DC, USA (Aug. 1992). 8. Wolf, G.P. and Baugher, R.W. \Development and application of an advanced microprocessor-based line capacity and train scheduling model", in Proc. COMPRAIL 92, 1, pp 569-588, Washington DC, USA (Aug. 1992). 9. Peterson, E.R. and Taylor, J. \A structured model for rail line simulation and optimization", Transportation Science, 16(2), pp 192-206 (1982). 10. Carey, M. and Lockwood, D. \A model, algorithms and strategy for train pathing", Journal of Operational Research Society, 46(8), pp 988-1005 (1995). 11. Mills, R.G.J. et al. \Dynamic rescheduling of long-haul trains for improved timekeeping and energy conservation", Asia-Paci c Journal of Operational Research, 8, pp 146-165 (1991). 12. Brannlund, U. et al. \Railway timetabling using Lagrangian relaxation", Transportation Science, 32, pp 358-369 (1998). 13. Mees, A.I. \Railway scheduling by network optimization", Mathl. Comput. Modeling, 15(1), pp 33-42 (1991). 14. Goh, C.J. and Mees, A.I. \Optimal control on a graph with application to train scheduling problems", Mathl. Comput. Modeling, 15(2), pp 49-58 (1991). 15. Cai, X. and Goh, C.J. \A fast heuristic for the train scheduling problem", Computers and Operations Research, 21(5), pp 499-510 (1994). 16. Lin, H-C and Hsu, C-C \An interactive train scheduling work-bench based on arti cial intelligence", in Proc. of the 6th International Conference on Tools with Arti cial Intelligence, New Orlean, LA, IEEE Comput. Soc. Press, pp 42-48 (Nov. 1994). 17. Schaefer, H. and Pferdmenges, S. \An expert system for real-time train dispatching", in COMPRAIL 94, 2, pp 27-34, Madrid, Spain (1994). 18. Chiu, C.K. et al. \A constraint-based interactive train rescheduling tool", in Proc. of the 2nd International Conference on Principle and Practice of Constraint Programming-CP96, Cambridge, USA (Aug. 1996). 19. Higgins, A. et al. \Heuristic techniques for single line train scheduling", Journal of Heuristics, 3(1), pp 43-62 (1997). 20. Isaai, M.T. and Singh, M.G. \An object-oriented constraint-based heuristic for a class of train scheduling problems", IEEE Transactions on Systems, Man
449
26. Glover, F. et al., Genetic Algorithms and Tabu Search: Hybrids for Optimization, Graduate School of Business, University of Colorado at Boulder (July 1992). 27. Osman, I.H. and Kelly, J.P. \Meta-heuristics: An overview", I.H. Osman and J.P. Kelly, Eds., in MetaHeuristics: Theory and Applications, USA, Kluwer Academic Publishers, 2nd Printing, pp 1-21 (1997). 28. Wallace, M.G. \Practical applications of constraint programming", Constraints Journal, 1(1), pp 139-168 (1996). 29. Tsang, E., Foundations of Constraint Satisfaction, London: Academic Press Limited (1993). 30. Elmohamed, M.A.S. et al. \A comparison of annealing techniques for academic course scheduling", in Proc. of the 2nd International Conference on Practice and Theory of Automated Timetabling (in: LNCS 1408), pp 92-112, Canada (Aug. 1997).
21. Isaai, M.T. and Singh, M.G. \An intelligent constraintbased search method for single-line passenger-train scheduling problems", in Proc. of the 2nd International Conference on the Practical Applications of Constraint Logic Programming, pp 79-91, Manchester, UK (April 2000). 22. Sharma, G. et al. \A knowledge-based simulation approach (K-SIM) for train operation and planning", Simulation, 62(6), pp 381-391 (1994). 23. Tomii, N. and Ikeda, H. \A train rescheduling simulator combining pert and knowledge-based approach", in Proc. of the 7th European Simulation Symposium, ESS'95, pp 534-538, Erlangen-Nuremberg (Oct. 1995). 24. Metropolis, N. et al. \Equation of the state calculations by fast computing machines", Journal of Chemical Physics, 21, pp 1087-1091 (1953). 25. Kirkpatrick, S. et al. \Optimization by simulated annealing", Science, 220(4598), pp 671-680 (May 1983).