# Self-Healing and Shortest Path in Optical Fiber Sensor Network

Authors: Xingliu Hu; Haifei Si; Junhui Mao; Yizhi Wang
Journal: Journal of Sensors
 (2022)

---

## Abstract

In this study, a new square-based fiber Bragg grating (FBG) sensor network model is proposed to address possible link failures in FBG sensor networks and improve their reliability. Graph theory and optical switching are simultaneously applied to these sensor networks to improve their self-healing ability; the FBG sensor network is regarded as a directed graph. Three commonly used self-short-circuit algorithms are compared in terms of the self-healing capabilities that they provide to the optical fiber sensor network. Among these, the shortest-path faster algorithm achieved a high, nearly 90% repair accuracy and had an average repair time of 0.103 s, the shortest in this study. The newly designed FBG self-healing network can be reorganized and repaired when local damage occurs, thereby improving its reliability.


---

## Body

## 1. Introduction

A fiber Bragg grating (FBG) is a passive optical fiber device with narrow band reflection characteristics fabricated on an optical fiber. Because of its small size, large measurement range, good wavelength selectivity, insensitive polarization, and strong anti-interference ability, FBGs are widely used in many fields such as infrastructure, national defense and security, biomedicine, and petrochemicals [1–4]. The numbers of sensors required in such applications have also been increased significantly to ensure that the accuracy of sensor data monitoring does not decrease. FBG is characterized by easy network measurement, large capacity multiplexing, and wavelength demodulation [5–8]. It can be used in optical fiber sensor networks for monitoring large-scale engineering applications, which have strict requirements for the reliability of FBG sensor networks. Because most networks are embedded or pasted in the structure, it becomes more difficult to repair fiber links when they fail. Thus, the main challenge with regard to the development of fiber grating sensor networks is the attainment of self-healing and improved reliability.The self-healing capabilities of optical fiber sensor networks (OFSNs) have been extensively researched. In 2017, Jia D et al. proposed a self-healing evaluation model based on full-terminal reliability functions in OFSNs [9]. Based on this model, topological equations were established using state enumeration and Monte Carlo methods. Tsai et al. developed a two-step fiber link failure detection and self-healing algorithm that detects fiber link failures and bypasses their impact [10]. Chang et al. devised a fully passive OFSN based on a single-line bidirectional optical addition multiplexer (SBOADM), which can easily accomplish single-line bidirectional transmission without a power supply or optical switch; once the network fails, the preinstalled remote node of the sensor network must be adjusted. [11] Zhu et al. proposed a real-time parallel data acquisition and big data processing method that can reuse different optical fiber sensors with a sampling frequency of up to 6.4 MHz, and data throughput of up to 13.8 MB/s; this method was three times faster than the general method [12]. In 2020, Manie et al. proposed a deep learning algorithm that improves the measurement accuracy of sensor signals for sensor systems. Additionally, they developed a multiplexing method, referred to as intensity wavelength division multiplexing (IWDM), that increases the total number of fiber grating sensor multiplexing for multipoint measurement in sensor networks [13]. Each of the aforementioned studies accomplished in-depth self-healing from either a hardware or software aspect, i.e., either an algorithm was used or the hardware structure was improved. Only a few recent studies have combined software and hardware to realize the self-repair of an optical network. Based on this context, this study proposes a sensor networking method used in conjunction with a shortest-path algorithm from graph theory, to attain complete self-healing in a network. This research is based on the use of surviving sensors near the damaged area; the proposed method automatically reconstructs and performs complete self-healing on the entire optical fiber network, thus guaranteeing the function of the optical fiber smart material structure and improving its reliability.


## 2. Materials and Methods

### 2.1. Self-Healing Principle of OFSN

