
Railway interlocking systems are crucial safety components in rail transportation, designed to prevent train collisions by regulating switch positions and signal indications. These systems delineate potential train movements within a railway station by connecting sections into routes, which are further divided into blocks. To ensure safety, the system prohibits the simultaneous allocation of the same block or intersecting routes to multiple trains. In this study, we characterize the 'interlocking problem' as a safety verification task for a single real-time station configuration, rather than a 'command and control' function. This is a matter of verification, not solution, typically managed by an interlocking system that receives movement authority requests. Over the years, we have developed various algebraic models to address this issue, suggesting the potential use of computer algebra systems in implementing interlocking systems. However, some of these models exhibit limitations. In this paper, we propose a novel algebraic model for decision-making in railway interlocking systems that overcomes the limitations of previous approaches, making it suitable for large railway stations. Our primary objective is to offer a mathematical solution to interlocking problems in linear time, which our approach accomplishes.
Citation: Antonio Hernando, José Luis Galán-García, Gabriel Aguilera-Venegas. A fast and general algebraic approach to Railway Interlocking System across all train stations[J]. AIMS Mathematics, 2024, 9(3): 7673-7710. doi: 10.3934/math.2024373
[1] | Antonio Hernando, Gabriel Aguilera-Venegas, José Luis Galán-García, Sheida Nazary . An interlocking system determining the configuration of rail traffic control elements to ensure safety. AIMS Mathematics, 2024, 9(8): 21471-21495. doi: 10.3934/math.20241043 |
[2] | Alberto Almech, Eugenio Roanes-Lozan . A 3D proposal for the visualization of speed in railway networks. AIMS Mathematics, 2020, 5(6): 7480-7499. doi: 10.3934/math.2020479 |
[3] | Huizhang Yang, Wei Liu, Yunmei Zhao . Lie symmetry reductions and exact solutions to a generalized two-component Hunter-Saxton system. AIMS Mathematics, 2021, 6(2): 1087-1100. doi: 10.3934/math.2021065 |
[4] | Muhammad Jawad, Niat Nigar, Sarka Hoskova-Mayerova, Bijan Davvaz, Muhammad Haris Mateen . Fundamental theorems of group isomorphism under the framework of complex intuitionistic fuzzy set. AIMS Mathematics, 2025, 10(1): 1900-1920. doi: 10.3934/math.2025088 |
[5] | Muhammad Anwar Chaudhry, Asfand Fahad, Yongsheng Rao, Muhammad Imran Qureshi, Salma Gulzar . Branchwise solid generalized BCH-algebras. AIMS Mathematics, 2020, 5(3): 2424-2432. doi: 10.3934/math.2020160 |
[6] | Seok-Zun Song, Hee Sik Kim, Young Bae Jun . Commutative ideals of BCK-algebras and BCI-algebras based on soju structures. AIMS Mathematics, 2021, 6(8): 8567-8584. doi: 10.3934/math.2021497 |
[7] | Romas Marcinkevicius, Inga Telksniene, Tadas Telksnys, Zenonas Navickas, Minvydas Ragulskis . The step-wise construction of solitary solutions to Riccati equations with diffusive coupling. AIMS Mathematics, 2023, 8(12): 30683-30703. doi: 10.3934/math.20231568 |
[8] | Salvador Cruz Rambaud, Blas Torrecillas Jover . An analysis of the algebraic structures in the context of intertemporal choice. AIMS Mathematics, 2022, 7(6): 10315-10343. doi: 10.3934/math.2022575 |
[9] | Shakir Ali, Amal S. Alali, Naira Noor Rafiquee, Vaishali Varshney . Action of projections on Banach algebras. AIMS Mathematics, 2023, 8(8): 17503-17513. doi: 10.3934/math.2023894 |
[10] | Qining Li . Double Ore extensions of anti-angle type for Hopf algebras. AIMS Mathematics, 2022, 7(7): 12566-12586. doi: 10.3934/math.2022696 |
Railway interlocking systems are crucial safety components in rail transportation, designed to prevent train collisions by regulating switch positions and signal indications. These systems delineate potential train movements within a railway station by connecting sections into routes, which are further divided into blocks. To ensure safety, the system prohibits the simultaneous allocation of the same block or intersecting routes to multiple trains. In this study, we characterize the 'interlocking problem' as a safety verification task for a single real-time station configuration, rather than a 'command and control' function. This is a matter of verification, not solution, typically managed by an interlocking system that receives movement authority requests. Over the years, we have developed various algebraic models to address this issue, suggesting the potential use of computer algebra systems in implementing interlocking systems. However, some of these models exhibit limitations. In this paper, we propose a novel algebraic model for decision-making in railway interlocking systems that overcomes the limitations of previous approaches, making it suitable for large railway stations. Our primary objective is to offer a mathematical solution to interlocking problems in linear time, which our approach accomplishes.
Rail transportation is a crucial mode of transport globally, offering a reliable and efficient means of transporting goods and people over long distances. It plays a vital role in the economy and society, as highlighted in various studies on resilience in railway transport systems [1,2].
A key component of rail transportation is the railway interlocking system, which is a safety-critical system designed to prevent train collisions. The compatibility of switch positions and signal indications at a railway station is crucial for safety. The interlocking system prevents improper changes to traffic signals and turnout switches. A railway station comprises sections connected by traffic signals and turnouts, defining possible train movements. A route is a sequence of connected sections that a train can travel along, partitioned into several blocks. To prevent collisions, two trains may never be in the same block of a route. Two intersecting routes (or their relevant blocks) must not be allocated to trains simultaneously.
In this paper, we define the 'interlocking problem' as follows: given a station topology composed of track sections, signals, and turnouts, and given a specific run-time configuration (which includes trains positioned in some sections, the positions of turnouts, and signal aspects), we must decide whether the signal aspects and turnout positions allow the trains present in the station to move in such a way that they could potentially collide. This definition refers to a 'safety check' for a single run-time configuration of a station, rather than a 'safe command and control' function, which is what existing interlocking systems implement. It is a verification problem, not a solution problem. In practice, an interlocking system usually receives movement authority requests from trains, a dispatcher, or another system. It then has to command the positions of turnouts and signal aspects to grant a movement authority to the train over a path that fulfills the request. This is done after checking that the path is free from other trains and is exclusively reserved for the requesting train.
This complex problem has been extensively studied, with recent research exploring artificial intelligence applications for fault detection [3] and comparing different safety verification methods [4]. There is also work on developing formal model-based methodologies to aid railway engineers in specifying and verifying interlocking systems [5].
Computer-based railway interlocking systems can be classified as follows:
● Route-table based: For every route request, an algorithm checks its feasibility using a "control table". The software consists of a single algorithm, independent of the topology.
● Geographical: The interlocking program is made up of instances of software objects that mimic the behavior of physical objects. The configuration of this program depends on the topology. Within this category, we can distinguish between:
– Route-based: Routes are defined a priori, and their definitions constitute data shared by the instantiated objects.
– On-demand route definition: There is no a priori definition of routes. Instead, a train's request to the interlocking system is given only as the final destination that the train must reach. Instantiated software objects are responsible for exploring possible routes to the destination and choosing one of them. Our approach lies in this category.
Classical railway interlocking systems are route-based and the compatibility of routes is decided in advance [6]. Some modern railway interlocking systems can make decisions on the fly. This makes them more flexible as routes are not predetermined. However, before authorizing any changes to signals or switch positions, it is necessary to check if two trains would travel on intersecting routes (including the same route) and potentially collide. All modern railway interlocking systems are computer-based, either geographical or route-table based. However, naive implementations of geographical algorithms may encounter efficiency problems when finding safe routes through the railway network. Efficient data validation for these geographical systems has been studied [7], and model checking using UMC has been proposed as another verification method [8].
Over the years, we have developed various models to study this problem [9,10,11,12,13,14]. Some of these models are based on polynomials, ideals, and Groebner bases, similar to those used in artificial intelligence for implementing expert systems [15]. This approach bridges computational algebra and interlocking problems, suggesting that computer algebra systems can be used to implement interlocking systems.
Recently, we presented a groundbreaking algebraic model [16] that improves the implementation of interlocking systems. This model provides a linear algorithm that significantly outperforms previous models and is suitable for large-scale railway stations. However, this model has a limitation: the railway station must not have cycles in paths for any configuration of the switches of the turnouts and the indication of color lights. If this condition is not met, the model may produce incorrect conclusions. In this paper, we propose a new algebraic model that builds on the ideas of the previous work [16]. Unlike this model, our present approach does not require any specific conditions on the railway stations while retaining all its advantages over the earlier model [16].
The approach presented in [16] is entirely novel and offers intriguing theoretical perspectives. However, it has yet to gain acceptance within the general railway research community due to a significant limitation: the challenge of implementing it in actual interlocking systems. This is primarily due to the stringent certification requirements associated with such safety-critical applications. Despite this, the results could prove beneficial for simulations that do not require certification. The approach in [16] does not address the general problem and only works in cases where there are no cycles. From a mathematical perspective, overcoming the problem of cycles with the approach in [16] is not straightforward. Indeed, we have had to define new and highly abstract concepts to solve them, which are not immediately apparent nor derived from the paper [16]. We believe that the idea of extending the concept of interlocking problems to extended interlocking problems and defining a completely new relation between them is very novel from a mathematical perspective. We are confident that our manuscript offers fresh insights into the relationship between two seemingly disconnected fields, making it of considerable interest from a theoretical standpoint.
The paper is structured as follows: In Section 2, we explore the limitations of the framework presented in [16] and provide the motivation behind our proposal. In Section 3, we outline the main ideas used to address the limitation of [16]. In Section 4, we present formal definitions of interlocking problems, which are necessary to validate our approach. In Section 5, we present the key concept upon which our algebraic model is based: extended interlocking problems. In Section 6, we translate all previously described concepts into algebraic terms. The static parts of the railway stations are represented by polynomials while the dynamic part by means of a monomial. In Section 7, we demonstrate how an interlocking system can be implemented by means of a Computer Algebra System. In Section 8, we conduct a comprehensive comparison of the performance of our proposed approach against other existing methods. In Section 9, we set our conclusions. Finally, in the appendix, we provide an algorithm with linear complexity.
In [16], the authors introduced a novel algebraic approach for detecting dangerous situations in railway stations. This method, which is based on a linear algorithm, significantly outperforms previous models presented by the authors or their direct collaborators. Its robustness and efficiency make it particularly suitable for application in large-scale railway stations.
The approach is based on representing a railway station by means of a set of polynomials. Then, the problem of determining if a railway station is in a dangerous state is translated into the algebraic problem of determining if the remainder of a monomial on division by a set of polynomials is zero.
However, while this method is significantly faster than previous algebraic models, it requires a strict condition within the railway station: for any given configuration, the paths within the railway station must not form cycles. Without this assumption, the approach in [16] does not work. For example, the algorithm does not work in the house layout depicted in Figure 1.
It is evident that there is a single train present at this railway station, eliminating the possibility of a collision. Despite this, the algebraic model referenced in [16] inaccurately indicates that this situation is hazardous. This error arises because the model relies on a theorem that is only applicable to railway stations devoid of cycles.
Although the presence of cycles, as depicted in Figure 1 (we have provided this example solely to highlight the limitations of the preceding algebraic model), is not common in railway stations, such cycles may form when the station includes a specific type of turnout: trailable turnouts. A turnout, regardless of its type, is a common element in a railway station that connects three sections. Figure 2 depicts a turnout connecting three sections: S1, S2, and S3. A switch in the turnout determines the possible movement of the trains: if the switch is in the direct track position, then a train can move from section S1 to section S2 (and vice versa); if the switch is in the diverted track position, a train can move from section S1 to section S3 (and vice versa). We will distinguish between two types of turnouts:
Non-trailable turnouts. In case that the turnout is non-trailable, a train may derail if the switch is in the direct track position and it tries to pass from section S3, or if the switch is in the diverted track position and it tries to pass from section S2. For this reason non-trailable turnouts are usually properly protected by light signals.
Trailable turnouts. Trailable turnouts avoid potential derailment. For a trailable turnout, a train passes from section S3 to section S1 in the case that the switch is in direct track position, and it can also pass from section S2 to section S1 in the case that the switch is in diverted track position.
Trailable turnouts are commonly used in the configuration depicted in Figure 3 because trains can easily reverse directions. This configuration involves three trailable turnouts: the one connecting sections S1, S2, and S3 whose switch is in the diverted tuck position; the one connecting S4, S3, and S5 whose switch is in the diverted track position; and the one connecting S6, S2, and S5 whose switch is in the straight track position.
In Figure 4, we see the movement of the train to reverse the direction: the train moves from section S1 to section S3 because the switch of the turnout (S1, S2, S3) is in the diverted track position; next, the train moves from section S3 to section S4 because the turnout is trailable; next, the train stops and reverses from section S4 to section S5 since the switch of (S4, S3, S5) is in the diverted track position; next, the train moves backwards from section S5 to section S6 because the turnout is trailable; next, the train moves forward from section S6 to section S2 because the switch of (S6, S2, S5) is in the direct track position; and finally, the train moves forward from section S2 to section S1 because the turnout is trailable.
Trailable turnouts may produce the presence of cycles in the railway station. Let us consider the simple railway station of Figure 5, considering that both turnouts are trailable. As may be seen, there is a cycle, and indeed the algorithm of the approach in [16] will output that the potential collisions may happen if only one train is placed in section S1 (which is not possible since there is only one train placed in the railway station).
Consequently, the approach in [16] has a significant limitation: it requires that the railway station does not use trailable turnouts because its presence leads to the formation of cycles. This requirement prevents the approach from being used in all previous figures. Here, we present a new algebraic approach that overcomes this limitation by accounting for the possibility of cycles, while remaining extraordinarily fast and suitable for large stations.
Distinct from others, the approach presented in [16] is based on a specific definition of the "interlocking problem'' and an analysis of the relation between different interlocking problems. We denote this relation as →.
The relation → has a significant property: if A→B, and if A is in a dangerous situation, then B is also in a dangerous situation.
The reciprocal property is not guaranteed in general, and indeed, for a general railway station it is possible that B is in a dangerous situation and A is not. However, if the railway station does not have cycles in its paths, the reciprocal property is also fulfilled (despite → not being symmetric).
Consequently, for the case of a railway station whose paths does not form cycles, we have that:
ifA→B,thenAisinadangeroussituationifandonlyifBisalsoinadangeroussituation. |
The strategy for determining whether an interlocking problem X1 is in a dangerous situation in [16] is as follows: iteratively derive new interlocking problems X1→X2→…→Xn until Xn can be solved immediately. Figure 6 illustrates the set of interlocking problems for a railway station and the relation ⇝. Through a representation based on polynomials, this process of iteratively obtaining new derived interlocking problems can be automated using the division algorithm.
However, this strategy only works under the condition that the railway station does not have cycles Otherwise, our strategy fails because it could be possible that Xn is in a dangerous situation, but X1 is not. This is why the algorithm proposed in [16] does not work in railway stations with cycles.
In this paper, we will overcome this obstacle in the following way: we will extend the set of interlocking problems into a larger, more abstract set — the set of extended interlocking problems. Then, we will define a new relation, denoted by ⇝, which, although not symmetric, fulfills the desired property:
if A⇝B, then A is in a dangerous situation if and only if B is also in a dangerous situation. (1) |
We would like to emphasize that the relation ⇝ is completely new and is not an extension of R1. For two interlocking problems A and B, we could have that A→B, but A⇝̸B.
Once we have defined this set of extended interlocking problems, and the relation ⇝ between them, our strategy will be similar to [16]: we will iteratively derive new interlocking problems X1⇝X2⇝…⇝Xn until Xn can be solved immediately*. In this paper, we have found a completely new representation based on polynomials, so that this process of obtaining the extended interlocking problems X1,X2,…→Xn can also be automatically done using the division algorithm.
*As we will see, Xn can be solved immediately because trains are positioned within locked sections, meaning they are prohibited from moving.
Unlike [16], our current model works for any railway station because property (1) holds regardless of whether paths of the railway station may form cycles or not.
Figure 7 depicts the set of interlocking problems for a railway station and the relation 'is derived from'. Once the relation ⇝ is defined, we can translate the problem into polynomials and detect if an interlocking problem is in a dangerous situation by means of the division algorithm.
In this section, we will formalize some key concepts related to railway stations and interlocking problem that allow us to prove the validity of our approach.
A railway station is defined by a finite set of sections {S1…Sn}. Sections are physically connected by means of light signals and turnouts. We define this by means of a relation E.
Definition 4.1. Given a railway station, we define the set E⊂Z×Z as:
E={(i,j)|SiisconnectedtoSjorSjisconnectedtoSibymeansofacolorlightsignaloraturnout} |
Remark 4.1. In a railway station, each section is connected to a maximum of two other sections on each extreme through a turnout. This means that each section can be connected to a maximum of four other sections. Therefore, the size of E is less than or equal to 4⋅N where N is the number of sections. As a result, the number of elements in E, is O(N).
According to this definition, E is a symmetric relation. This relation informs whether there is physical contact between two sections. Figure 8 depicts an example of a railway with 11 sections. As may be seen, (1,2)∈E since S1 is connected to S2. We would like to emphasize here that the fact that (1,2)∈E does not indicate that a train can always pass from section S1 to section S2. Indeed, in this case, it depends on the indication of the light signal.
In this way, we define a relation P for indicating if a train can pass from a section Si to another connected to section Sj in a particular configuration of the railway station.
Definition 4.2. Given a railway station, we define the set P⊂E as:
P={(i,j)∈E|ifatraincanpassfromsectionSitosectionSj} |
In the case of a turnout connecting Si to Sj or Sk, we can analyze the difference in P of the section pairs regarding a normal turnout and those regarding a trailable turnout:
● If the turnout is trailable, both (j,i)∈P and (k,i)∈P hold true, regardless of the position of the switch.
● If the turnout is non-trailable, we have that:
– In the case where the switch is in the direct track position, (j,i)∈P and (k,i)∉P.
– In the case where the switch is in the diverted track position, (j,i)∉P and (k,i)∈P.
Figure 9 depicts a possible configuration of the railway station. As may be seen, since the switch of the turnout connecting sections S2, S3, and S9 is in the direct track position, we have that (2,3)∈P and (2,9)∉P.
Just observe that (5,6)∈P and (11,6)∈P because the second turnout is trailable, whereas (9,2)∉P and (3,2)∈P because the fist turnout is non-trailable.
There may be trains placed in the sections of a railway station. We will consider that each train is placed on just one section†. Since we assume that a collision occurs when more trains are placed in the same section, we will use multiset Q to represent occupancy of sections: a section belongs to Q if it is occupied by a train, and the section is repeated in Q once for each train placed in it.
†In this paper, we will assume that each train occupies one section, as we showed in Section 8 of [16] that the general case where trains occupy multiple sections can be reduced to an equivalent interlocking problem where trains occupy a single section.
Definition 4.3. We define the multiset Q as the multiset of integers indicating the sections in which a train is placed: the number of times that element i appears in Q represents the number of trains located in section Si.
We will consider that Q is a multiset instead of a set, since Q will have repeated elements in case two different trains are placed in the same section (which is dangerous).
Figure 10 depicts a situation of the railway station in which there are two trains: one occupies section S1; and another occupies section S10. Consequently we have that Q={1,10}. If there are two trains occupying the same section S1, then we would have that Q={1,1}.
Trains move through the railway network guided by the indications of light signals and turnouts. The concern arises when considering the possibility of a train colliding with another. We formally define an interlocking problem as an ordered pair (P,Q).
Definition 4.4. An interlocking problem is an ordered pair (P,Q), where P is the set of Definition 4.2 and Q is the multiset of Definition 4.3.
Given an interlocking problem (P,Q) we are interested in determining if movement of trains (following indications of the light signals and position of the switches) may result in a collision. We will formally define it:
Definition 4.5. We will say that the railway interlocking problem (P,Q) is in a dangerous situation if and only if there are two lists of integers (we will call them 'paths'), [u1,…un] and [v1,…vm] such that all the following conditions hold:
(1) For all 0<i<n, we have that (ui,ui+1)∈P. That is to say, a train can pass from ui to ui+1.
(2) For all 0<j<m, we have that (vj,vj+1)∈P. That is to say, a train can pass from vj to vj+1.
(3) {u1,v1}⊆Q. That is to say, there must be a train in u1 and v1.
(4) un=vm. That is to say, both paths reach the same section (there is a possible collision).
(5) For all 1<i<n ui∉Q and for all 1<j<m vj∉Q. That is to say, intermediate sections in the list must be free of trains so that trains from section u1 and section v1 may reach section un=vm.
(6) For all 1≤i<n and for all 1≤j<m we have ui≠vj. That is to say, the possible collision happens at the end of the paths.
(7) For all i≠j we have ui≠uj. That is to say, the path [u1,…un] does not contain cycles.
(8) For all i≠j we have vi≠vj. That is to say, the path [v1,…vm] does not contain cycles.
We will say that the railway interlocking problem (P,Q) is in a safe situation if and only if (P,Q) is not in a dangerous situation.
Example 4.1. Let us consider the railway station of Figure 8.
As may be seen, the railway station is divided into sections S1…S11. There are ten color light signals (for example, there is one from S1 to S2) and two turnouts:
● A turnout connecting sections S2, S3, and S9.
● A turnout connecting sections S6, S5, and S11. We have marked a turnout with 'T' in the figure to indicate that the turnout is trailable.
According to Definition 4.1, the set E is:
E={(1,2),(2,9),(9,10),(10,11),(11,6),(2,3),(3,4),(4,5),(5,6),(6,7),(7,8)(2,1),(9,2),(10,9),(11,10),(6,11),(3,2),(4,3),(5,4),(6,5),(7,6),(8,7)} |
Let us consider the configuration depicted in Figure 9. The position of the switches of the turnouts is represented by:
● a small segment, if the switch is in the direct track position (see for instance the turnout between sections S2 and S3,S9 in Figure 9), or
● a small angle, if the switch is in the diverted track position (see for instance the turnout between sections S6 and S5,S11 in Figure 9).
In view of the fact that the figures are printed in black and white, the aspect of the color light signals will be represented by a black circle (stop indication) or white circle (proceed indication).
Now, we will determine the subset P⊆E given by the indications of the light signals and the position of the switches of the turnouts in Figure 9:
P={(1,2),(9,10),(10,11),(2,3),(3,4),(11,6),(6,7),(7,8),(2,1),(11,10),(5,4),(3,2),(6,11),(8,7),(5,6)} |
As may be seen, (10,9)∉P because the indication of the color light signal connecting sections S10 and S9 is stop. In the same way, (5,6)∈P because (S6,S5,S11) is a trailable turnout. However, (9,2)∉P because the switch of the non-trailable turnout (S2,S3,S9) is in the direct track position.
Figure 10 depicts the placement of one train in section S1 and another train in section S10. Therefore, in this case: Q={1,10}
As may be seen in the figure, this situation is safe. However, if a new train were placed in section S8, we would have that Q={1,8,10} (Figure 11) and the situation would turn into a dangerous one: the trains situated in sections S10 and S8 could collide in section S7. As may be seen, we have that [10,11,6,7] and [8,7] fulfill the conditions in Definition 4.5.
In this section, we will extend the concept of the interlocking problem, and we will define a relation ⇝ to such extension.
First, we will define the concept of a locked section. A locked section is one in which, if a train stayed there, it cannot move to another section. Formally,
Definition 5.1. Given the set P⊂E, we say that a section i is locked in P if for every (a,b)∈P we have that a≠i.
Intuitively, if a train is positioned on a locked section, it becomes immobilized and is unable to transition to another section within the railway station. Take, for instance, section S4 in Figure 9, which is a locked section. As observed in Example 4.1, neither (4,3) nor (4,5) belong to P. Consequently, if a train is placed on S4, it becomes 'locked' in place, as it is incapable of moving to either section S3 or S5.
Once locked sections are defined, we define the concept of the extended interlocking problem (Definition 5.2) and the conditions that it must fulfill to be in a dangerous situation (Defintion 5.3).
Definition 5.2. Let E be a railway network. An extended interlocking problem is a (P,S,T,Q) where:
● P is a configuration of the railway network.
● S is a multiset of locked sections in P.
● T,Q are multisets of sections.
Definition 5.3. We will say that the railway interlocking problem (P,S,T,Q) is in a dangerous situation if and only if there are two lists of integers (we will call them 'paths') [u1,…un] and [v1,…vm] such that all the following conditions hold:
(1) For all 0<i<n, we have that (ui,ui+1)∈P.
(2) For all 0<j<m, we have that (vj,vj+1)∈P.
(3) {u1,v1}⊆S∪T∪Q and u1∈S∪Q.
(4) un=vm.
(5) For all 1<i<n ui∉S∪Q and for all 1<j<m vj∉S∪Q.
(6) For all 1<i<n and for all 1<j<m we have ui≠vj.
(7) For all i≠j we have ui≠uj.
(8) For all i≠j we have vi≠vj.
We will say that the railway interlocking problem (P,S,T,Q) is in a safe situation if and only if (P,S,T,Q) is not in a dangerous situation.
Remark 5.1. As may be seen in Definition 4.5 and Definition 5.3, any interlocking problem (P,Q) can be regarded as the extended interlocking problem (P,∅,∅,Q).
Remark 5.2. Referring to Definition 4.5 and Definition 5.3, we can deduce that an extended interlocking problem (P,S,T,Q) is in a dangerous situation if, and only if, there exists some t∈T such that the interlocking problem (P,S∪{t}∪Q) is also in a dangerous situation.
Once we define the concept of the extended interlocking problem, we will analyze the set of extended interlocking problems for a specific railway station by means of a binary relation: 'derived from'. This relation is the reflexive and transitive closure of another one, 'directly derived from'.
Definition 5.4. Let (P1,S1,T1,Q1) and (P2,S2,T2,Q2) be two extended interlocking problems of a railway network E. We say that (P2,S2,T2,Q2) is directly derived from (P1,S1,T1,Q1) if and only if one of these conditions holds:
i) T1=∅;t∈Q1 and we have that:
P2=P1;T2={t};S2=S1;Q2=Q1−{t} |
ii) T1=T∪{t,t} and we have that:
P2=P1;T2=T∪{t};S2=S1;Q2=Q1 |
iii) If all sections in T1 are locked in P1, a section t∈T1 is not repeated in T1 and we have that:
P2=P1;T2=T1−{t};S2=S1∪{t};Q2=Q1 |
iv) S1=S2; Q1=Q2; and ∃(i,j)∈P1 such that:
– i∈T1.
– P2=P1−{(i,j)}.
– T2=T1∪{j}.
Definition 5.5. We define the relation 'is derived from' as the reflexive and transitive closure of the relation 'is directly derived from'. That is to say, (P2,S2,T2,Q2) is derived from (P1,S1,T1,Q1), and we denote (P1,S1,T1,Q1)⇝(P2,S2,T2,Q2), if and only if one of these conditions holds:
i) P1=P2; S1=S2; T1=T2; and Q1=Q2;
ii) (P2,S2,T2,Q2) is directly derived from (P1,S1,T1,Q1),
iii) There is an extended interlocking problem (P3,S3,T3,Q3) such that it is directly derived from (P1,S1,T1,Q1) and (P3,S3,T3,Q3)⇝(P2,S2,T2,Q2).
Remark 5.3. It is important to note that the relation ⇝ is not symmetric. In other words, while it is possible for (P1,S1,T1,Q1)⇝(P2,S2,T2,Q2) to hold true, the reverse, (P2,S2,T2,Q2)⇝̸(P1,S1,T1,Q1), may also be true.
Although an extended interlocking problem is an abstract concept, it is indeed the cornerstone of our approach. We aim to provide some intuition about this abstract concept. As per Remark 5.2, an extended interlocking problem (P,S,T,Q) is associated with multiple interlocking problems, specifically one for each t∈T. An extended interlocking problem (P,S,T,Q) is in a dangerous situation if and only if there exists a t∈T such that the interlocking problem (P,S∪{t}∪Q) is also in a dangerous situation. Consequently, the extended interlocking problem (P,S,T,Q) provides insights into the solutions of numerous simple interlocking problems, one for each t∈T. If the extended interlocking problem (P,S,T,Q) is in a safe situation, then we can infer that, for every t∈T, the interlocking problem (P,S∪Q∪{t}) is also in a safe situation. Conversely, if (P,S,T,Q) is in a dangerous situation, it implies that there exists a t∈T such that (P,S∪{t}∪Q) is in a dangerous situation.
In this way, the multisets S, T, and Q represent sections of the railway station where trains are, or may potentially be, located:
● For each s∈S, it is assumed that a train is positioned on the section s. Additionally, we know that section a is locked.
● For each q∈Q, it is assumed that a train is positioned on section q.
● It is known that there is precisely one train positioned in one of the sections in T.
In Figure 12, we elucidate this concept by illustrating the extended interlocking problem (P,S,T,Q)=(P,{4},{6,7,8},{1,10}) for the railway station shown in Figure 8, along with its associated simple interlocking problems. The components of this problem are defined as follows:
● P={(1,2),(9,10),(10,11),(2,3),(3,4),(11,6),(6,7),(7,8),(2,1),(11,10),(5,4),(3,2), (6,11),(8,7),(5,6)}
● S={4}, represented by red rectangles. As can be observed, section S4 is a locked section, implying that a train cannot move from S4 to another section.
● T={6,7,8}, represented by yellow rectangles in sections S6, S7, and S8.
● Q={1,10}, represented by black rectangles in sections S1 and S10.
Given that T={6,7,8}, the extended interlocking problem (P,{4},{6,7,8},{1,10}) is associated with the following simple interlocking problems: (P,{4,8,1,10}), (P,{4,7,1,10}), and (P,{4,6,1,10}), as illustrated in Figure 13. Since the simple interlocking problem (P,{4,6,1,10}) is in a dangerous situation, it follows that the extended interlocking problem (P,{4},{6,7,8},{1,10}) is also in a dangerous situation.
In previous section we introduced a 'derived from' relation between extended interlocking problems. This relation plays a pivotal role in determining whether the extended interlocking problem (P,S,T,Q) is in a dangerous situation. As we will see in Proposition 5.4, if (P,S,T,Q)⇝(P′,S′,T′,Q′), then (P,S,T,Q) is in a dangerous situation if and only if (P′,S′,T′,Q′) is in a dangerous situation.
In Figure 13, we illustrate this 'derived from' relation for the extended interlocking problem (P,∅,∅,{1,4,6,8}), which is equivalent to the interlocking problem (P,{1,4,6,8}).
● (P,∅,∅,{1,4,6,8})⇝(P,∅,{8},{1,4,6}) by ⅰ) in Definition 5.4. Just observe that (P,∅,{8},{1,4,6})⇝̸(P,∅,∅,{1,4,6,8}), as this relation is not symmetric (see Remark 5.3). As we will see in the next section, (P,∅,∅,{1,4,6,8}) is in a dangerous situation if and only if (P,∅,{8},{1,4,6}) is.
● (P,∅,{8},{1,4,6})⇝(P2,∅,{8,7},{1,4,6}) by iv) in Definition 5.4 where P2=P−{(8,7)}. As we will see in the next section, (P,∅,{8},{1,4,6}) is in a dangerous situation if and only if (P2,∅,{8,7},{1,4,6}) is.
● (P2,∅,{8,7},{1,4,6})⇝(P3,∅,{8,8,7},{1,4,6}) by iv) in Definition 5.4 where P3=P2−{(7,8)}. As we will see in the next section, (P2,∅,{8,7},{1,4,6}) is in a dangerous situation if and only if (P3,∅,{8,8,7},{1,4,6}) is.
● (P3,∅,{8,8,7},{1,4,6})⇝(P3,∅,{8,7},{1,4,6}) by ⅱ) in Definition 5.4. As we will see in the next section, (P3,∅,{8,8,7},{1,4,6}) is in a dangerous situation if and only if (P3,∅,{8,7},{1,4,6}) is.
● (P3,∅,{8,7},{1,4,6})⇝(P3,{8,7},∅,{1,4,6}) by ⅲ) in Definition 5.4 because {8,7} does not contain repeated elements and sections S8 and S7 are locked. As we will see in the next section, (P3,∅,{8,7},{1,4,6}) is in a dangerous situation if and only if (P3,{8,7},∅,{1,4,6}) is.
● (P3,{8,7},∅,{1,4,6})⇝(P3,{8,7},{6},{1,4}) by ⅰ) in Definition 5.4. As we will see in the next section, (P3,{8,7},∅,{1,4,6}) is in a dangerous situation if and only if (P3,{8,7},{6},{1,4}) is.
● (P3,{8,7},{6},{1,4})⇝(P4,{8,7},{6,7},{1,4}) by iv) in Definition 5.4 where P4=P3−{(6,7)}. As we will see in the next section, (P3,{8,7},{6},{1,4}) is in a dangerous situation if and only if (P4,{8,7},{6,7},{1,4}) is.
● (P4,{8,7},{6,7},{1,4})⇝(P4,{8,7,6,7},∅,{1,4}) by ⅲ) in Definition 5.4 because {6,7} does not contain repeated elements and sections S6 and S7 are locked. As we will see in the next section, (P4,{8,7},{6,7},{1,4}) is in a dangerous situation if and only if (P4,{8,7,6,7},∅,{1,4}) is.
In this way, the extended interlocking problem (P,∅,∅,{1,4,6,8}), or, equivalently, the simple interlocking problem (P,{1,4,6,8}), is in a dangerous situation if and only if (P4,{8,7,6,7},∅,{1,4}) is in a dangerous situation. The latter is indeed in a dangerous situation due to the repetition of 7 in the set {8,7,6,7}, as per Proposition 5.1.
Under some conditions, we can easily determine if an extended interlocking problem is in a dangerous situation (see Proposition 5.1 and Proposition 5.2). Besides, Proposition 5.4 relates the problem of determining if an extended interlocking problem is in a dangerous situation with another one.
First, we will prove Proposition 5.1 and Proposition 5.2.
Proposition 5.1. Let (P,S,T,Q) be an extended interlocking problem. If S∪Q contains repeated elements, (P,S,T,Q) is in a dangerous situation.
Proof.- Let {u,v}⊆S∪Q such that u=v (that is to say, u is repeated in S∪Q). Let [u] and [v] be two lists of integers, each containing a single integer. We have that [u] and [v] fulfill conditions in Definition 5.3.
Proposition 5.2. Let (P,S,∅,∅) an extended interlocking problem. We have that (P,S,∅,∅) is in a dangerous situation if and only if S contains repeated elements.
Proof.-
⇒) Let [u1,…un] and [v1…vm] be paths fulfilling conditions in Definition 5.3. By ⅱ) in Definition 5.3, we have that {u1,v1}⊆S∪T∪Q=S. Therefore, we have that u1 and v1 are locked sections in P. Consequently, by condition (2) and (3) in Definition 5.3, we have that n=1 and m=1. By (4) in Definition 5.3, we have that u1=un=vm=v1 and, therefore, S contains repeated elements.
⇐) This is an immediate consequence of Proposition 5.1.
Next, we will show an important proposition about the relation 'derived from' between extended interlocking problems.
Proposition 5.3. Let (P1,S1,T1,Q1),(P2,S2,T2,Q2) be two extended interlocking problems such that (P2,S2,T2,Q2) is directly derived from (P1,S1,T1,Q1). We have that:
(P1,S1,T1,Q1)isinadangeroussituation⇔(P2,S2,T2,Q2)isinadangeroussituation. |
Proof.- We will consider the four conditions in Definition 5.4.
Condition ⅰ). We will consider that T1=∅; T2={t} where t∈Q1; S2=S1 and Q2=Q1−{t}.
⇒) Let [u1…un] and [v1,…vm] be paths fulfilling Definition 5.3 for (P1,S1,T1,Q1). We will consider the following cases:
Case u1=t=v1. We will prove that [t] and [t] are paths fulfilling Definition 5.3 for (P2,S2,T2,Q2).
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {t,t}⊆S1∪T1∪Q1=S2∪T2∪Q2. Since T2={t}, we have that {t,t}⊆S2∪{t}∪Q2. Consequently, we have that t∈S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). This is immediately proved since S2∪Q2⊆S1∪Q1.
Case u1≠t. We have that [u1…un] and [v1,…vm] are paths fulfilling Definition 5.3 for (P2,S2,T2,Q2).
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {u1,v1}⊆S1∪T1∪Q1=S2∪T2∪Q2. Since u1∈S2∪T2∪Q2=S2∪{t}∪Q2 and u1≠t, we have that u1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). This is immediately proved since S2∪Q2⊆S1∪Q1.
Case v1≠t. We will prove that [v1,…vm] and [u1…un] are paths fulfilling Definition 5.3 for (P2,S2,T2,Q2).
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {u1,v1}⊆S1∪T1∪Q1=S2∪T2∪Q2. Since v1∈S2∪T2∪Q2=S2∪{t}∪Q2 and v1≠t, we have that v1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). This is immediately proved since S2∪Q2⊆S1∪Q1.
⇐) Let [u1…un] and [v1,…vm] be paths fulfilling Definition 5.3 for (P2,S2,T2,Q2). We will consider the following cases:
Case. There exists i such that ui=t. We have that [u1…ui−1,ui] and [t] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1):
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {u1,v1}⊆S1∪T1∪Q1=S2∪T2∪Q2. We have also that u1∈S2∪Q2⊆S1∪Q1.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). Let j be such that 1<j<i. We have that uj∈S2∪Q2∪{t}. By condition (6) we have that uj≠ui=t. Therefore, we have that uj∈S2∪Q2.
Case. There exists i such that vi=t. We have that [t] and [v1…vi−1,vi] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1):
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {u1,v1}⊆S1∪T1∪Q1=S2∪T2∪Q2. We have also that u1∈S2∪Q2⊆S1∪Q1.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). Let j be such that 1<j<i. By condition (5) we have that vj∈S2∪Q2∪{t}. By condition (6) we have that vj≠vi=t. Therefore, we have that vj∈S2∪Q2.
Case. For all i we have that ui≠t and vi≠t. We can prove that [u1…un] and [v1,…vm] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1):
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {u1,v1}⊆S1∪T1∪Q1=S2∪T2∪Q2. We have also that u1∈S2∪Q2⊆S1∪Q1.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). We have that ui∉S2∪Q2 and vi∉S2∪Q2. Since ui≠t and vi≠t, we have that ui∉S2∪Q2∪{t}=S1∪Q1 and vi∉S2∪Q2∪{t}=S1∪Q1.
Condition ⅱ). We will consider that T1=T∪{t,t}, T2=T∪{t}, P2=P1, S2=S1, Q2=Q1.
It is immediate to prove that [u1…un] and [v1,…vm] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1) if and only if [u1…un] and [v1,…vm] fulfill Definition 5.3 for (P2,S2,T2,Q2).
Condition ⅲ). We will consider that t is not repeated in T1; all sections in T1 are locked in P1; P2=P1; T2=T1−{t}; S2=S1∪{t}; Q2=Q1.
We have that S2∪T2∪Q2=S1∪{t}∪T2∪Q1=S1∪T1∪Q1.
⇒) Let [u1…un] and [v1,…vm] be paths fulfilling Definition 5.3 for (P1,S1,T1,Q1). We will prove that [u1…un] and [v1,…vm] fulfill Definition 5.3 for (P2,S2,T2,Q2).
Conditions (1), (2). They hold because P1=P2.
Condition (3). We have that {u1,v1}⊆S1∪T1∪Q1=S2∪T2∪Q2 and u1∈S1∪Q1⊆S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (5). Let i be such that 1<i<n. We have that ui∉S1∪Q1. Since t is a locked section in P1, we have that ui≠t. Consequently, we have that ui∉S1∪Q1∪{t}=S2∪Q2. Consequently, for all 1<i<n we have that ui∉S2∪Q2. In the same way, we can prove that for all 1<j<m, vj∉S2∪Q2.
⇐) Let [u1,…un] and [v1…vm] be paths fulfilling Definition 5.3 for (P2,S2,T2,Q2).
We will consider two possible cases:
Case u1=t. We will prove that [v1…vm] and [t] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1).
Conditions (1), (2). They hold because P1=P2.
Condition (5). Immediately proved since S1∪Q1⊂S2∪Q2
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (3). We have that {v1,t}={v1,u1}⊆S2∪T2∪Q2=S1∪T1∪Q1. We will prove that v1∈S1∪Q1 by considering the following subcases:
Case v1∉T1. Since v1∈S1∪T1∪Q1 and v1∉T1, we have that v1∈S1∪Q1.
Case v1∈T1. Since T1 are locked sections in P2=P1 and [t] and [v1…vm] are paths fulfilling Definition 5.3 for (P2,S2,T2,Q2), we have that m=1, v1=t, and, by condition (3), {t,t}⊆S2∪T2∪Q2=S1∪T1∪Q1. Since t is not repeated in T1, we have that v1=t∈S1∪Q1.
Case u1≠t. We will prove that [u1,…un] and [v1,…vm] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1)
Conditions (1), (2). They hold because P1=P2.
Condition (5). Immediately proved since S1∪Q1⊂S2∪Q2
Conditions (4), (6), (7), (8). They are immediately proved.
Condition (3). We have that {u1,v1}⊆S2∪T2∪Q2=S1∪T1∪Q1. Since u1∈S2∪Q2=S1∪{t}∪Q1 and u1≠t, we have that u1∈S1∪Q1.
Condition ⅳ). We will consider that S1=S2; Q1=Q2; (i,j)∈P1; i∈T1; P2=P1−{(i,j)}; T2=T1∪{j}. We will consider the following cases:
⇒) Let [u1,…un] and [v1…vm] be two paths fulfilling Definition 5.3 for (P1,S1,T1,Q1).
Case 1. ∃k where 1≤k≤n such that (uk,uk+1)=(i,j). We will prove that [u1,…,uk] and [uk] fulfill all conditions in Definition 5.3 for (P2,S2,T2,Q2).
Condition (1) Let k′<k. We have that uk′≠uk=i. Consequently, (uk′,uk′+1)≠(i,j) and we have that (uk′,uk′+1)∈P2.
Condition (3). We have that u1∈S1∪Q1=S2∪Q2. We have that uk=i∈T2. Since u1≠uk, we have that {u1,uk}⊆S2∪T2∪Q2.
Condition (5). Immediately proved since S1∪Q1=S2∪Q2.
Conditions (2), (4), (6), (7), (8). They are immediately proved.
Case 2. Case 1 does not hold and ∃k′ where 1≤k′≤m such that (vk′,vk′+1)=(i,j). We will prove that [u1,…,un] and [vk′+1…vm] fulfill all conditions in Definition 5.3 for (P2,S2,T2,Q2).
Condition (1). Immediately proved since Case 1 does not hold.
Condition (2). Immediately proved since (vk′,vk′+1)=(i,j), and for every k″>k′ we have that vk″≠vk′=i, and consequently (vk″,vk″+1)∈P2.
Condition (3). We have that u1∈S1∪Q1=S2∪Q2. We have also that vk′+1=j∈T2. Since u1≠vk′+1, we have that {u1,vk′+1}∪S2∪T2∪Q2.
Condition (5). Immediately proved since S1∪Q1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Case 3. Neither Case 1 nor Case 2 holds. We will prove that [u1…un] and [v1…vm] fulfill all conditions in Definition 5.3 for (P2,S2,T2,Q2).
Conditions (1), (2). Immediately proved since neither Case 1 nor Case 2 holds.
Condition (3). We have that u1∈S1∪Q1=S2∪Q2. We have that v1∈S1∪T1∪Q1⊂S2∪T2∪Q2. Since u1≠v1 we have that {u1,v1}∪S2∪T2∪Q2.
Condition (5). Immediately proved since S1∪Q1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
⇐) Let [u1…un] and [v1…vm] be paths fulfilling Definition 5.3 for (P2,S2,T2,Q2).
We have that u1∈S2∪Q2=S1∪Q1. We will consider the following cases:
Case 1. v1∉T2. We will prove that [u1…un] and [v1…vm] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1).
Conditions (1), (2). Immediately proved since P2⊂P1.
Condition (3). We have that u1∈S2∪Q2=S1∪Q1.
Since v1∉T2, we have that v1∈S2∪Q2=S1∪Q1.
Since u1≠v1, we have that {u1,v1}⊆S1∪Q1⊆S1∪T1∪Q1.
Condition (5). Immediately proved since S1∪Q1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Case 2. v1∈T2 and v1≠j. We will prove that [u1,…,un] and [v1,…,vm] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1).
Conditions (1), (2). Immediately proved since P2⊂P1.
Condition (3). We have that u1∈S2∪Q2=S1∪Q1.
Since v1∈T2=T1∪{j} and v1≠j, we have that v1∈T1⊆S1∪T1∪Q1.
Since u1≠v1, we have that {u1,v1}⊆S1∪T1∪Q1.
Condition (5). Immediately proved since S1∪Q1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Case 3. v1∈T2 and v1=j. We will prove that [u1,…,un] and [i,v1,…,vm] are paths fulfilling Definition 5.3 for (P1,S1,T1,Q1).
Condition (1). Immediately proved since P2⊂P1.
Condition (2). Immediately proved since P2⊂P1 and (i,j)∈P1.
Condition (3). We have that u1∈S2∪Q2=S1∪Q1.
Since i∈T1, we have that i∈S1∪T1∪Q1.
Since i∈T1 and u1∈S1∪Q1, we have that {u1,i}⊆S1∪T1∪Q1.
Condition (5). Immediately proved since S1∪Q1=S2∪Q2.
Conditions (4), (6), (7), (8). They are immediately proved.
Proposition 5.4. Let (P1,S1,T1,Q1),(P2,S2,T2,Q2) be two extended interlocking problems such that (P1,S1,T1,Q1)⇝(P2,S2,T2,Q2). We have that:
(P1,S1,T1,Q1)isinadangeroussituation⇔(P2,S2,T2,Q2)isinadangeroussituation. |
Proof.- This is an immediate consequence of Definition 5.5 and Proposition 5.3.
Drawing upon the findings presented in Section 5, we could devise an algorithm to detect dangerous situations in interlocking problems. This algorithm would operate by iteratively transforming a given interlocking problem into derived extended interlocking problems until it can definitively be verified whether a dangerous situation exists. Indeed, an algorithm of linear complexity with respect to the number of sections is detailed in the appendix.
In this section we will demonstrate that the task of detecting dangerous situations can be expressed in algebraic terms. As it will be discussed in Theorem 6.3, the polynomial division algorithm can serve as the mechanism for identifying dangerous situations. Here, we will outline this polynomial-based representation and subsequently establish that the task of identifying dangerous situations is equivalent to the algebraic problem of computing the remainder of a monomial upon division by a set of polynomials.
In this section, we will briefly describe some essential results about polynomial rings, which will be used to prove the validity of our approach. For a detailed introduction to the topic, see [17].
We will consider the polynomial ring Z2[x1…xN] in the variables x1…xN. Since the coefficients of the polynomials lie in Z2, we have that monomials are a product of the form xα11⋅xα22⋅…xαNN, and a polynomial is a finite sum of monomials ∑α=(α1,α2,...,αN)xα11xα22…xαNn.
For example, we have that x1x2x3 and x1x2+x3+x2x3 are, respectively, a monomial and a polynomial in Z2[x1,x2,x3].
If we consider the order of variables x1>x2…>xm, we can define a lexicographical order for the monomials on Z2[x1…xN] (see [17], pp. 52–57). According to this lexicographical order, x1x2x4>x2x3.
Based on this lexicographical order, we define the leading term of a polynomial:
Definition 6.1. The leading term of a polynomial p∈Z2[x1,…,xN], denoted LT(p), is its greatest monomial of the polynomial.
For example, in Z2[x1,x2,x3], we have that LT(x21+x1x2x3+x3)=x21.
This lexicographical order leads us to define a kind of division algorithm on polynomials in Z2[x1,…,xN].
Theorem 6.1. Let p∈Z2[x1…xN] and a finite list of polynomials on E=[f1,…,fm] (where fi∈Z2[x1…xN]). We have that
p=α1f1+…+αmfm+r |
where α1,…,αm,r∈Z2[x1,…,xN] and either r=0 or r is a linear combination of monomials, none of which is divisible by any of LT(f1)…LT(fm).
A proof can be found on pages 62–64 in [17].
The remainder of p on division by E is denoted by NR(p,E). The proof in [17] (pp. 62-64) provides an algorithm to find the polynomials α1,…αm,r∈Z2[x1,…,xN] in Theorem 6.1. In each step of this algorithm, we obtain a sequence of intermediate-dividends. For our purpose, we will require only some of the first intermediate-dividends of this algorithm.
Notation 6.1. We will use the notation a|b to refer to the polynomial a divides the polynomial b. Similarly, we will say a⧸|b to refer to a does not divide b.
Definition 6.2. Given p∈Z2[x1,…,xN] and a finite list of polynomials E=[f1…fm], we recursively define the first-intermediate-dividends of p on division by E, r0,…,rn∈Z2[x1,…,xN], as follows:
● r0=p,
● if i>0, then
– if ∃j∈{1,…,m} such that LT(fj)|LT(ri), then
ri+1=ri−LT(ri)LT(fk)fk |
where k is the minimum j such that LT(fj)|LT(ri),
– if ∀j∈{1,…,m},LT(fj)⧸|LT(ri) then rn=ri.
According to the proof in [17] (pp. 62-64), we have:
Proposition 6.1. Let p∈Z2[x1,…,xN] and let E=[f1,…,fm] be a list of polynomials in Z2[x1,…,xN]. Let r0,…rn∈K[x1,…,xN] be the first-intermediate-dividends of p on division by E. We have that:
rn=0ifandonlyifNR(p,E)=0 |
The Computer Algebra System, CoCoA, implements an algorithm for automatically calculating NR. For instance, if we want to calculate NR(x2+xyz,{y2+z,x2+yz}) in the ring Z2[x,y,z] with x>y>z, we only need to follow these steps:
First, we define the ring using the following syntax:
useZZ/(2)[x,y,z],lex;
Next, input the following command:
NR(x3+x2∗y∗z,[x2+y∗z,y+z]);
The output will be:
x∗z∧2+z∧4
As you can see, we have:
x3+x2yz=(x+yz)⋅(x2+yz)+(xz+yz2+z3)⋅(y+z)+(xz2+z4) |
We will represent a railway station by means of a list of polynomials on the following variables:
● lij: The variable li,j for each pair of sections Si and Sj where (i,j)∈E. That is to say, we define the variable li,j if the topology of the station allows for passage from section Si to section Sj (in some configuration of the railway station).
● qi,ti,si: The variables qi, ti, and si for each section Si in the railway network ‡.
‡Intuitively, these variables refer to whether the section is in the multisets Q, T, or S.
Once these variables are defined, we will represent the railway station by the list of polynomials E on
A=Z2[li,j,…,qi,…,ti,…,si…] |
Observe that the number of variables in A is 3N+K, where N is the number of sections and K is the size of E.
Definition 6.3. We define E as the list of polynomials in A formed by:
● ∀(i,j)∈E, the polynomial:
lijti+titj |
● For each section Si, the four polynomials:
t2i+ti |
s2i |
ti+si |
qi+ti |
Observe that the number of polynomials in E is 4N+K, where N is the number of sections and K is the size of E.
Example 6.1. Let us recall the set E of the railway station of Example 4.1. Let us remember that in this case:
E={(1,2),(2,9),(9,10),(10,11),(11,6),(2,3),(3,4),(4,5),(5,6),(6,7),(7,8)(2,1),(9,2),(10,9),(11,10),(6,11),(3,2),(4,3),(5,4),(6,5),(7,6),(8,7)} |
Consequently, we will consider the following variables:
● Variables: l1,2,l2,9,l9,10,l10,11,l11,6,l2,3,l3,4,l4,5,l5,6,l6,7,l7,8,l2,1,l9,2,l10,9,l11,10,l6,11,l3,2,l4,3,l5,4,l6,5,l7,6,l8,7
and
● Variables: q1…,q11,t1…t11,s1,…,s11 (since this railway station contains 11 sections)
Once the variables are defined, we define the list E in this ring:
● l1,2t1+t1t2 (because (1,2)∈E),
● l2,9t2+t2t9 (because (2,9)∈E),
● …
● t21+t1,t22+t2,…,t211+t11,
● s21,s22,…,s211,
● t1+s1,t2+s2,…t11+s11,
● q1+t1,q2+t2,…q11+t11,
In this section we will represent an extended interlocking problem (P,S,T,Q) by means of a monomial, ϕ(P,S,T,Q):
Definition 6.4. Given the interlocking problem (P,S,T,Q) for a railway station, we define ϕ(P,S,T,Q) as the monomial in A:
ϕ(P,S,T,Q)=ϕP⋅ϕS⋅ϕT⋅ϕQ |
where:
● ϕP is a monomial representing the set P defined as:
ϕP=∏(i,j)∈Plij |
● ϕS is a monomial representing the set S defined as:
ϕS=∏i∈Ssi |
● ϕT is a monomial representing the set T defined as:
ϕT=∏i∈Tti |
● ϕQ is a monomial representing the set Q defined as:
ϕQ=∏i∈Qqi |
Example 6.2. We will consider the interlocking problem (P,Q) depicted in Figure 10.
As we stated in Remark 5.1, an interlocking problem (P,S) can be understood as an extended interlocking problem (P,∅,∅,Q). We will represent it by means of monomials:
The monomial ϕP. Remember that P is (see Example 9):
P={(1,2),(9,10),(10,11),(2,3),(3,4),(11,6),(6,7),(7,8),(2,1),(11,10),(5,4),(3,2),(6,11),(8,7),(5,6)} |
Consequently, we have that:
ϕP=l1,2l9,10l10,11l2,3l3,4l11,6l6,7l7,8l2,1l11,10l5,4l3,2l6,11l8,7l5,6 |
The monomial ϕS. Since S=∅, we have that:
ϕS=1 |
The monomial ϕT. Since T=∅, we have that:
ϕT=1 |
The monomial ϕQ. Since Q={1,10}, we have that:
ϕQ=q1q10 |
Consequently, the extended interlocking problem (P,∅,∅,Q) depicted in Figure 10 is represented by the monomial:
ϕPϕSϕTϕQ=ϕPϕQ=l1,2l9,10l10,11l11,6l2,3l3,4l5,6l6,7l7,8l2,1l11,10l6,11l3,2l5,4l8,7⋅q1q10 |
In this section, we will show that we can determine if an extended interlocking problem is in a dangerous situation by means of the division algorithm.
According to the next lemma, we have that each first intermediate dividend of NR(ϕ(P,S,T,Q),E) is a monomial representing an extended interlocking problem derived from (P,S,T,Q).
Lemma 6.2. Let (P,S,T,Q) be an extended interlocking problem for a railway network E. Letting r0,r1…rn be the first-intermediate-dividends of NR(ϕ(P,S,T,Q),E), we have that:
i) For every i<n there is an extended interlocking problem (Pi,Si,Ti,Qi) such that ϕ(Pi,S,Ti,Qi)=ri and (P,S,T,Q)⇝(Pi,Si,Ti,Qi).
ii) If NR(ϕ(P,S,T,∅),E)≠0, there is an extended interlocking problem (Pn,Sn,∅,∅) such that ϕ(Pn,Sn,∅,∅)=rn, (P,S,T,Q)⇝(Pn,Sn,∅,∅) and Sn does not contain repeated elements.
Proof.-
ⅰ) For i=0, we have that (P0,S0,T0,Q0)=(P,S,T,Q), r0=ϕ(P0,S0,T0,Q0)=ϕ(P,S,T,Q), and (P,S,T,Q)⇝(P,S,T,Q)=(P0,S0,T0,Q0).
Suppose that 0<i<n, ri−1=ϕ(Pi−1,Si−1,Ti−1,Qi−1) and (P,S,T,Q)⇝(Pi−1,Si−1,Ti−1,Qi−1). We will prove that ri=ϕ(Pi,Si,Ti,Qi) for an extended interlocking problem (Pi,Si,Ti,Qi), such that (Pi,Si,Ti,Qi) is directly derived from (Pi−1,Si−1,Ti−1,Qi−1), and, consequently, we have that (P,S,T,Q)⇝(Pi,Si,Ti,Qi).
According to Definition 6.2, we have that
ri=ri−1−LT(ri−1)LT(fk)fk |
where fk is a polynomial in E such that LT(fk)|LT(ri−1). Since ri−1 is a monomial, we have that LT(ri−1)=ri−1=ϕ(Pi−1,Si−1,Ti−1,Qi−1)=ϕPi−1ϕSi−1ϕTi−1ϕQi−1 where:
– ϕPi−1 only contains variables with the form lxy.
– ϕSi−1 only contains variables with the form sx.
– ϕTi−1 only contains variables with the form tx.
– ϕQi−1 only contains variables with the form qx.
Besides, we have that fk≠s2k. Otherwise, we would have that fk and ri−1 are monomials, and LT(fk)=fk and LT(ri−1)=ri−1. Since LT(fk)|LT(ri−1) (this means in our case, fk|ri−1), we have that ri=ri−1−ri−1fkfk=0, and therefore i=n (but we have supposed that i<n).
Consequently, there are the following cases left:
Case fk=lxytx+txty. Since LT(fk)|LT(ri−1), we have that lxytx|ϕ(Pi−1,Si−1,Ti−1,Qi−1). Thus, we have that lxy|ϕPi−1 and tx|ϕTi−1. Consequently:
– ϕPi−1 is of the form ϕPi−1=p⋅lxy where p is a monomial, and therefore, (x,y)∈Pi−1.
– ϕTi−1 is of the form ϕTi−1=w⋅tx where w is a monomial, and therefore, x∈Ti−1.
We define:
– ϕPi=p where Pi=Pi−1−{(x,y)}.
– ϕTi=w⋅txty where Ti=Ti−1∪{y}.
Therefore, we have that:
ri=ri−1−LT(ri−1)LT(fk)fk=p⋅w⋅txty⋅ϕSi−1ϕQi−1=ϕ(Pi,Si−1,Ti,Qi−1) |
By ⅳ) in Definition 5.4, (Pi,Si−1,Ti,Qi−1) is directly derived from (Pi−1,Si−1,Ti−1,Qi−1).
Case fk=t2x+tx. Since LT(fk)|LT(ri−1) and LT(fk)=t2x, we have that t2x|ϕ(Pi−1,Si−1,Ti−1,Qi−1). Thus, we have that t2x|ϕTi−1. Consequently:
– ϕTi−1 is of the form ϕTi−1=w⋅t2x where w is a monomial. We have also that Ti−1=T∪{x,x}.
We define:
– ϕTi=w⋅tx where Ti=T∪{x}.
Therefore, we have that
ri=ri−1−LT(ri−1)LT(fk)fk=w⋅tx⋅ϕPi−1ϕSi−1ϕQi−1=ϕ(Pi−1,Si−1,Ti,Qi−1) |
By ⅱ) in Definition 5.4, (Pi−1,Si−1,Ti,Qi−1) is directly derived from (Pi−1,Si−1,Ti−1,Qi−1).
Case fk=tx+sx. Since LT(fk)|LT(ri−1) and LT(fk)=tx, we have that tx|ϕ(Pi−1,Si−1,Ti−1,Qi−1). Thus, we have that tx|ϕTi−1. Consequently:
– ϕTi−1 is of the form ϕTi−1=w⋅tx where w is a monomial. We have also that x∈Ti−1.
The fact that fk is tx+sx, instead of previous polynomials in E involves the following facts:
– Every section in Ti−1 is locked in Pi−1. Otherwise, if y∈Ti−1 were not locked, we would have that there is a section z such that (y,z)∈Pi−1. Consequently, we have that LT(ly,zty+tytz)|ri−1. Since ly,zty+tytz is in a lower position on the list E than the polynomial tx+sx, the polynomial fk could not be tx+sx.
– The section x is not repeated in Ti−1. Otherwise, we would have that LT(t2x+tx)=t2x|ri−1, and since t2x+tx is in a lower position on the list E than the polynomial tx+sx, the polynomial fk could not be tx+sx.
We define:
– ϕTi=w where Ti=Ti−1−{x}.
– ϕSi=ϕSi−1⋅sx where Si=Si−1∪{x}.
Therefore, we have that:
ri=ri−1−LT(ri−1)LT(fk)fk=ϕPi−1ϕSi−1⋅sx⋅w⋅ϕQi−1=ϕ(Pi−1,Si,Ti,Qi−1) |
By ⅲ) in Definition 5.4, (Pi−1,Si,Ti,Qi−1) is directly derived from (Pi−1,Si−1,Ti−1,Qi−1).
Case fk=qx+tx. Since LT(fk)|LT(ri−1), we have that LT(qx+tx)=qx|ϕ(Pi−1,Si−1,Ti−1,Qi−1). Thus, we have that qx|ϕQi−1. Consequently:
– ϕQi−1 is of the form ϕQi−1=w⋅qx where w is a monomial. We have also that x∈Qi−1.
The fact that fk is qx+tx instead of previous polynomials in E involves the following fact:
– Ti−1 is empty. Otherwise, if y∈T, we would have that LT(ty+sy)|ri−1, and since ty+sy is in a lower position on the list E than qx+tx, fk could not be qx+tx.
We define:
– ϕTi=tx where Ti={x}.
– ϕQi=w where Qi=Qi−1−{x}.
Therefore, we have that:
ri=ri−1−LT(ri−1)LT(fk)fk=ϕPi−1ϕSi−1⋅x⋅w=ϕ(Pi−1,Si−1,Ti,Qi) |
By ⅰ) in Definition 5.4, (Pi−1,Si−1,Ti,Qi) is directly derived from (Pi−1,Si−1,Ti−1,Qi−1).
ⅱ) Given rn≠0, by applying the same line of reasoning we can establish the existence of (Pn,Sn,Tn,Qn) such that rn=ϕ(Pn,Sn,Tn,Qn) and (P,S,T,Q)⇝(Pn,Sn,Tn,Qn). Besides, for every fk∈E, we have that LT(fk)⧸|rn. Consequently:
– Qn=∅. Otherwise, we would have that LT(qx+tx)|rn for some section x
– Tn=∅. Otherwise, if y∈Tn, we would have that LT(ty+sy)|rn.
– Sn does not have repeated elements. Otherwise, if x were repeated in Sn, we would have that LT(s2x)|rn.
Theorem 6.3. Let (P,S,T,Q) be an extended interlocking problem for a railway network E. We have that:
(P,S,T,Q)isinadangeroussituation⇔NR(ϕ(P,S,T,Q),E)=0 |
Proof.- Let r0,r1…rn be the first intermediate remainders of NR(ϕ(P,S,T,∅),E).
⇒) We will prove that, if NR(ϕ(P,S,T,Q),E)≠0, we have that (P,S,T,Q) is not in a dangerous situation.
Let us consider that NR(ϕ(P,S,T,Q),E)≠0. By ⅱ) in Lemma 6.2, we have that there is an extended interlocking problem (Pn,Sn,∅,∅) such that ϕ(Pn,Sn,∅,∅)=rn, (P,S,T,Q)⇝(Pn,Sn,∅,∅) and Sn has no repeated elements. Consequently, by Proposition 5.2, we have that (Pn,Sn,∅,∅) is not in a dangerous situation. By Proposition 5.4, (P,S,T,Q) is not in a dangerous situation.
⇐) Suppose that NR(ϕ(P,S,T,Q),E)=0. According to Proposition 6.1, we have that rn=0.
Let (Pn−1,Sn−1,Tn−1,Qn−1) such that ϕ(Pn−1,Sn−1,Tn−1,Qn−1)=rn−1. According to Definition 6.2, we have that
rn=rn−1−LT(rn−1)LT(fk)fk |
where fk is a polynomial in E such that LT(fk)|LT(rn−1).
Since rn−1 is a monomial and rn=0, we have that fk must be a monomial and, consequently, fk must be of the form s2x. Consequently, s2x|ϕSn−1, and therefore Sn−1 contains the section x repeated. By Proposition 5.1, (Pn−1,Sn−1,Tn−1,Qn−1) is in a dangerous situation. Since (P,S,T,Q)⇝(Pn−1,Sn−1,Tn−1,Qn−1) (see i in Lemma 6.2), by Proposition 5.4 we have that (P,S,T,Q) is in a dangerous situation.
Corollary 6.1. Let (P,Q) be an interlocking problem for a railway network E. We have that:
(P,Q)isinadangeroussituation⇔NR(ϕPϕQ,E)=0 |
Proof.- An interlocking problem (P,Q) can be considered as an extended interlocking problem (P,∅,∅,Q) (see in Remark 5.1). This corollary is an immediate consequence of the fact that ϕ(P,∅,∅,Q)=ϕPϕQ.
In this section we will show how to use the Computer Algebra System CoCoA [18] to detect if an interlocking problem is in a dangerous situation for the railway station depicted in Figure 8.
Step 1. We will define the polynomial ring A and the list E. In Example 6.1, we calculated it. In CoCoA syntax:
useZZ/(2)[l1_2,l2_9,l9_10,l10_11,l11_6,l2_3,l3_4,l4_5,l5_6,l6_7,l7_8,l2_1,l9_2,l10_9,l11_10,l6_11,l3_2,l4_3,l5_4,l6_5,l7_6,l8_7,q[1..11],t[1..11],s[1..11]],
lex;
E:=[l1_2∗t[1]+t[1]∗t[2],l2_9∗t[2]+t[2]∗t[9],
l9_10∗t[9]+t[9]∗t[10],l10_11∗t[10]+t[10]∗t[11],
l11_6∗t[11]+t[11]∗t[6],l2_3∗t[2]+t[2]∗t[3],
l3_4∗t[3]+t[3]∗t[4],l4_5∗t[4]+t[4]∗t[5],
l5_6∗t[5]+t[5]∗t[6],l6_7∗t[6]+t[6]∗t[7],
l7_8∗t[7]+t[7]∗t[8],l2_1∗t[2]+t[2]∗t[1],
l9_2∗t[9]+t[9]∗t[2],l10_9∗t[10]+t[10]∗t[9],
l11_10∗t[11]+t[11]∗t[10],l6_11∗t[6]+t[6]∗t[11],
l3_2∗t[3]+t[3]∗t[2],l4_3∗t[4]+t[4]∗t[3],
l5_4∗t[5]+t[5]∗t[4],l6_5∗t[6]+t[6]∗t[5],
l7_6∗t[7]+t[7]∗t[6],l8_7∗t[8]+t[8]∗t[7],
t[1]2+t[1],t[2]2+t[2],t[3]2+t[3],t[4]2+t[4],t[5]2+t[5],t[6]2+t[6],
t[7]2+t[7],t[8]2+t[8],t[9]2+t[9],t[10]2+t[10],t[11]2+t[11],
s[1]2,s[2]2,s[3]2,s[4]2,s[5]2,s[6]2,s[7]2,
s[8]2,s[9]2,s[10]2,s[11]2,
t[1]+s[1],t[2]+s[2],t[3]+s[3],t[4]+s[4],t[5]+s[5],t[6]+s[6],t[7]+s[7],
t[8]+s[8],t[9]+s[9],t[10]+s[10],t[11]+s[11],
q[1]+t[1],q[2]+t[2],q[3]+t[3],q[4]+t[4],q[5]+t[5],q[6]+t[6],q[7]+t[7],
q[8]+t[8],q[9]+t[9],q[10]+t[10],q[11]+t[11]];
Step 2. For the particular configuration of the railway station in Figure 9, we calculate the monomial ϕP (see Example 6.2). In CoCoA syntax:
P:=l1_2∗l9_10∗l10_11∗l2_3∗l3_4∗l11_6∗l6_7∗l7_8∗l2_1∗l11_10∗l5_4∗l3_2∗l6_11∗l8_7∗l5_6;
Step 3. For the particular placement of trains in the railway station in Figure 10, we calculate the monomial ϕQ (see Example 6.2). In CoCoA syntax:
Q:=q[1]∗q[10];
Step 4. In order to detect if the situation is dangerous, we need to check if NR(ϕPϕQ,E)=0 (see Corollary 6.1). In CoCoA syntax:
NR(P∗Q,E)=0;
As the output of CoCoA is "false'', the proposed situation is safe.
Let us consider that a new train is placed in section S8 (depicted in Figure 11). In this case, we need first to redefine the polynomial ϕQ=q1q10q8. In CoCoA syntax:
Q:=q[1]∗q[10]∗q[8];
NR(P∗Q,E)=0;
As the output of CoCoA is "true'', the interlocking problem is in a dangerous situation.
In this section, we critically examine the effectiveness of the method proposed in this study, contrasting it with earlier algebraic strategies. We have performed a comparative study on the duration required to confirm the safety of a suggested scenario in large railway stations where paths may form cycles, altering the number of sections (N) and involved trains (M). We have disregarded the approach in [16] as it is not applicable to railway stations where paths can form cycles. The method we propose consistently surpasses others, attributed to its worst-case linear complexity. Table 1 displays the time necessary to evaluate the safety of various scenarios, excluding the model in [9] due to its inadequate performance in larger stations. These times reflect the average performance over ten different configurations (both safe and unsafe) of a railway station with N sections and M trains.
N=52 | N=156 | N=260 | N=520 | N=780 | |
M=5 | M=15 | M=25 | M=50 | M=75 | |
Model described in [11] | 15.34 s | 270.132 s | >1 h | >1h | >1h |
Model described in [10] | 35.46 s | 397.58 s | >1 h | >1h | >1h |
Model described in [12] | 3.423 s | 48.342 s | 674.245s | >1h | >1h |
Model described in [14] | 0.458 s | 1.320 s | 3.456s | >1h | >1h |
Model described in [13] | 0.050 s | 0.073 s | 1.456s | 18.356s | >1h |
Our approach in CoCoA | <0.001s | 0.036 | 0.083 s | 0.164 s | 0.324s |
Notably, our innovative approach consistently takes less than one second to evaluate the safety of the proposed scenario, even with a significant number of sections, outpacing other methods. The first column corresponds to the track layout of a former Spanish railway station, with subsequent columns representing multiple concatenations of that station. The duration accounted for by our approach includes the four steps in Section 7, encompassing the computation of the polynomials for the topology, configuration, and trains.
In Table 2, we focus on railway stations where paths do not form cycles. In such instances, we can incorporate the approach in [16]. It is evident that our current approach yields rapid results, surpassing previous methods, with the exception of [16], as it is tailored for railway stations where cycle formation is not possible. However, as previously stated, this model [16] is not suitable for scenarios where cycles can occur.
N=52 | N=156 | N=260 | N=520 | N=780 | |
M=5 | M=15 | M=25 | M=50 | M=75 | |
Model described in [11] | 10.23 s | 250.250 s | >1 h | >1h | >1h |
Model described in [10] | 15.356 s | 380.368 s | >1 h | >1h | >1h |
Model described in [12] | 1.124 s | 38.292 s | 554.180s | >1h | >1h |
Model described in [14] | 0.320 s | 0.920 s | 2.180s | >1h | >1h |
Model described in [13] | 0.020 s | 0.047 s | 1.038s | 16.458s | >1h |
Model described in [16] | <0.001s | 0.015 s | 0.078 s | 0.156s | 0.250 s |
Our approach in CoCoA | <0.001s | 0.028 s | 0.132 s | 0.187s | 0.223 s |
In this paper, we have introduced an innovative algebraic model that identifies dangerous situations in any railway station. This model surpasses limitations of previous models, including those which have circular routes. Our model provides a mathematical resolution to the interlocking problem, achieving this in linear time. In this paper, we have defined the 'interlocking problem' as a safety verification for a single run-time configuration of a station, rather than a 'command and control' function. This is a verification issue, not a solution problem, typically handled by an interlocking system receiving movement authority requests.
The position of the trains within a railway station configuration is considered dangerous if the remainder of a specific monomial divided by a list of polynomials is zero. This finding enables the immediate implementation of the solution of the interlocking system on a computer algebra system.
Although the paper presented has a significant limitation, namely its challenging practical application in actual interlocking systems due to stringent certification requirements associated with such safety-critical applications, we believe it holds considerable theoretical interest. It bridges two seemingly disconnected fields and could prove beneficial for simulations that do not require certification credit.
We believe that our approach holds mathematical significance and can be expanded in several directions:
● Create a library that facilitates the creation of list E for any topology, defines switch changes and the aspect of the color light signals through functions, and updates train movements. The polynomials P and Q are updated through multiplication and division of monomials.
● Develop a graphical environment that enables visual design of a station and obtains the polynomials in E, P, and Q in a computer algebra system like CoCoA.
● Extend the interlocking problem to encompass other problems related to expert systems in railway stations, such as automatically detecting which semaphores and switches cannot be changed because they would imply a dangerous situation. Given that our approach expresses the interlocking problem as an algebraic system similar to those used for implementing expert systems, we believe that our model can be seamlessly integrated into these expert systems.
The authors declare they have not used Artificial Intelligence (AI) tools in the creation of this article.
This work has been partially funded by the University of Málaga (Spain). This paper is dedicated to the memory of Eugenio Roanes-Lozano. Eugenio's passing occurred during our discussions on the initial ideas that form the basis of this paper. He was an exceptional researcher in various fields, one of which was his extraordinary passion for trains, as evidenced by his numerous publications on the subject.
José Luis Galán-García is the Guest Editor of special issue "Computer Algebra Systems and Dynamic Geometry Systems in Mathematics Education, Engineering and Sciences" for AIMS Mathematics. José Luis Galán-García was not involved in the editorial review and the decision to publish this article. The authors declare there are no conflicts of interest.
Based on the results presented in Section 5, we have developed an algorithm to identify dangerous situations in interlocking problems. This algorithm operates iteratively, transforming the original interlocking problem into derived extended interlocking problems X1…Xn until Xn can be solved directly. The algorithm is based on the following steps, which mirror those performed by the division algorithm of a Computer Algebra System when representing the interlocking problem in the algebraic terms of Section 6. For each section t in the railway station we consider:
Step 1. Check for repeated elements in Q. If any are found, output "It is in a dangerous situation", otherwise return "It is safe" (see Proposition 5.1).
Step 2. If T=∅ and Q≠∅, apply condition i) from Definition 5.4. That is to say, consider some t∈Q and update Q and T as follows:
Q:=Q−{t} |
T:=T∪{t} |
Step 3. After applying Steps 1 and 2, we have T≠∅. Here, we iteratively apply condition iv) from Definition 5.4 until it can no longer be applied. That is, while there exist t∈T and (t,j)∈P, we update P and T as follows:
P:=P−{(t,j)}Ift∉TthenT:=T∪{j} |
As can be seen, before adding t to T, we check if t∈T. If t∈T, we do not need to add it again because of condition ⅱ) in 5.4.
Step 4. After applying Step 3, it is guaranteed that all sections in T are locked. Otherwise, if t∈T were not locked, we would have that there exists a j such that (t,j)∈P (see Definition 5.1) and we could apply Step 3. In this way, we can iteratively apply condition ⅲ) from Definition 5.4 until it can no longer be applied. That is, while there exists t∈T, we proceed as follows:
● If t∈S, output "It is in a dangerous situation" (see Proposition 5.1).
● Otherwise, update S and T as follows:
S:=S∪{t}
T:=T−{t}
Next, we will introduce an algorithm in pseudocode to determine whether an interlocking problem (P,Q) is in a dangerous situation. We have assumed the following data structure to represent the sets P, S, T, Q:
● S,T,Q are represented by arrays of N integers (where N is the number of sections in the railway station), denoted as S, T, and Q. The value Q[i] indicates the number of times section i is repeated in Q.
● In addition to T for representing T, we will consider a list of integers, Ts. We have that i∈ Ts if and only if i∈T. Let us consider that T={1,1,3}. We would have that T = [2, 0, 1, 0] and Ts = {1, 1, 3}.
● P is represented by an array of list of integers, denoted as P. The value P[i] contains a list of integers such that j∈ P[i] if and only if (i,j)∈P.
We will consider that there are two operations Push and Pop that add and remove elements from the lists. Both operations run in O(1). Additionally, we will consider that there is a function to check if the list is empty that also runs in O(1).
The presented algorithm makes use of some auxiliary variables: a list of integers, denoted as L; and some integer variables, denoted as t, i,j, and t2. We assume that N is a variable indicating the number of sections in the railway station.
(1) For t = 1 to N
(2) if Q[t]>1
(3) return true //it is in a dangerous situation
(4) else if Q[t] = 1
(5) Q[t]: = 0;
(6) T[t]: = 1; Push(Ts, t) //Condition ⅰ) in 'Derived from' Relation
(7) Push(L, t)
(8) While L is not empty
(9) i: = Pop(L);
(10) While P[i] is not empty
(11) j: = Pop(P[i]); //Condition ⅳ) in 'Derived from' Relation
(12) if T[j] = 0 //Condition ⅱ) in 'Derived from' Relation
(13) T[j]: = 1; Push(Ts, j)
(14) Push(L, j)
(15) While Ts is not empty
(16) t2: = Pop(Ts); Ts[t2]: = 0;
(17) if S[t2]>0
(18) return true //it is in a dangerous situation
(19) else
(20) S[t2]: = 1 // Condition ⅲ) in 'Derived from' Relation
(21) return false //it is not in a dangerous situation
As may be seen:
Lines (2, 3). They apply Step 1 described above. Initially, S=∅.
Lines (5–6). They apply Step 2 described above.
Lines (7–14). These lines implement Step 3 as described above. A list L is utilized, which contains the sections that the algorithm has yet to examine for being locked. Lines (8-12) apply condition ⅳ) in Definition 5.4. When P[i] is empty, it indicates that section i is locked. By the time the while loop in line (8) concludes, the list L is empty, ensuring that all sections in T are locked.
Lines (13–18). They apply Step 4 described above.
Line (21). When the for loop concludes, we have that T=∅ and Q=∅. Moreover, there are no repeated elements in S. Consequently, the interlocking problem is not in a dangerous situation (see Proposition 5.2).
Although it might seem that the algorithm is O(N⋅|P|) due to the nested while loops, upon careful examination, we can demonstrate that it operates in O(N):
● Lines (5–7) are executed at most N times.
● Lines (11–14) are executed at most K times (counting all the iterations for all values of t). This fact is derived because the algorithm never add elements to P and it removes one element from P in line (11). Since P contains K elements, these lines can only be run at most K times.
● Line (9) is executed at most N+K times (counting all the iterations for all values of t). This fact is derived because the algorithm adds one element to L in line (7) and line (14). It removes an element from L in line (9). Since line (7) is executed at most N times and line (14) is executed at most K times, line (9) can only be run at most N+K times.
● Lines (16-29) are executed at most N+K times (counting all the iterations for all values of t). This fact is derived because the algorithm adds one element to Ts in lines (6) and (13) and it removes one element from Ts in line (16). Since line (6) is executed at most N times, and line (13) is executed at most K times, lines (16–29) can only be run at most N+K times.
Since K is O(N) (see Remark 4.1), we have that the algorithm operates in O(N).
[1] |
N. Bešinović, Resilience in railway transport systems: a literature review and research agenda, Transport Rev., 40 (2020), 457–478. https://doi.org/10.1080/01441647.2020.1728419 doi: 10.1080/01441647.2020.1728419
![]() |
[2] |
Y. Zhou, J. Wang, H. Yang, Resilience of transportation systems: concepts and comprehensive review, IEEE Trans. Intell. Transp. Syst., 20 (2019), 4262–4276. https://doi.org/10.1109/TITS.2018.2883766 doi: 10.1109/TITS.2018.2883766
![]() |
[3] |
H. Lian, X. Wang, A. Sharma, M. A. Shah, Application and study of artificial intelligence in railway signal interlocking fault, Informatica, 46 (2022), 343–354. https://doi.org/10.31449/inf.v46i3.3961 doi: 10.31449/inf.v46i3.3961
![]() |
[4] | A. Fantechi, G. Gori, A. E. Haxthausen, C. Limbrée, Compositional verification of railway interlockings: comparison of two methods, in Reliability, Safety, and Security of Railway Systems. Modelling, Analysis, Verification, and Certification, (2022), 3–19. https://doi.org/10.1007/978-3-031-05814-1_1 |
[5] | G. Lukács, T. Bartha, Conception of a formal model-based methodology to support railway engineers in the specification and verification of interlocking systems, in 2022 IEEE 16th International Symposium on Applied Computational Intelligence and Informatics (SACI), (2022), 000283–000288. https://doi.org/10.1109/SACI55618.2022.9919532 |
[6] | K. Winter, W. Johnston, P. Robinson, P. Strooper, L. van den Berg, Tool support for checking railway interlocking designs, in 10th Australian Workshop on Safety Re-lated Programmable Systems (SCS'05), Australian Computer Society, Sydney, 55 (2006), 101–107. Available from: https://crpit.scem.westernsydney.edu.au/confpapers/CRPITV55Winter.pdf. |
[7] |
J. Peleska, N. Krafczyk, A. E. Haxthausen, R. Pinger, Efficient data validation for geographical interlocking systems, Formal Aspects Comput., 33 (2021), 925–955. https://doi.org/10.1007/s00165-021-00551-6 doi: 10.1007/s00165-021-00551-6
![]() |
[8] | A. Fantechi, A. E. Haxthausen, M. B. R. Nielsen, Model checking geographically distributed interlocking systems using UMC, in 2017 25th Euromicro International Conference on Parallel, Distributed and Network-based Processing (PDP), (2017), 278–286. https://doi.org/10.1109/PDP.2017.66 |
[9] |
E. Roanes-Lozano, L. M. Laita, An applicable topology-independent model for railway interlocking systems, Math. Comput. Simul., 45 (1998), 175–183. https://doi.org/10.1016/S0378-4754(97)00093-1 doi: 10.1016/S0378-4754(97)00093-1
![]() |
[10] |
E. Roanes-Lozano, E. Roanes-Macías, L. Laita, Railway interlocking systems and Gröbner bases, Math. Comput. Simul., 51 (2000), 473–481. https://doi.org/10.1016/S0378-4754(99)00137-8 doi: 10.1016/S0378-4754(99)00137-8
![]() |
[11] |
E. Roanes-Lozano, A. Hernando, J. A. Alonso, L. M. Laita, A logic approach to decision taking in a railway interlocking system using Maple, Math. Comput. Simul., 82 (2011), 15–28. https://doi.org/10.1016/j.matcom.2010.05.024 doi: 10.1016/j.matcom.2010.05.024
![]() |
[12] |
A. Hernando, E. Roanes-Lozano, R. Maestre-Martínez, J. Tejedor, A logic-algebraic approach to decision taking in a railway interlocking system, Ann. Math. Artif. Intell., 65 (2012), 317–328. https://doi.org/10.1007/s10472-012-9321-y doi: 10.1007/s10472-012-9321-y
![]() |
[13] |
E. Roanes-Lozano, J. A. Alonso, A. Hernando, An approach from answer set programming to decision making in a railway interlocking system, Rev. R. Acad. Cienc. Exactas, Fis. Nat. Ser. A Mat., 108 (2014), 973–987. https://doi.org/10.1007/s13398-013-0155-1 doi: 10.1007/s13398-013-0155-1
![]() |
[14] |
A. Hernando, R. Maestre, E. Roanes-Lozano, A new algebraic approach to decision making in a railway interlocking system based on preprocess, Math. Probl. Eng., 2018 (2018), 4982974. https://doi.org/10.1155/2018/4982974 doi: 10.1155/2018/4982974
![]() |
[15] |
A. Hernando, E. Roanes-Lozano, An algebraic model for implementing expert systems based on the knowledge of different experts, Math. Comput. Simul., 107 (2015), 92–107. https://doi.org/10.1016/j.matcom.2014.05.003 doi: 10.1016/j.matcom.2014.05.003
![]() |
[16] | A. Hernando, A., E. Roanes-Lozano, J.L. Galán-García, G. Aguilera-Venegas, Decision making in railway interlocking systems based on calculating the remainder of dividing a polynomial by a set of polynomials, Electron. Res. Arch., 31 (2023), 6160–6196. https://10.3934/era.2023313 |
[17] | D. Cox, J. Little, D. O'Shea, Ideals, Varieties and Algorithms, Springer, 2015. Available from: https://link.springer.com/book/10.1007/978-3-319-16721-3. |
[18] | J. Abbott, A. M. Bigatti, CoCoALib: a C++ library for doing Computations in Commutative Algebra, 2019. Available from: http://cocoa.dima.unige.it/cocoalib. |
[19] | D. Bjørner, The FMERail/TRain Annotated Rail Bibliography, 1999. Available from: http://www2.imm.dtu.dk/db/fmerail/fmerail/. |
[20] | M. J. Morley, Modelling British Rail's Interlocking Logic: Geographic Data Correctness, LFCS, Department of Computer Science, University of Edinburgh, 1991. |
[21] | K. Nakamatsu, Y. Kiuchi, A. Suzuki, EVALPSN based railway interlocking simulator, in Knowledge-Based Intelligent Information and Engineering Systems, Berlin - Heidelberg, (2004), 961–967. https://doi.org/10.1007/978-3-540-30133-2_127 |
[22] | A. Janota, Using Z specification for railway interlocking safety, Period. Polytech. Transp. Eng., 28 (2000), 39–53. Available from: https://pp.bme.hu/tr/article/view/1963. |
[23] | K. M. Hansen, Formalising railway interlocking systems, in Nordic Seminar on Dependable Computing Systems, Lyngby, (1994), 83–94. |
[24] | M. Montigel, Modellierung und Gewährleistung von Abhängigkeiten in Eisenbahnsicherungsanlagen, Ph.D. Thesis, ETH Zurich, Zurich, 1994. Available from: http://www.inf.ethz.ch/research/disstechreps/theses. |
[25] | X. Chen, H. Huang, Y. He, Automatic generation of relay logic for interlocking system based on statecharts, in 2010 Second World Congress on Software Engineering, (2010), 183–188. https://doi.org/10.1109/WCSE.2010.31 |
[26] |
X. Chen, Y. He, H. Huang, An approach to automatic development of interlocking logic based on Statechart, Enterp. Inf. Syst., 5 (2011), 273–286. https://doi.org/10.1080/17517575.2011.575475 doi: 10.1080/17517575.2011.575475
![]() |
[27] |
X. Chen, Y. He, H. Huang, A component-based topology model for railway interlocking systems, Math. Comput. Simul., 81 (2011), 1892–1900. https://doi.org/10.1016/j.matcom.2011.02.007 doi: 10.1016/j.matcom.2011.02.007
![]() |
[28] |
B. Luteberget, C. Johansen, Efficient verification of railway infrastructure designs against standard regulations, Formal Methods Syst. Des., 52 (2018), 1–32. https://doi.org/10.1007/s10703-017-0281-z doi: 10.1007/s10703-017-0281-z
![]() |
[29] |
M. Bosschaart, E. Quaglietta, B. Janssen, R. M. P. Goverde, Efficient formalization of railway interlocking data in RailML, Inf. Syst., 49 (2015), 126–141. https://doi.org/10.1016/j.is.2014.11.007 doi: 10.1016/j.is.2014.11.007
![]() |
[30] | E. Roanes-Lozano, L. M. Laita, E. Roanes-Macías, An application of an AI methodology to railway interlocking systems using computer algebra, in Tasks and Methods in Applied Artificial Intelligence, (1998), 687–696. https://doi.org/10.1007/3-540-64574-8_455 |
[31] |
B. Buchberger, An algorithm for finding the basis elements of the residue class ring of a zero dimensional polynomial ideal, J. Symb. Comput., 41 (2006), 475–511. https://doi.org/10.1016/j.jsc.2005.09.007 doi: 10.1016/j.jsc.2005.09.007
![]() |
[32] |
M. Davis, G. Logemann, D. Loveland, A machine program for theorem-proving, Commun. ACM, 5 (1962), 394–397. https://doi.org/10.1145/368273.368557 doi: 10.1145/368273.368557
![]() |
[33] | Ministerio de Transportes, Movilidad y Agenda Urbana, Estudio Informativo del Nuevo Complejo Ferroviario de la Estación de Madrid-Chamartín. Available from: https://www.mitma.gob.es/ferrocarriles/estudios-en-tramite/estudios-y-proyectos-entramite/chamartin. |
[34] | Anonyous, Adjudicada la Modificación de Las Instalaciones de Seguridad, ERTMS, Comunicaciones y Energía de Madrid-Chamartín, Vía Libre, 2021. Available from: https://www.vialibre-ffe.com/noticias.asp?not = 33047 & cs = infr. |
[35] |
G. Aguilera-Venegas, J. L. Galán-García, E. Mérida-Casermeiro, P. Rodríguez-Cielos, An accelerated-time simulation of baggage traffic in an airport terminal, Math. Comput. Simul., 104 (2014), 58–66. https://doi.org/10.1016/j.matcom.2013.12.009 doi: 10.1016/j.matcom.2013.12.009
![]() |
[36] |
G. Aguilera, J. L. Galán, J. M. García, E. Mérida, P. Rodríguez, An accelerated-time simulation of car traffic on a motorway using a CAS, Math. Comput. Simul., 104 (2014), 21–30. https://doi.org/10.1016/j.matcom.2012.03.010 doi: 10.1016/j.matcom.2012.03.010
![]() |
[37] |
J. L. Galán-García, G. Aguilera-Venegas, M. Á. Galán-García, P. Rodríguez-Cielos, A new Probabilistic Extension of Dijkstra's Algorithm to simulate more realistic traffic flow in a smart city, Appl. Math. Comput., 267 (2015), 780–789. https://doi.org/10.1016/j.amc.2014.11.076 doi: 10.1016/j.amc.2014.11.076
![]() |
[38] |
J. L. Galán-García, G. Aguilera-Venegas, P. Rodríguez-Cielos, An accelerated-time simulation for traffic flow in a smart city, J. Comput. Appl. Math., 270 (2014), 557–563. https://doi.org/10.1016/j.cam.2013.11.020 doi: 10.1016/j.cam.2013.11.020
![]() |
[39] | A. Iliasov, D. Taylor, L. Laibinis, A. B. Romanovsky, SafeCap: from formal verification of railway interlocking to its certification, 2021. |
[40] | J. Pachl, Railway signalling principles, 2021. Available from: http://www.joernpachl.de/rsp.htm. |
[41] |
A. Borälv, Case study: formal verification of a computerized railway interlocking, Formal Aspects Comput., 10 (1998), 338–360. https://doi.org/10.1007/s001650050021 doi: 10.1007/s001650050021
![]() |
[42] | Anonymous, Proyecto y obra del enclavamiento electrónico de la estación de Madrid-Atocha, Proyecto Técnico, Siemens, Madrid, 1988. |
[43] | Anonymous, Microcomputer interlocking hilversum, Siemens, Munich, 1986. |
[44] | Anonymous, Microcomputer interlocking rotterdam, Siemens, Munich, 1989. |
[45] | Anonymous, Puesto de enclavamiento con microcomputadoras de la estación de Chiasso de los SBB, Siemens, Munich, 1989. |
[46] | L. Villamandos, Sistema informático concebido por Renfe para diseñar los enclavamientos, Vía Libre, 348 (1993), 65. |
1. | Antonio Hernando, José Luis Galán–García, Yolanda Padilla–Domínguez, María Ángeles Galán–García, Gabriel Aguilera–Venegas, A library in CoCoA for implementing railway interlocking systems, 2025, 466, 03770427, 116594, 10.1016/j.cam.2025.116594 |
N=52 | N=156 | N=260 | N=520 | N=780 | |
M=5 | M=15 | M=25 | M=50 | M=75 | |
Model described in [11] | 15.34 s | 270.132 s | >1 h | >1h | >1h |
Model described in [10] | 35.46 s | 397.58 s | >1 h | >1h | >1h |
Model described in [12] | 3.423 s | 48.342 s | 674.245s | >1h | >1h |
Model described in [14] | 0.458 s | 1.320 s | 3.456s | >1h | >1h |
Model described in [13] | 0.050 s | 0.073 s | 1.456s | 18.356s | >1h |
Our approach in CoCoA | <0.001s | 0.036 | 0.083 s | 0.164 s | 0.324s |
N=52 | N=156 | N=260 | N=520 | N=780 | |
M=5 | M=15 | M=25 | M=50 | M=75 | |
Model described in [11] | 10.23 s | 250.250 s | >1 h | >1h | >1h |
Model described in [10] | 15.356 s | 380.368 s | >1 h | >1h | >1h |
Model described in [12] | 1.124 s | 38.292 s | 554.180s | >1h | >1h |
Model described in [14] | 0.320 s | 0.920 s | 2.180s | >1h | >1h |
Model described in [13] | 0.020 s | 0.047 s | 1.038s | 16.458s | >1h |
Model described in [16] | <0.001s | 0.015 s | 0.078 s | 0.156s | 0.250 s |
Our approach in CoCoA | <0.001s | 0.028 s | 0.132 s | 0.187s | 0.223 s |
N=52 | N=156 | N=260 | N=520 | N=780 | |
M=5 | M=15 | M=25 | M=50 | M=75 | |
Model described in [11] | 15.34 s | 270.132 s | >1 h | >1h | >1h |
Model described in [10] | 35.46 s | 397.58 s | >1 h | >1h | >1h |
Model described in [12] | 3.423 s | 48.342 s | 674.245s | >1h | >1h |
Model described in [14] | 0.458 s | 1.320 s | 3.456s | >1h | >1h |
Model described in [13] | 0.050 s | 0.073 s | 1.456s | 18.356s | >1h |
Our approach in CoCoA | <0.001s | 0.036 | 0.083 s | 0.164 s | 0.324s |
N=52 | N=156 | N=260 | N=520 | N=780 | |
M=5 | M=15 | M=25 | M=50 | M=75 | |
Model described in [11] | 10.23 s | 250.250 s | >1 h | >1h | >1h |
Model described in [10] | 15.356 s | 380.368 s | >1 h | >1h | >1h |
Model described in [12] | 1.124 s | 38.292 s | 554.180s | >1h | >1h |
Model described in [14] | 0.320 s | 0.920 s | 2.180s | >1h | >1h |
Model described in [13] | 0.020 s | 0.047 s | 1.038s | 16.458s | >1h |
Model described in [16] | <0.001s | 0.015 s | 0.078 s | 0.156s | 0.250 s |
Our approach in CoCoA | <0.001s | 0.028 s | 0.132 s | 0.187s | 0.223 s |