Journal of Rail Transport Planning & Management
Searching feasible resources to reduce false-positive situations for resolving deadlocks with the Banker's algorithm in railway simulation
Introduction
Today, various simulation approaches are widely used in railway planning and operations. Among them, synchronous simulation is a very popular type of railway simulation, by which all train runs are simulated simultaneously along the passage of time. It realistically represents the behaviour of railway systems and the interaction among trains and infrastructure. Synchronous simulation is applied in many railway simulation tools, including RailSys and OpenTrack (Watson and Medeossi, 2014).
A well-known challenge for synchronous simulation is the deadlock problem. An example of the deadlock problem is shown in Fig. 1. The path of the train is marked with a dashed line. During the simulation, if train T2 occupies the route from S4 to S6, all trains T1, T2 and T3 are blocked. A deadlock situation takes place, although all safety rules have been considered.
In Pachl (2011), the deadlock problem in railway simulation is defined as:
“A deadlock is a self-blockade in a control system in which two or more tasks are waiting for each other to release a resource in a circular chain. In rail traffic, a deadlock is a situation in which a number of trains cannot continue their path at all because every train is blocked by another one.”
Four conditions necessary to produce deadlocks are given by Coffman et al. (1971). In Pachl (2011), the conditions are analysed for railway operations:
- 1)
Mutual exclusion: a train will occupy an infrastructure resource exclusively.
- 2)
Wait for: a train holds the occupied resources when it waits for the new re-quested infrastructure resources.
- 3)
No preemption: it is impossible to remove occupied infrastructure resources from a train forcibly.
- 4)
Circular wait: a cyclic wait is formed among two or more trains. Each train waits on other trains to release the required infrastructure resources; meanwhile the train occupies the infrastructure resources requested by other trains.
Three principles can be applied to resolve deadlocks:
- -
Deadlock detection
- -
Deadlock prevention
- -
Deadlock avoidance
With deadlock detection, the system will be rolled back to a previous status in case of deadlocks. For some simulation tools, deadlocks are solved manually through deadlock detection. However, this method of rolling back frequently is not efficient for railway simulation.
A straightforward idea to resolve deadlocks is to eliminate one of the four necessary conditions mentioned above. This approach is called deadlock prevention. In railway operations, the conditions 1), 2) and 3) are always in effect. Therefore, the issue of circular wait is to be considered within this method of preventing deadlocks. Due to the simple nature of the logic involved in systematically preventing circular wait, deadlock prevention can be implemented with low computational efforts.
Clarified with an example, a potential circular wait situation can be prevented with the principle of deadlock prevention by forbidding bidirectional operations or by reserving all of the required infrastructure resources for a given train. However, it is inefficient to simply apply deadlock prevention for the entire process of railway simulation. For lines with bidirectional operations, it is unrealistic or even impossible to prevent circular wait by blocking the entire line for only one direction. With deadlock prevention, more resources for a train will be unnecessarily reserved in advance to prevent circular wait for bidirectional operations. It will reduce the system capacity with a poor level of resource utilisation. Therefore, to resolve deadlocks solely with deadlock prevention for railway simulation is impractical and inefficient.
The principle of deadlock avoidance is the most practical approach in the resolution of deadlocks. For any given request, the current operational situation will be investigated. The request for an infrastructure resource can only be granted in the case of a safe state, which ensures deadlock-free operation. Within the principle of deadlock avoidance, the elimination of circular waits is not directly concerned. Instead, the feasibility to accomplish all the train runs is examined. A safe state can exist even if the circular wait situation is not completely eliminated. The applicability and the limitation of deadlock prevention and deadlock avoidance were also explained in Pachl (2011).
An example to compare deadlock prevention and deadlock avoidance is shown in Fig. 2. For simplification, signals are not shown in this example. The request of train T3 to enter track G1 can be approved through the principle of deadlock avoidance, since all the train runs can be accomplished following the sequence of T3, T2, T1, and T4. After the request has been granted, train T3 only needs to reserve the infrastructure resources up to track G1. With deadlock avoidance, the elimination of circular wait doesn't have to be guaranteed. If train T3 enters track G1, train T4 may also enter G2 at the same time to produce a circular wait. The deadlock will be further avoided through applying the principle of deadlock avoidance on train T4. However, with deadlock prevention, the whole path of train T3 should be blocked, in order to completely prevent from circular wait. It will unnecessarily hold train T to cross through crossing C.
Deadlock avoidance provides a flexible way to resolve deadlocks with a high efficiency. However, the complex interaction among trains should also be taken into consideration. The computational efforts for deadlock avoidance are higher than those of deadlock prevention.
The issue of false-positive situations in resolving deadlocks should be addressed. A false-positive situation will lead to unnecessary waiting time due to the overly-strict rules for deadlock prevention and deadlock avoidance. The detailed discussion of false-positive situations is given in Section 2.2.
Since the 1980s, the issue of deadlocks in transportation systems has been paid attention by operations research experts. In Petersen and Taylor (1983), an algorithm to examine the meetability of opposing train fleets was developed, which can identify deadlocks for networks with only single tracks and loops. However, it may frequently lead to unnecessary waiting times since the trains, which are not evaluated as meetable fleets through the algorithm, will not sufficiently lead to deadlocks.
In Mills and Pudney (2003), the principle of job shop scheduling was employed through the labelling algorithm. By labelling the train sequences on a single line, a feasible schedule of train runs can be derived by the vector-based algorithm. The algorithm was further developed in Pudney and Wardrop (2008). A Kronecker algebra-based deadlock analysis was developed in Mittermayr et al. (2012). To reduce computational efforts, a lazy implementation is introduced with additional constraints.
The deadlock problem and the computational complexity of deadlock avoidance have been addressed with a simplified approach for deadlock avoidance Lu et al. (2004). With this method, an analysis was carried out of the free path from the current position of a train to its destination.
The algorithms discussed above are based on pure mathematic models without being integrated with railway signalling and control systems. These pure mathematic models don't fit the logic for requesting, allocating and releasing railway infrastructure resources exactly. Most of the models are only suitable for typical layouts with only single lines and crossing loops, and not applicable for a complex and general network structure. Additional assumptions and simplifications of infrastructure modelling will lead to biased results that are not practical for railway operations. In Fu and Dessouky (2017), the constraints for a deadlock-free situation were modelled in a mathematical model to program headway control and running dynamics. However, the approach to resolve deadlocks was not elaborated in detail.
In Pachl (1993), the movement consequence analysis (MCA) was developed to avoid circular wait through analysing the events of occupancy. The MCA can avoid deadlocks through the implementation of very strict rules. However, false-positive situations may take place, since it is difficult to decide how far in advance the train route should be evaluated. The dynamic route reservation (DRR) was further developed in Pachl (2011). The exact logic of railway operations and simulation is built within the algorithm through a route reservation model. Six rules are applied to avoid deadlocks with enforced train sequences defined by the stacked reservation model. The algorithm is under implementation in the simulation software RailSys (Pachl, 2011).
In the fields of train dispatching and rescheduling, deadlock problems should be considered in order to ensure the feasibility of the derived dispatching solution. A survey of rescheduling methods was provided in Fang et al. (2015). The approach of the Alternative Graph (AG) model was developed in D'Ariano et al. (2007a), by which either branch-and-bound D'Ariano et al. (2007b) or heuristic approaches can be used to find an optimal or locally-optimal solution. The feasibility of a solution is determined through the examination of the positive length cycle. A deadlock-free solution can be ensured by selecting one of alternative arcs from each pair that possesses no positive length cycle in its graph. Therefore, infeasible solutions that lead to deadlocks will be discarded. The AG model was also adopted by Mazzarello and Ottaviani, 2007, Corman et al., 2014a, and Dollevoet et al., 2014. In Corman et al., 2014b, the approach to examine local and global feasibility was elaborated with constraints at borders. In Martin (1995), the deadlock problem is solved with Mixed Integer Programming (MIP) with the constraint that the waiting time of a train should not exceed a given time period (e.g. 24 h). A heuristic method for Conflict Detection and Resolution (CDR) with neighbourhood search was developed in Samà et al. (2017).
A common problem in the resolution of deadlocks with the approach of Operations Research (OR) for rescheduling is the high computational complexity required, which results in NP-Hard problems. For example, a low quality of solutions for a non-deadlock-free network was reported in Samà et al. (2017). In general, the algorithm to fully avoid deadlocks without false-positive situations (see Section 2.2) is proven to be NP-Hard. However, the computational complexity of deadlock avoidance algorithms with limited efficiency can be controlled (Lu et al., 2004). For example, the Banker's algorithm has been proven with polynomial complexity in Belik (1987).
In Cui, 2010, Martin and Cui, 2011, an algorithm based on the Banker's algorithm for deadlock avoidance in railway simulation was developed. Its usability and system performance have been verified in a software tool PULRAN. However, false-positive situations are not resolved efficiently. In this paper, a method of searching for feasible resources to reduce false-positive situations is addressed, in order to reach a high level of efficiency of railway simulation in a large complex network.
In Chapter 2, the Banker's algorithm and false-positive situations are introduced. The principle and the detailed design of the method are described in Chapter 3. Several case studies are analysed in Chapter 4. Finally, the conclusions and the further development are outlined in Chapter 5.
Section snippets
Deadlock avoidance with the Banker's algorithm for railway simulation
Originally, the Banker's algorithm was developed by Dijkstra in the 1980s to resolve deadlocks for computer systems (Dijkstra, 1982). Within it, a request for resources can only be granted if all tasks can be accomplished in a safe state after the requested resources are granted. A safe state is identified through analysing the maximum required resources, the currently available resources and the currently occupied resources for all involved requesters (in railway simulation, a train represents
Reduce false-positive situations with deadlock prevention
As described in Section 2.2, a request that passes a deadlock-free test with the Banker's algorithm can ensure a deadlock free situation. If a request of infrastructure resources fails the deadlock-free test, the occupancy situation should be further examined, in order to reduce any unnecessary waiting time due to false-positive situations.
The false-positive situations can be reduced by determining whether a possible transition to a safe state along the entire train run exists or not. With the
Case studies
The algorithm has been implemented in the simulation software DoSim. The software DoSim is an internal simulation software for railway planning and operations, developed by the author in recent years. A real railway network is used for the case studies, consisting of 129 stations, including a large terminus station, and 2388 train runs scheduled on 29.10.2011 (Thursday). The same example has also been tested with other simulation software, by which the simulation is not able to be accomplished
Conclusions
In this paper, a method to reduce false-positive situations for resolving deadlocks in railway simulation is developed and implemented. Integrated with the Banker's algorithm, the method described within this work has the potential to reduce false-positive situations based on the principle of deadlock prevention. Since only a limited length of the network is investigated, from the current position of the tested train to the tested feasible resources, the described method can be implemented with
Acknowledgement
The text and the English have been proven and improved by Mr. Syed Murtaza Hasan.
References (24)
- et al.
Dispatching and coordination in multiarea railway traffic management
Comput. Operations Res.
(2014) - et al.
A branch and bound algorithm for scheduling trains in arailway network
Eur. J. Operational Res.
(2007) - et al.
Models and algorithms for dynamic headway control
Comput. Industrial Eng.
(2017) - et al.
A traffic management system for RealtimeTraffic optimisation in railways
Transp. Res. Part B
(2007) Deadlock avoidance with a modified banker's algorithm
In BIT
(1987)- et al.
System deadlocks
Comput. Surv.
(1971) - et al.
Evaluating disturbance robustness of railway schedules
J. Intelligent Transp. Syst. Technol. Plan. Operations
(2014) Simulation-based Hybrid Model for a Partially-automatic Dispatching of Railway Operation
(2010)- et al.
Multi-scale simulation in railway planning and operation
PROMET-Traffic Transp.
(2011) The Mathematics behind the Banker's Algorithm. Selected Writings on Computing: a Personal Perspective
(1982)
An iterative optimization framework for delay management and train scheduling
Flexible Serv. Manuf. J.
Conflict resolution and train speed coordination for solving realtime timetable perturbations
IEEE Trans. Intelligent Transp. Syst.
Cited by (6)
The Tick Formulation for deadlock detection and avoidance in railways traffic control
2021, Journal of Rail Transport Planning and ManagementCitation Excerpt :The problem of checking if a given train configuration is bound-to-deadlock is known to be NP-complete3 (Lu et al. (2004)). In the literature, deadlock avoidance is actually pursued by explicitly or implicitly looking for feasible plans (e.g. in Cui (2009); Cui et al. (2017); Li et al. (2014); Lu et al. (2004); Pachl (2011)). An implicit plan is given by an origin-to-destination path for each train (routing) plus the ordering in which trains visit the shared resources.
Easy Cases of Deadlock Detection in Train Scheduling
2022, Operations ResearchA novel resource management technique for deadlock-free systems
2022, International Journal of Information Technology (Singapore)Artificial Intelligence Enterprise Management Using Deep Learning
2022, Computational Intelligence and NeuroscienceCollision Avoidance Strategy for Multivehicle Conflict on Common Rail
2022, Mathematical Problems in EngineeringPULSim: User-Based Adaptable Simulation Tool for Railway Planning and Operations
2018, Journal of Advanced Transportation