In this study, the self-healing of an optical fiber sensor network was realized to be able to build a network of FBG sensors based on the topological structure of an optical switch. The graph theory was used in conjunction with a search algorithm to obtain the best placement plan for a multichannel optical fiber sensor system, thereby devising a suitable configuration for each optical fiber sensor system. When a link in the network fails, and the sensor cannot be successfully multiplexed, the optical path can be changed through link switching in the optical switch to accomplish multiplexing in the damaged sensor. For FBG sensors, such failures are expected to occur at some point because of forces and temperatures from the external environment, causing the FBGs to age and eventually break. The typical cause of link failure is optical fiber disconnection, which can be due to damage from human or natural activities, damage of some sensors in a sensor array, etc.The topological structure of an OFSN shows how the optical fiber sensors are connected. Currently, the most widely used topological structures are wired (linear), star, and bus structures. In a linear structure, shown in Figure1, a number (n) of optical fiber sensors are connected in series via a transmission fiber. The advantage of this structure is that the network and structure are simple. The disadvantage is that if a sensor fails, it will affect the normal operation of subsequent sensors; such crosstalk between the sensors results in low system reliability.Figure 1
Linear topology sensor network.In a star-shaped structure, shown in Figure2, each fiber optic sensor is connected to a coupler via a transmission fiber. The advantage of this topology is that each sensor is independent; thus, damage in one sensor does not affect the other sensors. The disadvantage is that the structure is relatively complex, which makes large-scale networking difficult.Figure 2
Star topology sensor network.In a bus topology structure, shown in Figure3, an optical fiber is used as a bus, to which each sensor is connected via a transmission optical fiber. The advantage of this structure is that the sensors share a common bus, which effectively reduces cost. This network structure is also easy to expand and has high reliability. However, sharing a bus creates a single point of failure; should the bus fail, the entire network would be paralyzed.Figure 3
Bus-type topology sensor network.In this study, the characteristics, advantages, and disadvantages of these network topologies were comprehensively considered. The linear and star topologies were then combined in the newly developed sensor network structure; the overall structure was based on a star structure, whereas the branches adopted a linear structure. The new network structure was therefore able to benefit from these two structures. This also enabled the use of multiple types of optical fiber sensors, and as a result, the network capacity and reliability could be greatly improved.Graph theory, which has multiple applications in the fields of natural and social sciences [14–17], is a branch of mathematics in which graphs are regarded as the research objects. In this theory, a graph is composed of several given points, where every point is connected to at least one other by a line. A graph is primarily used to describe relationships between certain things. A point is used to represent a thing, and a line is used to connect two points; a line indicates a relationship between two corresponding objects. In an FBG sensor network, the FBG sensors and demodulators are considered the nodes of the graph; the transmission fibers are considered the edges of the graph. In graph theory, a graph can be expressed as G=<VG,EG>, where VG=υ1,υ2,⋯,υn is the node set of graph G, and EG=e1,e2,⋯,em is the edge set of graph G. If ei is υj,υt, then ei is called an undirected edge with υj and υt as its endpoints, and graph G is an undirected graph; if ei is <υj,υt>, then ei is called a directed edge with υj as the starting point and υt as the end point, and graph G is a directed graph [18, 19]. In the example shown in Figure 4, the node set VG is 1,2,3,4, and the edge set EG is e1,e2,e3,e4.Figure 4
Directed graph.


### 2.2. Sensor Network Model

In an FBG sensor network, optical fibers and remote nodes connect different FBG sensors (indicated by S in Figures1–3) to form a square-based network model. Figure 5 shows an S diagram of a high-reliability network model structure based on an optical switch. The grating center wavelengths of the sensors in the network are shown in Table 1.Figure 5
Topology of optical fiber sensing network.Table 1
Grating center wavelengths of sensors for network shown in Figure5.
FBGS11S12S13S14S21S22S23S24S31S32S33S34S41S42S43S44Center wavelength(nm)1527153515431550153015381546155315211525154815561524153215401559It should be noted here that there can be more sensors on each side; only one FBG sensor was considered for convenience of discussion. Under normal circumstances, the propagation direction of light is as shown in Figure5. If a link failure occurs, the light propagation path can be changed to realize self-healing by switching the optical switch of the remote node (RN1).Figure6 shows a structural diagram of a remote node (RN1–RN3) comprising one 2 × 2 optical switch (OS) and two 1 × 2 OS connections. Because of the 1 × 3 structure, the remote node has a total of five link-switching methods. For comparison, Figure 7 shows a structural diagram of a combination of a remote node RN4 and a coupler, composed of one 1 × 2 OS, two 2 × 2 OSs, and a coupler. Because of the 1 × 4 structure, the remote node has a total of eight link-switching methods.Figure 6
RN1–3.Figure 7
RN4.To express the sensor network using graph theory, it is necessary to analyze the internal structures of the remote nodes; for example, Figure8 shows the internal structure of remote node RN4. As mentioned previously, because RN4 is composed of one 1 × 2 OS and two 2 × 2 OSs, there are six switches, K1–K6. When Ki=1 (i=1–6), it indicates that the corresponding light path is turned on, whereas when Ki=0, it indicates that the corresponding light path is turned off. Among the six switches, K1 and K2 represent the 1 × 2 optical switches, whereas K3–K6 represent the 2 × 2 optical switches. When K1=1, K2=0; when K2=1, K1=0; the same holds true for the other switches. RN4 has five ports, for which there are eight possible paths, namely, {1↔K1↔K3↔2}, {1↔K1↔K4↔3}, {1↔K2↔K6↔4}, {1↔K2↔K5↔5}, {2↔K4↔K6↔5}, {2↔k4↔k6↔5}, {3↔K3↔K5↔4}, and {3↔K3↔K6↔5}.Figure 8
RN4 internal structure.Figure9 shows the internal structure of remote nodes RN1–3, where K1, K2, K5, and K6 are the 1 × 2 optical switches, whereas K3 and K4 are the 2 × 2 optical switches. RN1–3 has four ports, for which there are five possible paths, namely, {1↔K1↔K4↔2}, {1↔K1↔K3↔3}, {1↔K2↔K5↔4}, {2↔K3↔K6↔4}, and {3↔K4↔K6↔4}.Figure 9
Internal structure of RN1–3.For the convenience of subsequent expressions, the switches used by remote nodes RN1–3 are marked as K1–K18, whereas the switches used by remote node RN4 are marked as K19–K24. Figure 10 shows the port numbers shown in Figures 10 and 11 placed in the network structure diagram, which can more intuitively show the light propagation path.Figure 10
FBG sensor network structure diagram.Figure 11
FBG sensor network link failure diagram.


