1 Introduction

Wireless sensor network (WSN) is a kind of distributed sensing networks, whose nodes can detect the surrounding environment [1,2,3]. Given the characteristics of large-scale deployment, easy extensibility, and low price, WSN has been widely applied to such fields as military, target tracking, intelligent transportation, environmental monitoring, and health care [4,5,6,7,8,9,10,11]. The research and application of wireless sensor networks have attracted massive attention.

Coverage is a vital index to evaluate the quality of service (QoS) of WSN’s sensing function [12,13,14,15,16]. According to various characteristics of monitored objects, coverage can be classified into three types, i.e., area coverage, point coverage, and barrier coverage [17]. The present studies on the measurement of coverage mostly focus on barrier coverage [18,19,20] and therefore this study on barrier coverage is aimed to find one or various paths connecting source point and target point, and quantitatively describe the sensing quality of mobile objects along the path [21, 22]. The concept of path exposure is used to evaluate coverage quality in the sensor-deployed field with the consideration of path length and exposure simultaneously.

With respect to path exposure, there are two widely divergent viewpoints. One is best-case coverage, which is to find a path with the highest observability. The Maximal Exposure Path and the Maximal Support Path are two solutions to the best-case coverage [23,24,25]. The other is the worst-case coverage, which is to design a path through the sensor field and make the minimum probability of detecting the mobile object. There exist two well-known approaches with respect to the worst-case coverage, i.e., minimal exposure path (MEP) and the maximal breach path [26]. The maximal exposure path and minimal exposure path are essentially the same problem. Hence, we focus on the MEP problem of worst-case coverage in this paper. The MEP problem is the variation of functional extremum in mathematics [27]. Theoretically, it is possible to find the optimum path by solving the corresponding Euler-Lagrange Equation [28]. When there is only one sensor in the detecting region, ref. [29] obtains the exact analytical solution to MEP problem. However, in the multiple-sensor region, higher-order non-linearity makes it difficult to express and solve the Euler-Lagrange equation [29,30,31]. Some approaches have been proposed to address this problem, such as Voronoi diagram-based approach and grid-based approach. However, the time complexity of computation of those approaches will increase with the rise of the grid scale or sensor density. Therefore, it is essential to propose an algorithm to reduce the time complexity of computation and guarantee the quality of solutions simultaneously.

This paper is aimed to decrease the time complexity of computation of grid-based approach in order to solve MEP problem with large-scale field or high-density sensors. An algorithm is proposed and named as target guiding self-avoiding random walk with intersection (TGSARWI), which mimics the behavior that an individual seeks a path from the source point to the target point in a strange area. In this algorithm, multiple random walkers start from the source point and the target point respectively and head to the opposite sides along edges of the grid network. At each step, each random walker moves to a neighbor chosen according to the edge exposure and the direction to its end point. When routes of walkers from different start points intersect, one or multiple paths will be created between the source and the target, so that a connected sub-network can be formed. Finally, the shortest path algorithm is employed to seek the minimum exposure path in this sub-network.

The main contributions of this paper are summarized as follows:

  • Compared with the previous algorithm, TGSARWI DA can solve MEP problem in large-scale field with acceptable complexity.

  • The complexity of TGSARWI DA is insensitive to the number of sensors, enabling to solve MEP problem with much higher density sensors.

  • Unlike the POA, parameters in TGSARWI DA need no adjustment as the background of MEP problem changes. Hence, the newly proposed algorithm has better adaptability to environment.

The rest of this paper is organized as follows: Section 2 summarizes related approaches about the minimal exposure path problem. Section 3 introduces the model of MEP problem. Section 4 proposes TGSARWI DA algorithm. Section 5 evaluates the proposed TGSARWI DA by extensive simulations.

2 Related work

The goal of MEP problem is to find a path through the detecting region with sensor deployment and to ensure the object that moves along the path has the least possibility detected by sensors. When the detecting region is deployed by multiple sensors, the finding of the minimum exposure path, due to the highly ordered nonlinearity of MEP problem, will become rather complex using the Euler-Lagrange equation. Considering the difficulty in obtaining exact solution to the MEP problem, the most popular strategy is to convert the continuous MEP problem to discrete problem. The discrete method includes two principle approximate approaches. One is Voronoi diagram-based approach and the other is grid-based approach.

Voronoi diagram-based approach is proposed in ref. [26]. In this approach, the detecting region is divided into n (n is the sensor number) polygons according to the geometric positions of sensors, and each polygon is called a Voronoi cell. The distance of any point in a Voronoi cell to its sensor is closer than that to the other sensors. All the edges of the polygons form a graph called Voronoi graph. The weight of the edge is defined as the exposure along the Voronoi edge. The object can move only along the Voronoi edge. Then, the MEP problem is transformed into a shortest path problem and could be solved by the shortest path algorithm. Many improvements are made based on this approach. For example, Djidjev integrates Voronoi diagram and Euler-Lagrange equation to find the minimum exposure path [29, 30]. Zhang et al. propose a distributed path search method based on Voronoi diagram [32]. In ref. [33], Zhou applies Voronoi graph and Dijkstra algorithm to search vulnerable path in the sensors network. However, Voronoi diagram-based approach cannot be used in networks including directional sensors, unless the range of directional sensor is transformed into a special region. In addition, the time complexity of computation will be sharply increased as the total number of sensors grows. Moreover, this approach is also inaccessible when the source and target are not on the Voronoi edges or the sensing intensity is not decided only by the nearest sensor [34].

