Simultaneous schedule of trains and track maintenance according to stochastic blockage time

ABSTRACT Regarding the railway infrastructures, planning for track maintenance is a challenging task given the coordination required between train traffic and maintenance operations. In this paper, using stochastic mathematical programming, we have investigated the simultaneous scheduling of trains and operations for a single-track line to minimise both the travel time of trains and maintenance duration. The uncertainty in the blockage duration of the track is considered in the model to reduce the impact of unexpected delays in maintenance operations. The proposed model also considers the practical aspects, which have been less addressed in previous studies regarding track maintenance. We reformulated the stochastic problem as its deterministic equivalent to facilitate solutions for realistic sizes. The computational result obtained for a real-world track shows that the model can efficiently find simultaneous scheduling of trains and operations and suggest optimal blockage duration at different confidence levels. The impact of timetable comparison on the blockage duration for a heavily utilised line has also been evaluated.


Introduction
The regular maintenance of a rail infrastructure ensures the appropriate operation of the rail system, safety, and satisfaction of passengers. The track is among the most maintenance-intensive parts of a railway system, which is expected to preserve or even improve the performance and capacity of the system. A key issue in track maintenance is the process of detecting defects, determining the required maintenance types, and then scheduling the operation. This process might vary according to the regulations of maintenance management. For example, in the Railway of Iran (RAI), defects are initially detected in four ways by the Department of Track Maintenance depending on the availability of resources: (i) monitoring of the track with measuring machines, (ii) inspection of the track by maintenance experts, (iii) monthly inspection of the track by a team from a high-ranking commission called the Commission of Accidents, and (iv) reports from train drivers.In the next step, the type of maintenance and the minimum time required for the operation of each track segment is announced to Dispatch Department to set out the timetable. It should be noted that during the maintenance operation, the track would be out of service as it is often carried out using heavy rail machinery. Accordingly, the initial timetable of trains should be outlined to include maintenance activities. The modified timetable is currently prepared based on the experience of experts at the Dispatch Department of RAI and is further checked using simulation software.
Currently, the software called Sanieh is commonly applied to control the feasibility of proposed timetables.The procedure above requires a timetable to be modified several times to include the repair operations. It is apparent that such a sequential scheduling method cannot solve the train timetabling and operation problems efficiently. In fact, the interdependency of the two activities is such that they should be optimised simultaneously due to some operational limitations. For instance, trains should be prevented from traversing the track segment during maintenance activities, or the maximum allowable speed of trains should be restricted after maintenance operations. In order to take such operational constraints into account, the nature of the problem necessitates an integrated framework.In addition, non-integrated scheduling based on the experience of experts lacks some major features. First, the duration of track blockage for maintenance is assumed to be constant based on the engineering judgement of an expert. In practice, however, the blockage duration is mainly variable due to some unexpected conditions, such as machinery breakdown, unavailability of crews, and inclement weather. If the probable delay is ignored in maintenance duration, it can be propagated throughout the timetable and impose additional costs on the operator. Moreover, the scheduling of trains and maintenance activities is a critical task as they utilise the capacity of a track competitively. Operating more trains leads to a shorter time available for maintenance, and vice versa. The tension is especially high when track capacity is inadequate, which is the case in many bottlenecks now. Therefore, it is hardly possible to set out an efficient timetable for trains and maintenance activities merely based on the experience of experts, and there have recently been urgent calls to regard the integrated optimisation of the two problems.
Dispatching trains according to their importance is the main issue in the simultaneous scheduling of trains and maintenance operations. There are different types of passenger trains operated by the Railway of Iran (RAI) to connect numerous cities, districts, and regions, including high-speed, premium (express) passenger trains; regular trains; slow, cost-effective passenger trains; and freight trains. High-speed trains are equipped with several facilities and operate at the maximum allowable speed with limited stops, which help them maintain their high speed. Regular trains are more affordable than express ones, run at semi-high speed, and stop at all major stations, along with a few secondary stations. Slow passenger trains provide economical travel options at slow speeds and stop at almost every station on their route. Freight trains load bulk commodities, such as agricultural and energy products, automobiles and components, construction materials, chemicals, equipment, and food, and run at lower speeds in comparison with passenger trains. According to this classification, important trains such as express passenger trains should arrive at the destination with the maximum allowable speed and the shortest dwell time in stations. Considering the importance of trains in the integration of the two tasks (the simultaneous scheduling of trains and maintenance operations) is a more challenging issue as the priority of trains arriving at the destination should be considered, along with the limited speed of trains on track segments requiring maintenance. The integration of the two tasks is especially important when dealing with a compressed timetable as considering operational constraints, along with the sequential movement of trains, requires the simultaneous optimisation of both tasks.
Concerning the above discussion, developing a mathematical optimisation model to design a simultaneous timetable of trains and maintenance operations while considering practical conditions and uncertainty in blockage duration is vital for rail authorities. Optimal simultaneous scheduling could be a step forward to improve the interaction between maintenance and train schedules and make use of the capacity efficiently.
Typically, in the literature, each of the two problems, i.e., train scheduling and maintenance planning, has been modelled separately. Numerous studies have been conducted focusing on the train and track maintenance scheduling independently. Szpigel [1] presented a mathematical programming model to optimise the train scheduling problem. Since then, numerous models have been proposed to consider different operational situations using innovative solutions. A review of this problem reveals three major trends in the literature: tactical scheduling, operational scheduling, and rescheduling. To avoid prolixity, the interested reader is referred to the review paper by Törnquist [2] for more details of each trend. In addition, the paper by Corman and Meng [3] seems to be worthy of notice as it presented a survey of approaches on online railway traffic rescheduling problems, which exhibited dynamic and stochastic aspects. Finally, we suggest the review paper by Cacchiani, Huisman [4] that covered the models and algorithms for real-time rescheduling of timetables, rolling stock, and crew duties.
The track maintenance scheduling problem has also been studied by many researchers over recent years. A comprehensive review of this subject can be found in an article by Lidén [5].
Despite the extensive studies on each of the two aforementioned subjects, limited works have investigated the problem of joint modelling of train scheduling and maintenance operations due to its complexity in modelling.
The first category of literature on the joint scheduling and maintenance problem deals with the problem when a timetable exists, and maintenance tasks, typically minor ones, should be performed. Models derived from such studies mostly have reached an adjusted timetable with marginal deviation from the original one (e.g., see [6][7][8]).
The second category of the literature jointly schedules trains and plans preventive maintenance tasks. It is made at tactical or operational levels or on macroscopic or microscopic scales, depending on the context of the problem and the level of details of the network representation [9]. Pioneering studies in this domain have been conducted by Higgins, Ferreira [10], Albrecht, Panton [11], and Forsgren, Aronsson [12].
Higgins, Ferreira [10] made one of the first attempts to minimise train delays and costs associated with maintenance operations. They predicted the interference of train services and maintenance operations by including a constant probability coefficient in the model. The proposed combinatorial model could only be implemented on small-and medium-size networks, and with the rise in the number of stations and trains, the time for solving the model would be significant. Moreover, they assumed that the blockage duration is simply composed of some discrete intervals that should be known in advance. Since such an interval is determined by the user and through trial and error, its value affects the accuracy of the final solution. To overcome the computational burden of the mentioned model for large-size networks, Albrecht, Panton [11] proposed an approach for the scheduling of the train services, which included blockage duration for maintenance operations. At first, they produced a set of feasible timetables in the absence of track maintenance. Then, alternative plans were developed by adjusting the departure and arrival times of trains to minimise delays. In fact, instead of using a mathematical programming model, they utilised the problem space search (PSS) technique to create the best plan. Furthermore, the blockage duration was simulated using a dummy train with the travel time being equal to maintenance operation on the track. Despite proposing a novel approach in this area, Albrecht, Panton [11] neglected to address the practical aspects of maintenance operations like the compulsory sequence of some maintenance operations. Furthermore, their study might have been more useful if the possibility of rerouting of trains due to the track blockage was considered. To overcome the latter flaw, Forsgren, Aronsson [12] suggested a model that considers the rerouting of trains during maintenance operations while trying to make the slightest modification and train cancelation in the primary timetable.
With recent scientific deductions and methodical advancements, several researchers have targeted this problem from different perspectives. Luan, Miao [13] attempted to formulate the problem when the maintenance time slots are at a microscopic level, and the duration of each maintenance task is constant. The length of maintenance duration and its effect on the railway traffic were also investigated by Lidén and Joborn [14]. They considered the overhead time composed of preparation time (the time required for setting up the maintenance operation) and termination time (the time required for removing maintenance facilities) and suggested a portion of the overhead time (such as the transfer of the maintenance crew to the determined required location and installation of safety signs in the area after the last train passed) to be transferred out of the blockage time to improve the efficiency of train schedules. Lidén and Joborn [15] devised a joint scheduling and network maintenance model at the tactical level while paying special attention to the longterm planning horizon. Further, Lidén, Kalinowski [16] extended the model built by Lidén and Joborn [15] by considering maintenance resource constraints regarding crew availability, work time regulations, the number of maintenance machines in the scheduling. However, the uncertainty of the blockage duration was yet ignored in the scheduling of the trains. In a pioneering study, D'Ariano, Meng [17] sought to capture uncertainty in the track maintenance operation. This was achieved by considering small perturbations of process times in a stochastic modelling environment.
Focusing on some specific aspects at a microscopic level, Zhang, D'Ariano [9] developed a microscopic optimisation model and constructed a mixed-integer linear programming formulation whose variables included train timing, sequencing, and routing, as well as maintenance timing and sequencing. Finally, Zhang, Gao [18] developed a double-track model in a railway network, where the upstream and downstream trains were independent, and a maintenance task on a section could not be split or disrupted.
Overall, the studies mentioned above have focused on various aspects of joint modelling of track maintenance and train scheduling, while the uncertainty in maintenance operations is not sufficiently addressed within the joint modelling. That is, the integrated optimisation approaches for scheduling of trains and infrastructure maintenance have not advanced adequately, and many questions are yet to be answered. This paper seeks to face the challenging issues regarding the integration of track maintenance and train schedule by developing a mathematical model and an efficient solution in the following ways: (1) A stochastic mathematical programming model was developed to adjust the timetable of trains in a single track according to maintenance operations, where the blockage duration of the track is considered uncertain to reduce the impact of unexpected delays in maintenance operations.
To be more precise, at first, the uncertainty in the blockage duration of the track is included in the proposed model to consider unexpected delays due to machinery failure, unavailability of the maintenance crew, inclement weather, or even wrong estimation of the required time for maintenance operation. If a probable delay in maintenance operation is not considered in the train timetable, cascading delays occur in the movement of trains. In this study, a new approach is proposed which considers uncertainty in the blockage duration by including stochastic buffer time in the time required for each maintenance operation.
(2) This study also considers practical aspects of maintenance operations in the proposed model to make it applicable in practice. For example, it is necessary to consider the speed limit of trains before and after a maintenance operation. Moreover, some maintenance activities should be operated successively to achieve the best performance. The sequence of maintenance operations is another practical aspect addressed herein. Considering the starting and finishing time of a maintenance operation according to working hours and the minimum blockage duration for each maintenance type is another operational feature that enhances the applicability of the proposed model.
(3) The next contribution of this study that distinguishes it from the previous ones is considering a continuous-time window for the integrated scheduling of maintenance activities and trains. Previous studies commonly used time slots or discrete intervals to represent the departure or arrival time of trains and maintenance operations in a timetable [10,[14][15][16]. Although discrete intervals might simplify the scheduling problem, they lead to less accurate results. Moreover, the division of a time window into small intervals leads to very large combinatorial problems of intractable size. In this research, a continuous-time pattern is used in the proposed model to overcome this limitation.
(4) The proposed model can efficiently utilise the capacity of a timetable at different confidence levels of stochastic buffer time. In fact, integrating two tasks is especially important when dealing with a compressed timetable as the adequate buffer time according to the selected confidence level should be included in the dense movement of trains. In this respect, an efficient approach is adopted to compute the optimal solutions within a short computation time by reformulating the original stochastic problem to a deterministic one.
The remainder of the paper is organised as follows. Section 2 describes the problem characteristics regarding assumptions and operational aspects. Section 3 presents the optimisation model of the simultaneous scheduling of trains and the proposed solution approach. The results of implementing the proposed model on a real case study are discussed in Section 4. Finally, Section 5 finishes the paper with conclusions and suggestions for further works.

Problem statement
The problem studied in this paper can be described as follows. Consider a single-track line that connects an origin-destination (OD) pair along which a set of track segments and stations exist. A train station is a railway facility or area where trains regularly stop to load or unload passengers, freight, or both. A track segment refers to the path between any two successive stations. These concepts are illustrated in Figure 1. In such a single-track line, a set of trains move between origin-destinations (ODs) according to the daily timetable. As Figure 1 shows, the trains moving from the west are called west trains, and those moving from the east are called east ones.
After the inspection of tracks, given the required maintenance operation of track segments, the minimum blockage duration is obtained for each segment. According to the inspections, two types of maintenance activities can be predicted: routine or ordinary maintenance and major maintenance and renewal. The former usually does not take much time and is done frequently, while the latter requires considerable time to be executed and affect train operations. It should be noted that it is possible to combine regular activities on some track segments at the same time or integrate them with major activities. However, the combination of major maintenance activities is often not possible due to technical and executive limitations. This study only investigates major maintenance activities, and the combination of major maintenance activities and small regular tasks is left out of consideration. Such activities are categorised in Table 1. It is worth noting that some maintenance activities should be operated successively and ceaselessly. For example, ballast regulation is followed by tamping, where a normal speed is immediately required after the operation. The categories in the first two rows of Table 1 indicate such operations. Figure 2 shows the equipment of each maintenance operation. Tamping, ballast regulation, track stabilisation 2 Tamping, ballast regulation  3  Tamping  4 Ballast regulation 5 Track stabilisation 6 Rail rubbing 7 Rail welding 8 Rail renewal The problem is to seek an optimal simultaneous schedule of trains and maintenance operations for a single-track line such that the travel time of trains and the duration of operations are minimised. In this respect, some assumptions and operational aspects are considered as follows: (1) The priority of trains is given by assigning an importance factor to each train. Commonly, passenger trains have priority over freight trains, as delays in passenger trains cost rail authorities more than the ones in freight trains. from an origin or arrive at a destination within a specific period of the day. It is especially the case when passenger satisfaction shall be achieved in luxury services. (6) The allowable speed of trains on track segments requiring maintenance is different before and after an operation. (7) Some of the maintenance operations must be carried out successively to achieve the highest quality. For example, tamping should be immediately followed by ballast regulation when the equipment for both operations is available. (8) The starting and finishing times of the maintenance activities are limited to the working hours of the crew.
All the assumptions above are considered as constraints in the problem under study. Recall that each maintenance operation requires the track to be blocked within a certain period. The blockage duration, however, is subject to changes due to unexpected delays in the maintenance process or operational tasks. If such probable delays are not included in the simultaneous scheduling, cascading delays occur in the train services. To avoid such a situation, we propose an approach in which the minimum required blockage time of each maintenance operation is extended with buffer time to compensate for the variation in maintenance duration. The details are described in Section 3.

Mathematical model
In this study, we utilise a stochastic mathematical programming model to optimise the simultaneous scheduling of trains and maintenance activities of the track. The proposed model considers the assumptions and aspects described in Section 2.
As explained, we allocate buffer times to the blockage duration of each track segment under maintenance to cope with unexpected delays in the operations. The buffer time is considered a stochastic variable with a given distribution function obtained from historical data. Figure 3 illustrates a typical normal distribution of variations in maintenance operations based on historical data. The buffer time is further determined based on the amount of confidence level (probability level) that the maintenance operation may exceed its minimum duration. The hatched area in Figure 3 depicts a typical confidence level. A high confidence level results in a longer buffer time. However, a large buffer time represents an unused reserve time in the timetable and may cause the loss of available capacity. Therefore, adopting a well-balanced probability level is an important issue in determining the buffer time.
Another key feature of the proposed mathematical model is the use of a continuous-time horizon rather than the discrete intervals for simultaneous scheduling. In other words, the departure and arrival time of trains or the beginning of maintenance operations may occur at any point within the timetable, and there is no need to consider any interval in the mathematical model. It should also be noted that the scheduling of trains is considered at a macroscopic level, i.e., station-segment level. In contrast to previous models [10,[14][15][16], the results of the continuous-time horizon can be directly used in practice. In discrete-time models, the intervals are determined from the users' viewpoints, and therefore, the results may not have sufficient accuracy. Moreover, the division of a long time horizon into small intervals leads to very large combinatorial problems of intractable size.
Some maintenance operations require to be implemented consecutively in the real world. In the proposed model, we define a subset of maintenance operations so that certain operations should be performed successively. For this purpose, when operations a and b are performed consecutively, the model sets the starting time of operation b at the end of the operation a. It is noteworthy that the priority of consecutive operations must be defined by the user in advance.
In the following, the stochastic mathematical programming model is introduced. Table 2 provides the notation system. Station pairs in which the track segment between (p 0 ; p 0 þ 1) do not require maintenance (P 0 � P, p 0 2 P 0 ). P 00 Station pairs in which the track segment between (p 00 ; p 00 þ 1) require maintenanceðP 00 � P; p 00 2 P 00    Objective (1) is composed of three parts. The first part minimises the travel time of west trains for all ODs. It makes west trains run over railway lines with the maximum allowable speed and have the shortest dwell time in stations. Similarly, the second part minimises the travel time of east trains. The third part of the objective function allows maintenance operations to be carried out in the shortest possible time. This part aims to adopt the optimal blockage duration of each maintenance activity. Constraints (2) and (3) prevent conflict of west and east trains in the same track segment. Constraints (4) and (5) prevent two west trains from entering the same segment simultaneously, while constraints (6) and (7) make such prevention for two east trains. For instance, γ p ð Þ; pþ1 ð Þ ij ¼ 1 means that east train i occupies the track segment p; p þ 1 sooner than east train j. Therefore, constraint (6) ensures that train j enters the segment p; p þ 1 only after train i arrives at the end of that segment plus a minimum safety headway (or mathematically, TD pþ1 j � TA p i þ h). In other words, a segment cannot be occupied by two trains at the same time.
Constraints (8) and (9) determine the earliest departure time of west trains from their origins and the latest arrival time to destinations, respectively. Similarly, constraints (10) and (11) determine the earliest departure time and the latest arrival time of east trains, respectively. The minimum dwell time of west and east trains in stations is taken into consideration through constraints (12) and (13), respectively. The maximum allowable dwell time in stations is also considered by constraints (14) and (15). Constraint (16) considers the blockage duration of track segment p; p þ 1 ð Þ due to maintenance activity m 2 M so that it would be longer than the minimum required blockage time extended by a buffer time with a given confidence level. This relationship is the only probabilistic constraint that makes the model stochastic. Constraint (17) makes certain that the finishing time of the maintenance activities is followed according to the working hours of the crew. Constraint (18) causes some maintenance operations to be carried out successively to achieve the best quality of operations. It should be mentioned that the sequence of operations (for instance, first m and then n or vice versa) should be defined by the user in advance. On the other hand, constraints (19) and (20) prevent the conflicts of two different maintenance operations in the same track segment. The maximum allowable speed of west and east trains in track segments that do not require any maintenance is given by constraints (21) and (22), respectively. The maximum allowable speed of west trains in track segments requiring maintenance before and after operations is determined by constraint (23). During maintenance operations, trains are not allowed to enter the track segments under repair. For this purpose, west trains are prevented from traversing the track segment during maintenance activity by constraint (24), and they are enforced to wait until the operation is terminated by constraint (25). The maximum allowable speed of east trains in track segments requiring maintenance before and after operations is determined by constraint (26). Moreover, constraints (27) and (28) inhibit east trains from entering the track segment between the starting and finishing times of the maintenance operations, respectively. Constraint (29) specifies the time horizon of the related variables. The integrality for binary variables is also preserved by constraint (30).

Solution approach
The model proposed in this paper is based on stochastic mathematical programming that is difficult to solve using ordinary solvers for medium and large-scale networks. Therefore, the suggested approach is to reformulate the chance constraint (constraint 16) to a deterministic one.
Generally, if the left-hand side (LHS) coefficients of a constraint in the optimisation formulation are random variables, the chance constraint can be converted into a nonlinear deterministic one. The random variable in constraint 16 is the buffer time in the right-hand side (RHS) of the chance constraint. Therefore, in order to convert the chance constraint to its corresponding deterministic equivalent according to the predetermined confidence level, it should be first rewritten as follows: To abbreviate Eq. 31, it can be again rewritten as , and β m η ð Þ denotes À B m . The deterministic equivalent of Eq. 32 can be determined if the distribution of β m η ð Þ is known. According to historical data, it is assumed that β m η ð Þ is normally distributed. Given the estimated mean and standard deviation for β m η ð Þ, Eq. 32 can be converted to is the expected value of β m η ð Þ, and σ β m is the standard deviation of β m η ð Þ. As β m η ð Þ is normally distributed, the LHS of the inequality inside the probability expression in Eq. 33 follows the standard normal distribution (mean=0 and SD=1). Therefore, the original chance constraint, Eq. 16, is now tantamount to the following deterministic form: where Φ À 1 1 À pr m ð Þ is the inverse function of Φ 1 À pr m ð Þ, with the standardised normal distribution evaluated at 1 À pr m .
Both Eqs. 16 and 35 have the same concept. Nevertheless, converting Eq. 16 to Eq. 35 makes the optimisation problem easier to solve. It should be noted that if the random variable of the chance constraints has a distribution function other than the normal type, the related deterministic equivalent would be nonlinear. In a case where the random variable is normally distributed, the transformation results in linear deterministic constraints. The interested reader is referred to Vajda [19] and Watanabe and Ellis [20] for more details.

Results and analysis
The implemented model is applied to a stretch of the southern railway line of RAI to verify the validity and reliability of the results. The examined stretch is a single line corridor that contains 14 track segments and 15 stations with a total length of 208 kilometres. Figure 4 represents the railway line and segments. Thirteen passenger and freight trains are scheduled in each direction per day between Andimeshk and Dorud Stations. According to the available inspections, the second category of maintenance operation (tamping and ballast regulation) is planned for track segment No. 8 between Tale-Zang and Tang-e-Panj Stations, as highlighted in Figure 4. In such a maintenance operation, ballast regulation should be successively operated after tamping.   The available data of maintenance operation for this track reveals that the delay might occur for each type of maintenance category. Therefore, it is required to consider a buffer time for each maintenance type. According to historical data, the delays that have occurred for tamping and ballast regulation follow a normal distribution, as displayed in Figure 5. As can be seen, the distribution function of unexpected delay associated with each type of operation is different from those of other operation types for each segment. If two operations are combined, the distribution function of bundled tasks must be used. However, calculating the joint distribution of two operations would be a computational burden as the delay associated with consecutive operations is dependent. In other words, when two or more operations are carried out in sequence, the delay that occurred in one operation may influence the subsequent operation. Obviously, the joint probability distribution cannot be simply extracted as they are mutually dependent.
The time window for the scheduling is considered for a whole day (1440 minutes), and 6 AM is set as the beginning of the trains' timetable. Due to the lack of special maintenance facilities and the limitation of working hours during the night, maintenance operations shall be terminated at 2 PM (the 500th minute). Furthermore, the maximum speed of trains on the segment requiring maintenance is reduced to 45 km/h due to the poor quality of the track. After the operations, however, the speed limit returns to a normal state. Table 3 summarises the inputs of the model for the case under study.
The case was analysed through the proposed stochastic optimisation formulation to obtain the simultaneous scheduling of trains and maintenance operations. The confidence (probability) level in the chance constraint (Eq. 16) was set to 50%. It represents the confidence level with which the proposed buffer time covers the probable delay of that maintenance operation. Figure 6 illustrates the simultaneous scheduling of trains and maintenance operations in such a case. According to this graph, the blockage time needed for tamping and ballast regulation of track segment No. 8 is obtained 106 and 95 minutes, respectively, which implies that the total buffer time of 11 minutes is required for maintenance operation of that segment. Figure 6 demonstrates that the maintenance operation in track segment No. 8 should be started at 9 AM (the 120th minute) to obtain the minimum travel time of trains and maintenance operation. The interactions between trains and maintenance operations can be seen in the timetable of Figure 6. First, during the operation time, track segment No. 8 is blocked, and trains are prevented from entering that segment. Next, closer attention to the four initial trains reveals that the speed of trains moving through track segment No. 8 before maintenance operation (I4, I9, I12, and I13) is reduced (the smooth slope of movement in comparison with other segments). This is because the maximum allowable speed of trains crossing over a segment that requires maintenance is reduced.
The main advantage of using a stochastic model with a chance constraint is to identify the appropriate buffer time for maintenance activities at different confidence levels and introduce it to the decision-maker. In this respect, we analysed the real data of delays occurring with maintenance operation for the case study and compared the results with those of the practical approach, which is commonly adopted by the Dispatch Department of RAI. For this purpose, we first determined the required blockage duration of each maintenance operation using the stochastic optimisation model and then compared it with the actual amount of delay that had occurred in practice. The analysis showed that the real (happened) blockage durations exceeded the proposed ones by the model in only less than 3% of all available data, considering a confidence level of 70%. In contrast, the comparison of real blockage duration with the ones predicted by the practical method of RAI indicated that delays occurred in 25% of the available data.
Considering different values of confidence level in the chance constraint (Eq. 16) leads to an overestimation or underestimation of buffer time of maintenance operations. Table 4 lists the required buffer time for each confidence level, along with the start time and end times of the operations.
A challenge often faced by a decision-maker is how to consistently select an acceptable buffer time for each maintenance operation. By varying the probability level in the chance constraint, Eq. 16, a range of values can be obtained for the buffer time of each maintenance operation. Figure 7 depicts the buffer time of each confidence level. As can be seen, the higher the confidence level considered for each maintenance type, the greater the buffer time assigned to it. Meanwhile, the  probability of delay occurrence (columns in Figure 7) declines with the rise in the buffer time for each maintenance type. For example, when the buffer time for tamping is 11 minutes, the probability of unexpected delay in tamping operation is 40%, while with a 38-minute buffer time, it is only 5% possible that a greater delay occurs during that operation. A higher confidence level declares that the obtained buffer time covers more delays occurring during a maintenance operation. This is especially remarkable in situations when every slight increase in blockage time causes a significant delay or even the cancellation of the trains. Therefore, a higher confidence level might be considered for such cases. As discussed above, assigning a buffer time to the blockage time of each maintenance operation prevents delay extension if the operation occurs with a delay. However, this often causes an increase in capacity consumption, which is a problem for heavily utilised lines. In this study, we increased the number of trains in the current timetable to evaluate the effect of compressing the timetable on the buffer time of maintenance operations. The analysis revealed that when the number of trains increased to 15 trains per direction, the required buffer time as per confidence level was the same. For example, when there were 15 trains or fewer in each direction, a total buffer time of 11 minutes was required for the maintenance operation at a confidence level of 50%. However, the implementation time to solve an optimal timetable dramatically increased with the confidence level and the number of trains. That is when the number of trains increased to 16 pairs, a feasible timetable could not be found. It implies the fact that the unused time reserves considering a high confidence level at a compressed timetable make it infeasible. Therefore, an appropriate confidence level should be addressed by the decision-maker according to the compression of the timetable.
An extra effort was also made to show the challenge of applying the original stochastic model to the real scale problems in terms of solving process time. To study this issue more in-depth, we compared the solution procedure of the original stochastic model for several instances with a different number of track segments, stations, trains, and maintenance operations. Table 5 shows the runtime of the original stochastic model with the changes in the inputs. It is assumed that the other parameters are the same for all cases.
The results of the above table provide interesting insights about the scalability of the original stochastic model to study how its performance varies with problem size. The model was launched for three different cases in which the optimum simultaneous scheduling was obtained for all cases while the process time increased considerably with the number of parameters. Especially, when the problem size approached the real state (case #3), the runtime exceeded a logical framework.
The above results encourage a different approach to solve the original stochastic model. In this respect, we proposed an alternative solution approach to convert the stochastic constraint (relation (16)) into a deterministic one, as discussed in Section 3.2. The proposed approach helps the original stochastic model be solved in a considerably shorter time than the time required for solving the original one. Specifically, for the real case discussed in Section 4, the execution time was only 3.3 min, which is comparable with case #3 in Table 5.

Conclusions
This paper presented an optimisation approach for the simultaneous scheduling of trains and maintenance operations in single-track lines. The proposed model was based on stochastic mathematical programming, which considered the uncertainty in blockage time of track due to unexpected delays in maintenance operations. The model was solved by converting the chance constraint to a deterministic one when the distribution function of expected delays was available from the historical data. The proposed approach had several properties that distinguished it from previous ones. First, it considered the requisite practical aspects for simultaneous scheduling of trains and maintenance operations such as (i) compulsory sequence of some maintenance activities, (ii) allowable speed of trains before and after operations, (iii) crossing and overtaking of trains at stations, (iv) departure and arrival time of trains, and (v) working hours of crew. Next, a continuous-time horizon was considered for macroscopic scheduling of operations and trains instead of discrete intervals addressed by previous studies because of simplicity. Furthermore, the unplanned delay of operations was taken into account in the scheduling by including a stochastic buffer time in the minimum required blockage duration of each maintenance type. This improved the reliability and on-time performance of the timetable by decreasing delay extension and, therefore, increasing the timetable robustness.
The results of applying the model on the south corridor of the Iranian Railway were reviewed and analysed in this paper. As the buffer time was addressed to be a random value, different confidence levels were considered for the related chance constraint. The sensitivity analysis of the confidence level indicated that considering higher levels resulted in a longer buffer time for each maintenance type. By increasing the confidence level, however, the probability of a delay longer than the obtained buffer time was reduced. In other words, the scheduling at a higher confidence level is expected to be more robust against unplanned delays in maintenance operations. It should be noted that the buffer time consumes the timetable capacity, which is a problem for heavily utilised lines. Our analysis revealed that when the number of trains increased in the existing timetable, the obtained buffer time for a specific confidence level did not change. However, with the compression of timetables, feasible scheduling can hardly be obtained. This implies the fact that the unused time reserves by considering a high confidence level at a compressed timetable makes it infeasible. Then, the decision-maker should select the appropriate confidence level regarding the compression of the timetable and the probability of unexpected delays. In terms of solution time, the original stochastic model required considerable process time for real state cases with large dimensions, while runtime significantly declined with the proposed solution approach.
There are several directions to be considered for future research on the problem of simultaneous scheduling of trains and maintenance operations. Firstly, the buffer time for trains can be accommodated into the timetable to compensate for delays in main trains. The proposed method is to use a probabilistic constraint for the speed limit of trains. The second direction is to extend the model to consider the capacity of stations for the arrival and departure of trains. Furthermore, some maintenance equipment should be located in major stations that require scheduling to arrive to those track segments requiring maintenance. Regarding such issues also requires more specialised solution methods to be developed to consider the increasing complexity of practical instances.

Conflict of Interest
The author(s) declare that they have no conflict of interest.

Human and animal rights
This work does not involve Human Participants and/or Animals

Notes on contributors
Mostafa Bababeik finished his Ph.D. in Highway and Transportation Engineering at the University of Tehran. His research interests are transportation network analysis, railway engineering, and operation research. His most recent researches explore the application of mathematical models in railway engineering to solve operational real-world problems.
Mohammad Farjadamin is a graduate M.Sc. student from the University of Tehran. For the last six years, he has been an engineer at the Headquarters Railways of the Islamic Republic of Iran and has dealt with rail traffic management and maintenance problems.