## 2.1. Self-Healing Principle of OFSN

In this study, the self-healing of an optical fiber sensor network was realized to be able to build a network of FBG sensors based on the topological structure of an optical switch. The graph theory was used in conjunction with a search algorithm to obtain the best placement plan for a multichannel optical fiber sensor system, thereby devising a suitable configuration for each optical fiber sensor system. When a link in the network fails, and the sensor cannot be successfully multiplexed, the optical path can be changed through link switching in the optical switch to accomplish multiplexing in the damaged sensor. For FBG sensors, such failures are expected to occur at some point because of forces and temperatures from the external environment, causing the FBGs to age and eventually break. The typical cause of link failure is optical fiber disconnection, which can be due to damage from human or natural activities, damage of some sensors in a sensor array, etc.The topological structure of an OFSN shows how the optical fiber sensors are connected. Currently, the most widely used topological structures are wired (linear), star, and bus structures. In a linear structure, shown in Figure1, a number (n) of optical fiber sensors are connected in series via a transmission fiber. The advantage of this structure is that the network and structure are simple. The disadvantage is that if a sensor fails, it will affect the normal operation of subsequent sensors; such crosstalk between the sensors results in low system reliability.Figure 1
Linear topology sensor network.In a star-shaped structure, shown in Figure2, each fiber optic sensor is connected to a coupler via a transmission fiber. The advantage of this topology is that each sensor is independent; thus, damage in one sensor does not affect the other sensors. The disadvantage is that the structure is relatively complex, which makes large-scale networking difficult.Figure 2
Star topology sensor network.In a bus topology structure, shown in Figure3, an optical fiber is used as a bus, to which each sensor is connected via a transmission optical fiber. The advantage of this structure is that the sensors share a common bus, which effectively reduces cost. This network structure is also easy to expand and has high reliability. However, sharing a bus creates a single point of failure; should the bus fail, the entire network would be paralyzed.Figure 3
Bus-type topology sensor network.In this study, the characteristics, advantages, and disadvantages of these network topologies were comprehensively considered. The linear and star topologies were then combined in the newly developed sensor network structure; the overall structure was based on a star structure, whereas the branches adopted a linear structure. The new network structure was therefore able to benefit from these two structures. This also enabled the use of multiple types of optical fiber sensors, and as a result, the network capacity and reliability could be greatly improved.Graph theory, which has multiple applications in the fields of natural and social sciences [14–17], is a branch of mathematics in which graphs are regarded as the research objects. In this theory, a graph is composed of several given points, where every point is connected to at least one other by a line. A graph is primarily used to describe relationships between certain things. A point is used to represent a thing, and a line is used to connect two points; a line indicates a relationship between two corresponding objects. In an FBG sensor network, the FBG sensors and demodulators are considered the nodes of the graph; the transmission fibers are considered the edges of the graph. In graph theory, a graph can be expressed as G=<VG,EG>, where VG=υ1,υ2,⋯,υn is the node set of graph G, and EG=e1,e2,⋯,em is the edge set of graph G. If ei is υj,υt, then ei is called an undirected edge with υj and υt as its endpoints, and graph G is an undirected graph; if ei is <υj,υt>, then ei is called a directed edge with υj as the starting point and υt as the end point, and graph G is a directed graph [18, 19]. In the example shown in Figure 4, the node set VG is 1,2,3,4, and the edge set EG is e1,e2,e3,e4.Figure 4
Directed graph.