Grid-based approach divides detecting region into m × n square grid cells. Each cell has four nodes and four edges. Each node connects its four neighboring nodes by four edges. The weight of each edge is the exposure, which is obtained by sensing intensity from the sensors. Then, the whole nodes and edges form a weighted undirected network. The object is restricted to move along the edges or diagonals of the grid, and then the minimum exposure path is identified based on the edge exposures [24]. Liu et al. uses a grid-based approach in the field with directional and omni-directional sensors deployment, and applies the physarum optimization to obtain the minimum exposure path [35]. Ref. [36] proposes a bond percolation-based scheme to put the exposure path problem into a 3D uniform lattice, and then uses grid-based approach to find the minimum exposure path. Aiming at the MEP problem with path constraint conditions, Hao et al. divides the path into three parts. The paths of the first part and the last part are calculated by grid-based approach, while the middle part is solved through the hybrid genetic algorithm [37]. Liu uses adaptive cell decomposition to transform the minimal exposure path problem into a discrete problem, and then designs an OMEPS algorithm to search for the obstacle-avoidance minimum exposure path in the grid-based network [38]. Accordingly, other various improved algorithms based on grid partition also have been proposed [39,40,41,42]. It is noted that, in grid-based approach, the larger the scale of the grid network within a fixed region is, the more accurate the solution to the MEP problem will be. However, since the complexity rises sharply as the grid scale increases, it is difficult to solve the problem in large-scale grids. Some heuristic algorithms have been proposed to simplify the complexity. For example, Liu et al. proposed a physarum optimization algorithm (POA) based on the light-avoidance of physarum, which could be used to obtain minimum exposure path with edge-cutting method in the grid [40]. The shortage of this method is that, in the simulations, parameters of POA need to be retuned when the grid scale and sensor density change.

3 Minimum exposure path problem

Generally speaking, wireless sensors applied in different fields have different functions, but their common feature is that their detecting sensitivity gradually attenuates as the detecting distance increases. For directional sensor, the sensitivity of the sensor is inversely proportional to the offset angle.

Suppose n s sensors \( \left\{{s}_1,{s}_2,\dots, {s}_{n_s}\right\} \), directional or omnidirectional, are randomly distributed in a rectangle field Q which is an arbitrary point in the sensor-detected field. The detecting sensitivity ss(s i , Q) of sensor s i to the point Q could be represented as follows:

$$ ss\left({s}_i,Q\right)=\left\{\begin{array}{cc}\mu /{\left[d\left({s}_i,Q\right)\right]}^{\tau}\kern8em & {s}_i\kern0em \mathrm{is}\ \mathrm{omnidirectional}\\ {}\mu {\left\{\cos \left[\frac{\varphi \left(\overrightarrow{V_i},\overrightarrow{s_iQ}\right)}{2}\right]\right\}}^{\gamma }/{\left[d\left({s}_i,Q\right)\right]}^{\tau }& {s}_i\mathrm{is}\ \mathrm{directional}\kern0.75em \end{array}\right. $$
(1)

Where d(s i , Q) represents Euclidean distance between sensor s i and point Q. \( \overrightarrow{V_i} \) denotes the unit vector which determines the sensing direction of sensor s i in the case of directional sensor. \( \overrightarrow{s_iQ} \) is the vector from sensor s i to point Q, \( \varphi \left(\overrightarrow{V_i},\overrightarrow{s_iQ}\right) \) denotes the angle between \( \overrightarrow{V_i} \) and \( \overrightarrow{s_iQ} \). Parameter μ, τ, and γ are the sensor-dependent parameters. According to the literature [40], parameter μ denotes the sensitivity of the sensor at the unit distance or the direction of directional sensor, parameter τ denotes the attenuation coefficient of sensor sensitivity on distance, and parameter γ denotes the attenuation coefficient of the directed sensor sensitivity on deviating from the central direction.

The sensitivity S of point Q detected by field sensors could be represented by two methods. One is to consider the sensitivity S as the sum of n s sensors’ sensitivities, which can be represented as \( S(Q)=\sum \limits_{i=1}^{n_s} ss\left({s}_i,Q\right) \). The other is to consider the sensitivity S as the maximum sensitivity of n s sensors to the point Q, which is \( S(Q)=\underset{i=1,\dots, {n}_s}{\max } ss\left({s}_i,Q\right) \). Following ref. [40], we use the latter method to represent the sensitivity.

The concept of exposure is used to measure the coverage quality of the field with sensor deployment. Once the walker’s path f(x) is known, the exposure E(f(x)) of the path could be calculated by curvilinear integral method as follows:

$$ E\left(f(x)\right)={\int}_{v_s}^{v_e}S\left(x,f(x)\right)\sqrt{1+{\left({f}^{\prime }(x)\right)}^2} dx $$
(2)

Where v s and v e are the source point and target point, respectively.

MEP problem is to find a path in which the exposure reaches minimum, while the minimum E(f(x)) could be obtained by variation method of extremum. Here, we denote \( F=S\left(x,f(x)\right)\sqrt{1+{\left({f}^{\prime }(x)\right)}^2} \) and substitute it into the following Euler-Lagrange equation:

$$ \frac{\partial F}{\partial f(x)}-\frac{\mathrm{d}}{\mathrm{d}x}\frac{\partial F}{\partial {f}^{\prime }(x)}=0 $$
(3)

Theoretically, the minimum E(f(x)) can be obtained only when the above equation is solved. However, in the field with multiple sensors, higher-order nonlinearity makes it difficult to solve the Euler-Lagrange equation. Therefore, the problem of continuous minimum exposure path is transformed into a discrete problem in this paper.

Supposing that the detected field is a rectangle area, the rectangle can be divided into m × n grids. Then, the walker can move only along the edges of the grid network, as shown in Fig. 1.

Fig. 1
figure 1

The grid network with scale m × n, where the walker can move only along its edges

Here, the sensor-detected grid is a weighted connected network graph G = (V, E, W), where V = {v1, v2, …, v i , …, vm × n} represents the set of all nodes and E is the set of all edges. Let w ij  ∈ W denote the weight of the edge e ij between two nodes v i and v j , which shows the exposure of e ij detected by all sensors in the grid field. Since this graph is an undirected network graph, we have w ij  = w ji . Let the length of the edge be l, the coordinate of node v i be (x i , y i ), the weight w ij could be calculated as follows:

$$ {w}_{ij}=E\left({e}_{ij}\right)=\left\{\begin{array}{cc}{\int}_{\min \left\{{x}_i,{x}_j\right\}}^{\min \left\{{x}_i,{x}_j\right\}+l}S\left(\left(x,{y}_i\right)\right) dx& {e}_{ij}\ \mathrm{is}\ \mathrm{horizontal}\\ {}{\int}_{\min \left\{{y}_i,{y}_j\right\}}^{\min \left\{{y}_i,{y}_j\right\}+l}S\left(\left({x}_i,y\right)\right) dy& {e}_{ij}\ \mathrm{is}\ \mathrm{vertical}\end{array}\right. $$
(4)

Once the exposure of each edge in the grid is obtained, the minimum exposure path between source point v s and target point v e can be got through optimized algorithm (such as Dijkstra algorithm). Nevertheless, the time complexity of Dijkstra algorithm is O(m2n2), making it difficult to solve MEP problem in a large-scale field. Therefore, this research will apply random walk to imitate the path-finding process of a walker in a strange area. After generating a sufficient number of connected paths between v s and v e , Dijkstra algorithm is used to seek minimum exposure path in the sub-network formed by these connected paths.

4 TGSARWI DA algorithm for MEP problem

4.1 Self-avoiding random walk

For the random walk algorithm [43], a walker starts at the node v i and moves to a randomly chosen neighbor v j  ∈ V at each step. The above process could be denoted as xt + 1 = Pxt, where P represents the matrix of transition probability, which is column-normalized matrix of weighted adjacency matrix of network graph G. The transition probability from node v i to v j is inversely proportional to the weight w ij of the edge e ij , which could be represented as follows:

$$ {p}_{ij}=\frac{1/{w}_{ij}}{\sum_{e_{ik}\in E}\left(1/{w}_{ik}\right)} $$
(5)

In a random walk, the node-visiting sequence of the walker is a finite state Markov chain, which is only related to the currently visited node rather than the previous sequence of nodes. However, in the shortest path-finding process, the next node that will be visited should not be included in the nodes that have been visited. Namely, the transfer process of MEP problem is not a Markov chain. Thus, a self-avoiding random walk is defined to avoid any visited nodes. In such a random walk, for a path H, the transition probability \( {p}_{ij}^{(1)}(H) \) from node v i to v j is modified as follows:

$$ {p}_{ij}^{(1)}(H)=\left\{\begin{array}{cc}\frac{1/{w}_{ij}}{\sum_{e_{ik}\in E\&{v}_k\notin H}1/{w}_{ik}}& {v}_j\notin H\\ {}0& {v}_j\in H\end{array}\right. $$
(6)

Where, the operator “&” denotes the logical operation symbol “AND”. Unfortunately, as shown in Fig. 2, when the walker performs a self-avoiding random walk, it could be besieged by sensors or the previously visited path. In this situation, the walker is expected to take local backtracking or restart a walk.

Fig. 2
figure 2

The diagram of the besieged walker, where a shows the walker is besieged by the path visited before, b shows the walker is besieged by sensors

4.2 Self-avoiding random walk with intersection

Since the time complexity of computation of the self-avoiding random walk to find a path between a source point and a target point is the square of the distance, the algorithm of self-avoiding random walk with intersection is proposed.

We assume that the source and target are two “bases,” each of which dispatches several “walkers” to contact each other. When the walkers move in the grid network G by self-avoiding random walk, they move by transition probability \( {p}_{ij}^{(1)}(H) \) and leave marks on the nodes that have been visited. If two walkers from two bases meet directly or one walker moves to a node that has been visited by a walker from the opposite base, the path connecting two bases could be generated by routes of these two walkers, as Fig. 3 shows. Thus, this process is called as a self-avoiding random walk with intersection.

Fig. 3
figure 3

The diagram of self-avoiding random walk with intersection, where red cycle nodes represent the two bases, the blue and black paths denote the routes walked by walkers from the two bases, respectively. The roundabout path inside the dashed box is unreasonable

Suppose that n u (n u  ≫ 1) walkers are simultaneously dispatched from the base v s and v e , respectively, and routes created by walkers from the two sides are defined as \( {H}_i^s\left(1\le i\le {n}_u\right) \) and \( {H}_j^e\left(1\le j\le {n}_u\right) \). In the seeking process, if \( {H}_i^s\cap {H}_j^e\ne \varnothing \), there exists one intersection between routes from the i-th walker from v s and the j-th walker from v e . Then, these two walkers stop path seeking. Since the walkers from the two sides always check the intersection during the seeking processes, they could ensure that the connected path has only one intersection point. The connected path obtained between v s and v e is described as follows.

Assume that \( {H}_i^s\cap {H}_j^e=\left\{{v}_0\right\} \), \( {H}_i^s=\left\{{v}_s,{v}_{i_1},{v}_{i_2},\dots, {v}_{i_n},{v}_0,\dots \right\} \), and \( {H}_j^e=\left\{{v}_e,{v}_{j_1},{v}_{j_2},\dots, {v}_{j_{n^{\prime }}},{v}_0,\dots \right\} \), then the connected path between v s and v e is \( H=\left\{{v}_s,{v}_{i_1},{v}_{i_2},\dots, {v}_{i_n},{v}_0,{v}_{j_{n^{\hbox{'}}}},{v}_{j_{n^{\hbox{'}}-1}},\dots, {v}_{j_2},{v}_{j_1},{v}_e\right\} \).

4.3 Target guiding self-avoiding random walk with intersection

As a single path obtained by random walk possesses great randomness, it probably includes a roundabout route as shown in Fig. 3, which is unacceptable as the shortest path. Thus, target guiding is added in the random walk.

In the algorithm of a random walk with intersection, it is assumed that walkers from each side cannot predict the location of the opposite. In practice, locations of the base v s and v e could be obtained in advance, so that walkers from two sides could use the information of their target locations. Then, the algorithm of target guiding self-avoiding random walk with intersection (TGSARWI) is proposed, whose transition probability is deduced as follows.

Assuming that the coordinate of each node is known in the grid network G, and the coordinate of node v i is (x i , y i ). If v i and v j are two nodes in the network, the ray angle θ ij from v i to v j is described as Eq. (7) and Fig. 4.

$$ {\theta}_{ij}=\left\{\begin{array}{cc}\arctan \left(\frac{y_j-{y}_i}{x_j-{x}_i}\right)& \left({y}_j-{y}_i\right)\arctan \left(\frac{y_j-{y}_i}{x_j-{x}_i}\right)>0\\ {}\pi +\arctan \left(\frac{y_j-{y}_i}{x_j-{x}_i}\right)& \left({y}_j-{y}_i\right)\arctan \left(\frac{y_j-{y}_i}{x_j-{x}_i}\right)<0\end{array}\right. $$
(7)
Fig. 4
figure 4

The diagram of the ray angle θ ij from v i to v j , where the θ ij in a is a acute angle, and the θ ij in b is a obtuse angle

When a walker whose destination is v(x, y)reaches a node v t (x t , y t ) through the route H t , its undirected transition probability \( {p}_{tj}^{(1)}\left({H}_t\right) \) from v t to v j could be calculated by Eq. (6). Since locations of v t and v j have been known in advance, the transition probability could be represented by a vector \( \overset{\rightharpoonup }{d_{tj}} \) as follows:

$$ \overset{\rightharpoonup }{d_{tj}}={p}_{tj}^{(1)}\left({H}_t\right)\left(\cos {\theta}_{tj},\sin {\theta}_{tj}\right) $$
(8)

Meanwhile, unit vector \( \overset{\rightharpoonup }{e_{t\ast }} \) from v t to v is

$$ \overset{\rightharpoonup }{e_{t\ast }}=\left(\cos {\theta}_{t\ast },\sin {\theta}_{t\ast}\right) $$
(9)

Thus, considering the target guiding, the transition probability can be modified through vector projection as follows:

$$ {p}_{tj}^{(2)}\left({H}_t\right)=\overset{\rightharpoonup }{d_{tj}}\cdot \overset{\rightharpoonup }{e_{t\ast }}={p}_{tj}^{(1)}\left({H}_t\right)\cos \left({\theta}_{tj}-{\theta}_{t\ast}\right) $$
(10)

It is noted that the value of transition probability \( {p}_{tj}^{(2)}\left({H}_t\right) \) may be negative. To ensure it satisfies the non-negative and normalization requirement, Eq. (10) is improved as follows:

$$ {p}_{tj}^{(3)}\left({H}_t\right)=\frac{p_{tj}^{(1)}\left({H}_t\right){e}^{\rho \cos \left({\theta}_{tj}-{\theta}_{t\ast}\right)}}{\sum_{\left({v}_t,{v}_k\right)\in E}{p}_{tk}^{(1)}\left({H}_t\right){e}^{\rho \cos \left({\theta}_{tk}-{\theta}_{t\ast}\right)}} $$
(11)

As is shown above, the transition probability of TGSARWI, where ρ(ρ ≥ 0) is a target guiding factor, represents the strength of target guiding. Whenρ = 0, the target guiding is ineffective, and \( {p}_{tj}^{(3)}\left({H}_t\right)={p}_{tj}^{(1)}\left({H}_t\right) \). While ρ →  + ∞, the exposure w tj of the transition edge will play little role to \( {p}_{tj}^{(3)}\left({H}_t\right) \), and the path found by the algorithm is approximately a straight line between the two bases.

4.4 Dijkstra algorithm based on sub-network

Based on random walk algorithm, the TGSARWI algorithm would not definitely produce a connected path which is the optimum one. Thus, n h (n h  ≫ 1) connected paths were firstly generated. Then, those paths with the same source point and target point were combined to construct a connected sub-network G1 = (V1, E1, W1) of the grid network G followed by Dijkstra algorithm (DA) to solve MEP problem in this sub-network [44].

The exposure value of one path \( H=\left\{{v}_{t_1},{v}_{t_2},\dots, {v}_{t_p}\right\} \) is the sum of all edges’ exposures along the path defined as follows:

$$ E(H)=\sum \limits_{j=1}^{p-1}{w}_{t_j{t}_{j+1}} $$
(12)

DA is considered as a perfect method to solve the shortest path problem of a single source in a non-negative weight network. The core idea of DA is that the generation of the new shortest path is based on the existing shortest. Traditional DA has the shortage that it extends only one node by the shortest tentative distance at each step [45]. In the complex network of grid-based MEP problem, there is a high probability that multiple nodes have the same shortest tentative distance at one step. Thus, DA is improved to allow the extending of multiple nodes at one step and record necessary information.

Assuming that v s and v e are the source and target node, respectively, what the researcher needs to do is to find the shortest path between v s and v e . Here, the weight of edge e ij  ∈ E1 is defined as w ij in the sub-network G1. In DA, P and T are denoted as the sets of permanent and temporary nodes, respectively. Based on the above analysis, the improved DA could be described as follows:

(1) Label P to the node v s and record P(v s ) = 0. Then, define the set of new nodes labeled P as R = {v s }. Label T to other nodes and record Δ = {v j |v j  ∈ V & v j  ≠ v s }, when ∀v j  ∈ Δ, T(v j ) = ∞;

(2) For eachv t  ∈ R, for each v j  ∈ Δ & e tj  ∈ E1, if T(v j ) > P(v t ) + w tj , set T(v j ) = P(v t ) + w tj and Γ(v j ) = v t ;

(3) Set R = ∅;

(4) For eachv i  ∈ Δ, if \( T\left({v}_i\right)=\underset{v_j\in T}{\min }T\left({v}_j\right)\&{v}_i\ne {v}_e \), label P to the node v i , and define P(v i ) = T(v i ), R = R ∪ {v i }, Δ = Δ − {v i }. if \( T\left({v}_i\right)=\underset{v_j\in \Delta}{\min }T\left({v}_j\right)\&{v}_i={v}_e \), label P to the node v i , and define P(v i ) = T(v i ), algorithm end, else return to (2).

In the above steps, Γ records the shortest path information from the source node to other nodes in the improved DA. The information recorded by Γ is incomplete, because the algorithm calculates part of the shortest paths from the source node to all other nodes. However, it can be ensured that the information of the shortest path H m from v s to v e is complete. Then, H m can be obtained through the following backtracking algorithm:

  1. (1)

    Initialize H m  = {Γ(v e ), v e } and set v t  = Γ(v e );

  2. (2)

    If v t  = v s , backtracking end, or go to (3);

  3. (3)

    Set \( {H}_m=\left\{\Gamma \left({v}_t\right)\right\}\tilde{\cup}{H}_m \), v t  = Γ(v t ), and return to (2).

Where H m is the shortest path fromv s to v e , which is an ordered set, \( \tilde{\cup} \) in step (3) represents ordered union operation. For example, if there exists an ordered set A = {v1, v2}, then the following results will be obtained, \( \left\{{v}_3\right\}\tilde{\cup}A=\left\{{v}_3,{v}_1,{v}_2\right\} \) and \( A\tilde{\cup}\left\{{v}_3\right\}=\left\{{v}_1,{v}_2,{v}_3\right\} \).

4.5 Algorithm pseudocode

Here, the pseudocode is presented for the overall algorithm, including the TGSARWI algorithm and the improved DA (called TGSARWI DA).

figure a

5 Simulation result and discussion

The studies about the convergence and complexity for random optimization-based heuristic algorithm are usually based on Markov chain, which has no aftereffect property [46,47,48,49,50,51,52]. TGSARWI DA is based on the algorithm of self-avoiding random walk and combines target guiding and intersection of paths. Since the walking process does not have after effect property, it no longer belongs to the category of Markov process. Hence, it is inappropriate to do the complexity analysis for our algorithm by common theories. This work integrates theoretical analysis and numerical simulation to discuss the algorithm performance.

In this section, simulations are conducted to verify the algorithm for the MEP problem. Firstly, the effect of the parameter ρ on the algorithm is evaluated. Secondly, the algorithm performance is analyzed with precision assessment, complexity analysis, and comparison with POA. Finally, the robustness of the algorithm is discussed.

In order to distinguish the application of DA to the global grid network and the sub-network created by TGSARWI, they are defined as Global DA and TGSARWI DA, respectively.

5.1 Effect evaluation of the target guiding factor

The effects of the target guiding factor ρ are discussed on the number of iterations for finding the first connected path (T f ), the number of iterations for finding all the required connected paths (T l ), and the minimum exposure E(H), respectively.

The simulation is implemented in the grid with the scale of 50 × 50, in which the length of edge is 10, the number of sensors is 50 and their directions, and coordinates are generated randomly. The initial graph created is shown in Fig. 5. For each parameter ρ, the algorithm is simulated 100 times and the average values of T f , T l , and E(H) could be obtained.

Fig. 5
figure 5

The initial graph which used to simulate our algorithm, in which sensor types include directional sensor and omnidirectional sensor

Figure 6a shows that when the parameter ρ increases, T f and T l decrease. The reason is that the influence of target guiding on the transition probability increases with the increment ofρ, which weakens the walker’s randomness and decreases the number of iteration. In fact, T f and T l decrease sharply when ρ belongs to the area of [0, 0.9]. However, when ρ > 0.9, the numbers of iterations reach stable. This means that, as ρ further increases, the influence on finding the connected path is little.

Fig. 6
figure 6

The diagram of the effect of factor ρ to the algorithm, where a shows the trends of iteration number of first path and TGSARWI paths with the changes of ρ, and b shows the trend of the minimum exposure obtained by TGSARWI DA with the changes of ρ

The effect of parameter ρ to minimum exposure E(H) is displayed in Fig. 6b. Roughly speaking, with the increment of ρ, the value of E(H) first decreases and then increases. When ρ is small, the randomness of the walkers is large. Thus, the sub-network formed by n h connected paths is sparse (see Fig. 7a, b), leading to a large value of E(H). However, if ρ is too large, walkers cannot avoid moving along edges with large exposure due to the constraint of target guiding (see Fig. 7c, d). This can also make the value of E(H) large. Figure 6b shows that E(H) achieves the minimum as ρ = 0.9. Thus, ρ is set as 0.9 in simulations.

Fig. 7
figure 7

The sub-network created by TGRWI algorithm with different target guiding factor, where the ρ is set as 0.01, 0.9, 10, and 500, respectively

Taking ρ as 0.9, the MEP problem presented in Fig. 5 is addressed with TGSARWI DA algorithm. It is also solved with Global DA as a comparison. As shown in Fig. 8, although those algorithms generate different optimum paths, the values of E(H) are very close.

Fig. 8
figure 8

An example of comparison of Global DA and TGSARWI DA

It is worth to note that TGSARWI DA algorithm owns good generality. Once the value of parameter ρ is chosen, the algorithm could solve MEP problem with various field scales and different sensor densities. In the following simulations, ρ is always set as 0.9.

5.2 Performance evaluation of TGSARWI DA

The performance of TGSARWI DA algorithm is evaluated from three aspects, i.e., precision, complexity analysis, and comparison with POA.

The minimum exposure path found by Global DA is considered as optimal path. Thus, TGSARWI DA is compared with Global DA. Considering the time efficiency, the first path found by TGSARWI is also included in the comparison. In order to overcome the randomness feature of single simulation, 30 independent repetitive simulations are performed and the average value is taken.

The numbers of walkers and connected paths which form sub-network are related with the scale of the field. As for a field with scale m × n, these values are respectively taken as \( {n}_u=\left\lfloor 30+\sqrt[4]{mn}\right\rfloor \), and \( {n}_h=\left\lfloor 30+2\times \sqrt[4]{mn}\right\rfloor \).

5.2.1 Precision assessment

Since the time complexity of Global DA grows rapidly as field scale increases, simulations are initially conducted in the field whose scale changes from 10 × 10 to 150 × 150 (see Fig. 9a). In order to avoid the effect of sensor density, the density of sensors is fixed as 0.02. Namely, the sensor number is 2% of the total number of nodes in the grid network. Then, the field scale is fixed as 50 × 50, and the sensor density is adjusted from 0.04 to 0.4 (see Fig. 9b).

Fig. 9
figure 9

Precision comparison of Global DA, TGSARWI DA, and the first path obtained by TGSARWI in various field scales and sensor densities, where a shows the exposure trends of three paths with the changes of field scale, and b shows the exposure trends of three paths with the changes of sensor density

Figure 9a shows the trends of E(H) corresponding to the first connected path HTFP obtained by TGSARWI, path HTDA obtained by TGSARWI DA and path HGDA obtained by Global DA with the increasing of scale, respectively. E(H) of HTDA and HGDA are almost equal, whose relative error is 4.59% and maximum value is 6.39%. In contrast, E(H) of HTFP is much larger than that of HGDA. Their average relative error is 85.49%. In Fig. 9, E(H) of HTDA and HGDA are almost the same in various sensor density fields. In fact, their average relative error is only 2.19%. However, E(H) of HTFP is greater than HGDA, and their average relative error is 50.41%. These results suggest that, when dealing with MEP problem with various field scales and different sensor densities, TGSARWI DA exhibits performance nearly as well as Global DA.

5.2.2 Time computation complexity analysis

For a field with scale m × n, the time computation complexity of DA is O(m2n2),Footnote 1 which means that DA is not suitable for solving MEP problem with a rather large-scale field. Here, the time computation complexity of Global DA is compared with TGSARWI DA in different grid scales and various sensor densities. The scale of the field is set from 10 × 10 to 900 × 900, and the sensor density is in the area of [0 0.4].

In this paper, the time computation complexity is measured from two aspects, i.e., first connected path found by TGSARWI and the minimum exposure path found by TGSARWI DA.

For the first connected path, the time computation complexity is mainly associated with the transition possibility \( {p}_{tj}^{(3)}\left({H}_t\right) \) of each walker at each step in the grid network, which is about O(n u  × T f ). Further, the time computation complexity benefit ηTFP of the first path found by TGSARWI is defined as the ratio of complexity of finding first connected path by TGSARWI and DA, which is represented as follows:

$$ {\eta}_{\mathrm{TFP}}=\frac{n_u\times {T}_f}{{\left(m\times n\right)}^2}\approx {T}_f\left(30{(mn)}^{-2}+{(mn)}^{-\frac{7}{4}}\right) $$
(13)

For the minimum exposure path, to quantitatively analyze the simplifying efficacy of TGSARWI algorithm to MEP problem, the reduction ratio r is defined as the norm ratio of sub-network G1 formed by n h connected paths to the original grid network G:

$$ r=\frac{\left\Vert {G}_1\right\Vert }{\left\Vert G\right\Vert }=\frac{\left\Vert {G}_1\right\Vert }{m\times n} $$
(14)

Where ‖•‖ is the number of edges of the network. Since the time computation complexity of sub-network forming is aboutO(n u  × T l ), and the time computation complexity of minimum exposure path found by TGSARWI DA is O(n u  × T l  + r2 × (m × n)2), the time computation complexity benefit η TDA is calculated as follows:

$$ {\eta}_{\mathrm{TDA}}=\frac{n_u\times {T}_l+{r}^2\times {\left(m\times n\right)}^2}{{\left(m\times n\right)}^2}\approx {T}_l\left(30{(mn)}^{-2}+2{(mn)}^{-\frac{7}{4}}\right)+{r}^2 $$
(15)

In Fig. 10a, the iteration number T f is growing linearly as the field scale increases, whose slope is about 0.9803. Compared with the time computation complexity of DA that is O(m2n2), the efficiency of first path found by TGSARWI algorithm is higher. From Eq. (13) and Fig. 10b, it is shown that the first path benefit η TFP decreases significantly as the scale increases. Specifically, when the field scale is 900 × 900, ηTFP is only 8.3493 × 10−8. These results suggest that TGSARWI is efficient to find out the first path for timeliness demand in large-scale field, such as real-time solution and online calculation, although the exposure performance of HTFP is not as good as Global DA.

Fig. 10
figure 10

The time computation complexity of TGSARWI with various field scales. a Shows the trend of iteration number of the first path obtained by TGSARWI. b Shows the trend of the first path benefit. c Shows the trend of iteration number for finding all the required connected paths. d Shows the benefit trend of iteration number for finding all the required connected paths

In Fig. 10c, although the iteration number T l of TGSARWI DA increases exponentially with the change of field scale, its exponential coefficient is only about 0.0046. Meanwhile, in Fig. 10d, the complexity benefit ηTDA gradually deceases with the increasing of the scale, and finally goes close to zero. Particularly, its minimum value is 0.0042 when the field has the scale of 900 × 900, suggesting that TGSARWI DA only uses 0.42% computation time of Global DA.

Similar measures are also employed to analyze the time computation complexity of TGSARWI DA with various sensor densities. In Fig. 11a, iteration numbers of the first path found in the field for different sensor densities are visualized. The number of iterations increases linearly with the density of sensors in the areas of [0.0.312] and (0.312, 0.4], respectively. The linear relation suggests that TGSARWI is not sensitive to the change of sensor density, making it suitable to solve MEP problem in the field with high density sensors. The equations of the two fitting lines are shown in the inner figure. The slope of the straight line in the latter area is much larger than that in the former area, implying that the time to find a path increases sharply when the density of sensors exceeds the critical value 0.312. This is because if the distribution of sensors is too dense, it will be rather difficult for the walker to find an accessible path. In the area that density of sensors is reasonable (here it is [0, 0.312]), TGSARWI is expected to identify a path at a rather fast speed. For example, when the number of sensors is 780, corresponding to the density of sensor 0.312, only 41 steps are needed to find the first connected path. Figure 11b shows how the iteration number to find all the required connected paths changes with sensor density. The iteration number T l is proportional to the sensor density. The curve increases gently when the sensor density is below 0.312 and grows rapidly as the density is above 0.312. The fitting function of the curve is \( y=\frac{30.2064}{0.4276-x} \). Accordingly, it is obviously shown that the complexity of finding connected path increases as the density becomes denser, while the maximum sensor density for TGSARWI algorithm to find connected sub-network is 0.4276.

Fig. 11
figure 11

The time computation complexity of TGRWI for various sensor densities. a Shows the trend of iteration number of the first path obtained by TGSARWI. b Shows the trend of iteration number for finding all the required connected paths

5.3 Comparison with POA

As a representative of heuristic algorithms in solving MEP problem, physarum optimization algorithm (POA) has the ability to find the minimum exposure path in the field with various type sensors and reduce the time computation complexity [40]. However, the growth of time computation complexity is still too fast.

According to ref. [40], in the field with scales of 10 × 10, 20 × 20, 50 × 50, and 100 × 100, as well as with the sensor number of 10, 30, and 50, the minimum exposures of paths found by POA and DA are quite close. The relative errors of E(H) of paths got by POA and Global DA are 0.0240 and 0.0542 in different field scales and sensor densities. TGSARWI DA is also compared with Global DA in the same condition. The relative errors are 0.0219 and 0.0459 in different field scales and sensor densities, respectively. These results suggest that the algorithm has slightly better performance than POA.

The time computation complexity of TGSARWI DA is further compared with that of POA. Numbers of iteration for POA are taken from ref. [31]. As shown in Fig. 12, the iteration number of POA is far greater than that of TGSARWI DA, no matter what scale the field and the sensor density are. These results fully demonstrate that TGSARWI DA is more appropriate to solve MEP problem with a large-scale field and high-sensor density.

Fig. 12
figure 12

Comparison of time computation complexity for POA and TGSARWI DA with different field scales and sensor number. a Shows the comparison of iteration number T l with the various field scales. b Shows the comparison of iteration number T l with the different sensor number

5.4 Robustness discussion

In this section, variation coefficient is applied to quantitatively analyze the vulnerability of TGSARWI deceased by the stochastic fluctuations of target guiding factor ρ, the number of walkers n u and the number of connective paths n h [53]. The fluctuation coefficient φ(X) of sample data X is defined as:

$$ \varphi (X)=\frac{\sqrt{D(X)}}{F(X)} $$
(16)

where F(X) and D(X) donate the expectation and variance of X, respectively. The closer the coefficient φ(X) to zero is, the smaller fluctuation the sample data Xhas.

Based on current parameters, 100 groups of normal distribution rates are generated and 50 groups of sample data are created, according to each normal distribution rate. Then, corresponding iteration number T l , and the minimum exposure E(H) are calculated according to each normal distribution. Finally, values of φ(ρ), φ(n u ), φ(n h ), φ(T l ), and φ(E(H)) are obtained. φ(T l ) and φ(E(H)) are set as vertical coordinates, φ(ρ), φ(n u ), and φ(n h ) as horizontal coordinates, respectively and show their relationships in Fig. 13.

Fig. 13
figure 13

Comparisons of fluctuation coefficients of the parameters. a Shows the fluctuation effect of ρ to E(H). b Shows the fluctuation effect of n u to E(H). c Shows the fluctuation effect of n h to E(H). d Shows the fluctuation effect of ρ to T l . e Shows the fluctuation effect of n u to T l . f Shows the fluctuation effect of n h to T l

From Fig. 13a, b, when ρ and n u fluctuate in the interval [0, 0.5], the fluctuation coefficients of the minimum exposure E(H) change little, the maximum values of φ(E(H)) are 0.0331 and 0.0315, respectively. They are all smaller than the corresponding fluctuation coefficients of parameters, indicating that TSAGRWI DA owns quite excellent robustness to the stochastic fluctuations of these two parameters. In Fig. 13c, φ(E(H)) increases quadratically with φ(n h ), but still satisfies φ(E(H)) < φ(n h ).The maximum value of φ(E(H)) is 0.0726, indicating E(H) also owns better robustness to the stochastic fluctuation of n h . In summary, E(H) is not sensitive to the fluctuation of the three parameters n h , ρ, and n u .

Figure 13d–e show that φ(T l ) increases as φ(ρ), φ(n u ), and φ(n h ) grow. The values of φ(T l ) increases quadratically with the increase of φ(ρ) and φ(n u ), and the increasing rate of the former is faster than the latter. When φ(ρ) ≤ 0.1611 and φ(n u ) ≤ 0.2370, the fluctuation coefficient of T l is smaller than those of ρ and n u , suggesting that T l is not sensitive to the fluctuation of ρ and n u in these areas. φ(ρ) > 0.1611 and φ(n u ) > 0.2370, the fluctuation coefficient of T l is larger than those of ρ and n u , which indicates that T l is sensitive to the fluctuation of ρ and n u in these areas. φ(T l ) grows linearly as φ(n h ) increases, and the slope is 0.7224, which is smaller than 1, implying that T l has better robustness to the fluctuation of n h . In a word, the sensitiveness of iteration number T l to the stochastic fluctuations of parameters could be sorted in descending order as ρ, n u , and n h .

It is worth to note that both fluctuation coefficients of T l and E(H) have positive values during the fluctuations of ρ, n u , and n h , which are mainly caused by the randomness of TGSARWI.

6 Conclusions

MEP problem comes from the requirement to evaluate the coverage quality of field with sensor deployment. According to the minimum exposure path, the deployment of sensors could be improved. This study aims to enhance the computation efficiency for MEP problem. The random walk is modified from the perspective of target guiding, self-avoiding, and route interaction to propose an algorithm called TGSARWI. A sub-network is constructed by multiple connected paths generated by a group of random walkers using TGSARWI. Then, Dijkstra algorithm is applied to solve MEP problem in this sub-network. The simulations mentioned in this study suggest that, the minimum exposure path solved by the approach above is comparable to that solved by Global DA, while the time computation complexity of TGSARWI DA is only 10− 3 of that for DA. Compared with existing heuristic algorithms such as physarum optimization algorithm (POA), this algorithm exhibits higher generality and efficiency. Therefore, our algorithm could solve MEP problem in fields with large-scale or high-density sensors. In fact, it is possible to extend TGSARWI DA to solve the MEP problem in the three-dimensional field, or the field with special protection area, etc. It is expected to shed new lights on the study about MEP problem and promote the development of WSN.