## 2.2. Sensor Network Model

In an FBG sensor network, optical fibers and remote nodes connect different FBG sensors (indicated by S in Figures1–3) to form a square-based network model. Figure 5 shows an S diagram of a high-reliability network model structure based on an optical switch. The grating center wavelengths of the sensors in the network are shown in Table 1.Figure 5
Topology of optical fiber sensing network.Table 1
Grating center wavelengths of sensors for network shown in Figure5.
FBGS11S12S13S14S21S22S23S24S31S32S33S34S41S42S43S44Center wavelength(nm)1527153515431550153015381546155315211525154815561524153215401559It should be noted here that there can be more sensors on each side; only one FBG sensor was considered for convenience of discussion. Under normal circumstances, the propagation direction of light is as shown in Figure5. If a link failure occurs, the light propagation path can be changed to realize self-healing by switching the optical switch of the remote node (RN1).Figure6 shows a structural diagram of a remote node (RN1–RN3) comprising one 2 × 2 optical switch (OS) and two 1 × 2 OS connections. Because of the 1 × 3 structure, the remote node has a total of five link-switching methods. For comparison, Figure 7 shows a structural diagram of a combination of a remote node RN4 and a coupler, composed of one 1 × 2 OS, two 2 × 2 OSs, and a coupler. Because of the 1 × 4 structure, the remote node has a total of eight link-switching methods.Figure 6
RN1–3.Figure 7
RN4.To express the sensor network using graph theory, it is necessary to analyze the internal structures of the remote nodes; for example, Figure8 shows the internal structure of remote node RN4. As mentioned previously, because RN4 is composed of one 1 × 2 OS and two 2 × 2 OSs, there are six switches, K1–K6. When Ki=1 (i=1–6), it indicates that the corresponding light path is turned on, whereas when Ki=0, it indicates that the corresponding light path is turned off. Among the six switches, K1 and K2 represent the 1 × 2 optical switches, whereas K3–K6 represent the 2 × 2 optical switches. When K1=1, K2=0; when K2=1, K1=0; the same holds true for the other switches. RN4 has five ports, for which there are eight possible paths, namely, {1↔K1↔K3↔2}, {1↔K1↔K4↔3}, {1↔K2↔K6↔4}, {1↔K2↔K5↔5}, {2↔K4↔K6↔5}, {2↔k4↔k6↔5}, {3↔K3↔K5↔4}, and {3↔K3↔K6↔5}.Figure 8
RN4 internal structure.Figure9 shows the internal structure of remote nodes RN1–3, where K1, K2, K5, and K6 are the 1 × 2 optical switches, whereas K3 and K4 are the 2 × 2 optical switches. RN1–3 has four ports, for which there are five possible paths, namely, {1↔K1↔K4↔2}, {1↔K1↔K3↔3}, {1↔K2↔K5↔4}, {2↔K3↔K6↔4}, and {3↔K4↔K6↔4}.Figure 9
Internal structure of RN1–3.For the convenience of subsequent expressions, the switches used by remote nodes RN1–3 are marked as K1–K18, whereas the switches used by remote node RN4 are marked as K19–K24. Figure 10 shows the port numbers shown in Figures 10 and 11 placed in the network structure diagram, which can more intuitively show the light propagation path.Figure 10
FBG sensor network structure diagram.Figure 11
FBG sensor network link failure diagram.


## 3. Results and Discussion

The self-healing path of the OFSN utilizes different demodulation schemes because of the use of several optical switches. To use the OFSN more efficiently, it is necessary to find the shortest self-healing path to avoid repetitive multiplexing of the FBG sensors.


### 3.1. Application of Graph Theory

LetG=<VG,EG> be a directed graph with n vertices. The adjacency matrix of G is A=aijn×n, where
(1)aij=1,vi,vj∈E0,vi,vj∉E.Eachaijk in Akk≥1 represents the number of paths whose length is k between vertices vi and vj.For the network structure shown in Figure10, under the assumption that the light propagation path is as shown by the arrow in Figure 10, the state of the switches is K1=K4=K6=K7=K10=K12=K13=K16=K18=K20=K22=K23=1. The remaining switches are turned off. If the FBG sensor network has a link failure, like that shown in Figure 11, then sensors S31, S32, S33, S34, S4, S41, S42, S43, and S44 will not be demodulated and will therefore become useless.For the link failure shown in Figure11, the adjacency matrix is
(2)A=0K20∗K2300000000000000K19∗K21K20∗K2400K19∗K22K20∗K230K1∗K400K2∗K5K1∗K3000000000K22∗K24000K21∗K240K1∗K4010K3∗K60000000000000000010100000000000000000001010000000000000000K2∗K5K3∗K6010K4∗K6000000000000000K1∗K3000K4∗K60K7∗K1000K8∗K110000000000000000K7∗K1001000000000000000000010100000000000000000001010000000000000000K8∗K11K9∗K120100000000000000000000000K13∗K1600K14∗K170000000000000000K13∗K16000K15∗K180000000000000000000100000000000000000001010000000000000000K14∗K17K15∗K18010K16∗K180000K19∗K21K22∗K24000000000K13∗K15000K16∗K180K22∗K23000K20∗K24000000000000000K22∗K23010K21∗K23000000000000000001010000000000000000000100K19∗K22K21∗K24000000000000000K21∗K23000This adjacency matrix is calculated according to the maximum numberk of the FBG sensors contained in each optical path connected to the demodulator. In calculating Amm≤k, the element ai2m in Am represents the connection between the i2th FBG sensor and sensor S1 in the sensor network. When ai2m=0, it indicates that there is no demodulation path between the i2th FBG sensor and sensor S1, and that there is no optical path from FBGi2 to FBGS1, whereas when ai2m=Y, it indicates that there are Y self-healing demodulation paths from FBGi2 to FBGS1.


### 3.2. Shortest Self-Repair Path

Different combinations of optical switches produce different combinations of self-healing paths for OFSNs. Therefore, a shortest-path algorithm from graph theory is required to determine the shortest-path plan.For example, the FBG sensor network shown in Figure11 comprises 20 FBG sensors. Based on the adjacency matrix combined with the shortest-path algorithm, the shortest self-healing path, its length, and switch state are obtained. The actual repair results for the network shown in Figure 11 are presented in Table 2.Table 2
Damaged FBG self-healing path and optical switch statuses for network shown in Figure11.
Damaged FBGSelf-healing pathOptical switch statusLengthS3S1⟶S3K13=K15=K19=K211=12S31Unrepaired\0S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=14S33S4⟶S34⟶S33K16=K18=K19=K21=13S34S4⟶S34K16=K18=K19=K21=12S4S4K19=K21=11S41S41K20=K24=11S42S41⟶S42K20=K24=12S43S41⟶S42⟶S43K20=K24=13S44S44K19=K22=11There are three types of shortest-path algorithms commonly used in graph theory: Dijkstra [20], Floyd [21], and the shortest-path faster algorithm (SPFA) [22]. The defining characteristic of the Dijkstra algorithm is that it gradually extends from the starting point to the connection point to find the shortest path until it reaches the end point; all extension points passed during this period are the nodes on the shortest path. The Dijkstra algorithm adopts the strategy of a greedy algorithm. First, an array D is introduced to save the shortest distance from the starting point to other vertices, and then a set S is declared to save the vertices of the shortest path. The algorithm selects the minimum value from D as the shortest distance from the starting point to the corresponding point and puts this point into S. Then, it continues to select vertices that are not in set S and determines whether the new vertex can reach other vertices and whether the distance from the starting point to the other vertices through the new vertex is shorter than the previously recorded shortest distance. If shorter, the value in D is updated. This step is repeated until all vertices are included in S. The flow of the algorithm is illustrated in Figure 12.Figure 12
Dijkstra algorithm flowchart.The Dijkstra algorithm is used to repair the network shown in Figure11; the results of the algorithm are outlined in Table 3.Table 3
Repair results from using the Floyd algorithm.
Damaged FBGSelf-healing pathOptical switch statusLengthTime/sS3S4⟶S3K13=K15=K19=K21=120.2103S31S4⟶S34⟶S31K16=K18=K19=K21=130.1487S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=140.1456S33S4⟶S34⟶S33K16=K18=K19=K21=130.1594S34S4⟶S34K16=K18=K19=K21=120.1402S4S4K19=K21=110.1406S41S41K20=K24=110.1401S42S41⟶S42K20=K24=120.1391S43S41⟶S42⟶S43K20=K24=130.1468S44S44K19=K22=110.1539The Floyd algorithm, also known as the insertion point method, is an algorithm that uses the idea of dynamic programming to find the shortest path between multiple source points in a given weighted graph. The Floyd algorithm is a dynamic programming algorithm. The algorithm introduces two matrices:D and P. The elements in D represent the distance between the corresponding vertices, whereas the elements in P represent the vertices passed between the two vertices. The two matrices need to be updated N times, where N is the number of vertices. Each time, the corresponding vertices are inserted into matrix D, and the distance after insertion is compared with the original distance. If the distance after insertion is smaller, the values in matrices D and P are updated. The flow of the algorithm is illustrated in Figure 13.Figure 13
Floyd algorithm flowchart.The Floyd algorithm is used to repair the network shown in Figure11; the results of the algorithm are outlined in Table 4.Table 4
Repair results from using the Floyd algorithm.
Damaged FBGSelf-healing pathOptical switch statusLengthTime/sS3Unrepaired\0\S31Unrepaired\0\S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=140.5570S33S4⟶S34⟶S33K16=K18=K19=K21=130.5467S34S4⟶S34K16=K18=K19=K21=120.5504S4S4K19=K21=110.5478S41S41K20=K24=110.5530S42S41⟶S42K20=K24=120.5489S43S41⟶S42⟶S43K20=K24=130.5541S44S44K19=K22=110.5333SPFA adopts the dynamic approximation method. An arrayD is introduced to save the shortest distance from the starting point to the other vertices, and then a queue is established. Each time, the queue head u is listed to relax the arc head node v corresponding to the edge of the u point as the end of the arc. If the shortest-path estimation of point v is adjusted, and it is not in the queue, it is placed at the end of the queue. This process is repeated until the team is empty. The flow of the algorithm is shown in Figure 14.Figure 14
SPFA algorithm flowchart.SPFA is used to repair the network shown in Figure11; the results of the algorithm are outlined in Table 5.Table 5
Repair results from using the SPFA algorithm.
Damaged FBGSelf-healing pathOptical switch statusLengthTime/sS3S4⟶S3K13=K15=K19=K21=120.1270S31S4⟶S34⟶S31K16=K18=K19=K21=130.0971S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=140.1196S33S4⟶S34⟶S33K16=K18=K19=K21=130.0958S34S4⟶S34K16=K18=K19=K21=120.0969S4S4K19=K21=110.0978S41S41K20=K24=110.0980S42S41⟶S42K20=K24=120.0976S43S41⟶S42⟶S43K20=K24=130.0977S44S44K19=K22=110.1023From Tables3–5, we can intuitively compare the advantages and disadvantages of the three algorithms. The repair results for the Floyd and SPFA algorithms are the same and contain errors only in the repair path of sensor S31. However, the repair time of the SPFA algorithm is shorter, with an average of 0.103 s. By contrast, the Dijkstra algorithm demonstrated more errors compared to those exhibited by the other two algorithms, which repaired low-accuracy results in both paths; furthermore, the self-healing took longer. Therefore, it was clearly not the best repair algorithm.Based on the results, it can be concluded that the Dijkstra algorithm cannot be used to solve a graph with negative-weight edges and can only be used primarily to solve single-source problems. Moreover, the time required to solve the problem between any two points continued to increase. On the other hand, the Floyd algorithm, being an improved version of the Dijkstra algorithm, was able to solve the shortest path between a graph with a negative weight and any two points; it was simple and easy to implement and program. However, the time efficiency of this algorithm was the lowest; thus, the time required was longer than that of SPFA, which is an improved version of the Bellman–Ford algorithm, wherein a queue and adjacency list are used. SPFA exhibited not only the same advantages as those of the Floyd algorithm but also better time efficiency and space complexity compared to those of the Floyd algorithm.


## 3.1. Application of Graph Theory

LetG=<VG,EG> be a directed graph with n vertices. The adjacency matrix of G is A=aijn×n, where
(1)aij=1,vi,vj∈E0,vi,vj∉E.Eachaijk in Akk≥1 represents the number of paths whose length is k between vertices vi and vj.For the network structure shown in Figure10, under the assumption that the light propagation path is as shown by the arrow in Figure 10, the state of the switches is K1=K4=K6=K7=K10=K12=K13=K16=K18=K20=K22=K23=1. The remaining switches are turned off. If the FBG sensor network has a link failure, like that shown in Figure 11, then sensors S31, S32, S33, S34, S4, S41, S42, S43, and S44 will not be demodulated and will therefore become useless.For the link failure shown in Figure11, the adjacency matrix is
(2)A=0K20∗K2300000000000000K19∗K21K20∗K2400K19∗K22K20∗K230K1∗K400K2∗K5K1∗K3000000000K22∗K24000K21∗K240K1∗K4010K3∗K60000000000000000010100000000000000000001010000000000000000K2∗K5K3∗K6010K4∗K6000000000000000K1∗K3000K4∗K60K7∗K1000K8∗K110000000000000000K7∗K1001000000000000000000010100000000000000000001010000000000000000K8∗K11K9∗K120100000000000000000000000K13∗K1600K14∗K170000000000000000K13∗K16000K15∗K180000000000000000000100000000000000000001010000000000000000K14∗K17K15∗K18010K16∗K180000K19∗K21K22∗K24000000000K13∗K15000K16∗K180K22∗K23000K20∗K24000000000000000K22∗K23010K21∗K23000000000000000001010000000000000000000100K19∗K22K21∗K24000000000000000K21∗K23000This adjacency matrix is calculated according to the maximum numberk of the FBG sensors contained in each optical path connected to the demodulator. In calculating Amm≤k, the element ai2m in Am represents the connection between the i2th FBG sensor and sensor S1 in the sensor network. When ai2m=0, it indicates that there is no demodulation path between the i2th FBG sensor and sensor S1, and that there is no optical path from FBGi2 to FBGS1, whereas when ai2m=Y, it indicates that there are Y self-healing demodulation paths from FBGi2 to FBGS1.


## 3.2. Shortest Self-Repair Path

Different combinations of optical switches produce different combinations of self-healing paths for OFSNs. Therefore, a shortest-path algorithm from graph theory is required to determine the shortest-path plan.For example, the FBG sensor network shown in Figure11 comprises 20 FBG sensors. Based on the adjacency matrix combined with the shortest-path algorithm, the shortest self-healing path, its length, and switch state are obtained. The actual repair results for the network shown in Figure 11 are presented in Table 2.Table 2
Damaged FBG self-healing path and optical switch statuses for network shown in Figure11.
Damaged FBGSelf-healing pathOptical switch statusLengthS3S1⟶S3K13=K15=K19=K211=12S31Unrepaired\0S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=14S33S4⟶S34⟶S33K16=K18=K19=K21=13S34S4⟶S34K16=K18=K19=K21=12S4S4K19=K21=11S41S41K20=K24=11S42S41⟶S42K20=K24=12S43S41⟶S42⟶S43K20=K24=13S44S44K19=K22=11There are three types of shortest-path algorithms commonly used in graph theory: Dijkstra [20], Floyd [21], and the shortest-path faster algorithm (SPFA) [22]. The defining characteristic of the Dijkstra algorithm is that it gradually extends from the starting point to the connection point to find the shortest path until it reaches the end point; all extension points passed during this period are the nodes on the shortest path. The Dijkstra algorithm adopts the strategy of a greedy algorithm. First, an array D is introduced to save the shortest distance from the starting point to other vertices, and then a set S is declared to save the vertices of the shortest path. The algorithm selects the minimum value from D as the shortest distance from the starting point to the corresponding point and puts this point into S. Then, it continues to select vertices that are not in set S and determines whether the new vertex can reach other vertices and whether the distance from the starting point to the other vertices through the new vertex is shorter than the previously recorded shortest distance. If shorter, the value in D is updated. This step is repeated until all vertices are included in S. The flow of the algorithm is illustrated in Figure 12.Figure 12
Dijkstra algorithm flowchart.The Dijkstra algorithm is used to repair the network shown in Figure11; the results of the algorithm are outlined in Table 3.Table 3
Repair results from using the Floyd algorithm.
Damaged FBGSelf-healing pathOptical switch statusLengthTime/sS3S4⟶S3K13=K15=K19=K21=120.2103S31S4⟶S34⟶S31K16=K18=K19=K21=130.1487S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=140.1456S33S4⟶S34⟶S33K16=K18=K19=K21=130.1594S34S4⟶S34K16=K18=K19=K21=120.1402S4S4K19=K21=110.1406S41S41K20=K24=110.1401S42S41⟶S42K20=K24=120.1391S43S41⟶S42⟶S43K20=K24=130.1468S44S44K19=K22=110.1539The Floyd algorithm, also known as the insertion point method, is an algorithm that uses the idea of dynamic programming to find the shortest path between multiple source points in a given weighted graph. The Floyd algorithm is a dynamic programming algorithm. The algorithm introduces two matrices:D and P. The elements in D represent the distance between the corresponding vertices, whereas the elements in P represent the vertices passed between the two vertices. The two matrices need to be updated N times, where N is the number of vertices. Each time, the corresponding vertices are inserted into matrix D, and the distance after insertion is compared with the original distance. If the distance after insertion is smaller, the values in matrices D and P are updated. The flow of the algorithm is illustrated in Figure 13.Figure 13
Floyd algorithm flowchart.The Floyd algorithm is used to repair the network shown in Figure11; the results of the algorithm are outlined in Table 4.Table 4
Repair results from using the Floyd algorithm.
Damaged FBGSelf-healing pathOptical switch statusLengthTime/sS3Unrepaired\0\S31Unrepaired\0\S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=140.5570S33S4⟶S34⟶S33K16=K18=K19=K21=130.5467S34S4⟶S34K16=K18=K19=K21=120.5504S4S4K19=K21=110.5478S41S41K20=K24=110.5530S42S41⟶S42K20=K24=120.5489S43S41⟶S42⟶S43K20=K24=130.5541S44S44K19=K22=110.5333SPFA adopts the dynamic approximation method. An arrayD is introduced to save the shortest distance from the starting point to the other vertices, and then a queue is established. Each time, the queue head u is listed to relax the arc head node v corresponding to the edge of the u point as the end of the arc. If the shortest-path estimation of point v is adjusted, and it is not in the queue, it is placed at the end of the queue. This process is repeated until the team is empty. The flow of the algorithm is shown in Figure 14.Figure 14
SPFA algorithm flowchart.SPFA is used to repair the network shown in Figure11; the results of the algorithm are outlined in Table 5.Table 5
Repair results from using the SPFA algorithm.
Damaged FBGSelf-healing pathOptical switch statusLengthTime/sS3S4⟶S3K13=K15=K19=K21=120.1270S31S4⟶S34⟶S31K16=K18=K19=K21=130.0971S32S4⟶S34⟶S33⟶S32K16=K18=K19=K21=140.1196S33S4⟶S34⟶S33K16=K18=K19=K21=130.0958S34S4⟶S34K16=K18=K19=K21=120.0969S4S4K19=K21=110.0978S41S41K20=K24=110.0980S42S41⟶S42K20=K24=120.0976S43S41⟶S42⟶S43K20=K24=130.0977S44S44K19=K22=110.1023From Tables3–5, we can intuitively compare the advantages and disadvantages of the three algorithms. The repair results for the Floyd and SPFA algorithms are the same and contain errors only in the repair path of sensor S31. However, the repair time of the SPFA algorithm is shorter, with an average of 0.103 s. By contrast, the Dijkstra algorithm demonstrated more errors compared to those exhibited by the other two algorithms, which repaired low-accuracy results in both paths; furthermore, the self-healing took longer. Therefore, it was clearly not the best repair algorithm.Based on the results, it can be concluded that the Dijkstra algorithm cannot be used to solve a graph with negative-weight edges and can only be used primarily to solve single-source problems. Moreover, the time required to solve the problem between any two points continued to increase. On the other hand, the Floyd algorithm, being an improved version of the Dijkstra algorithm, was able to solve the shortest path between a graph with a negative weight and any two points; it was simple and easy to implement and program. However, the time efficiency of this algorithm was the lowest; thus, the time required was longer than that of SPFA, which is an improved version of the Bellman–Ford algorithm, wherein a queue and adjacency list are used. SPFA exhibited not only the same advantages as those of the Floyd algorithm but also better time efficiency and space complexity compared to those of the Floyd algorithm.


## 4. Conclusions

This study investigated the optical fiber sensing and self-healing capabilities of a sensing network to address the problem of efficiently repairing faults in optical fiber sensing networks. Linear and star topology structures were combined into a square network structure with good scalability and reliability. As a result, a new self-healing model for a fiber Bragg grating sensor network was developed based on graph theory and optical switches to realize self-repair in the sensor network. Simultaneously, a shortest-path algorithm based on graph theory was used to obtain the shortest self-healing path, and the corresponding optical switch state was determined. Through this strategy, self-healing of the optical fiber sensor network was achieved more efficiently. The experimental results show that SPFA achieved nearly 90% repair accuracy and high temporal efficiency, with an average repair time of 0.103 s. This study showed that this network structure has good self-healing ability. The research results can provide certain guidance for the self-healing of FBG sensor networks in practical engineering applications.Research on the reliability of FBG sensor networks started relatively late. It is a new multidisciplinary research field that involves a wide range of subtopics. This study provides only a basic exploration, and there remain many imperfections and areas for further investigation. For example, the shortest-path algorithm used herein, while having demonstrated the best performance, was still unable to achieve 100% repair accuracy. Another challenge to overcome is the simultaneous self-repair of multiple damages, which remains a difficult problem for artificial intelligence research.



---

*Source: 5717041-2022-08-03.xml*