1 Introduction

In modern era, the low cost, of sensors has given lots of opportunities where the Wireless Sensor Network (WSN) can be used for monitoring the real time events. Low cost makes WSNs suitable for home automation, office automation, healthcare system, various military applications, environmental application, vehicle monitoring [1]. WSNs are used for monitoring the events and transmission of the same sensed data to desired destination [2]. Oil/gas/water pipelines, river monitoring, border monitoring is some of the examples where nature of the sensor network is linear. Therefore, for these kinds of application a special type of sensor network i.e. LWSN is required. Due to, special topology of LWSN, the methods proposed so far for traditional WSN systems may not be feasible in case of LWSN.

One of the most challenging tasks while setting up the sensor network is to place the sensor nodes at most appropriate position. Since with the positioning of sensor nodes many other things are correlated like lifetime of sensor network, throughput, delay and maximum coverage area. After deploying the sensor network, changing the power source frequently is not a feasible solution, which directly affect the lifetime of sensor network. Similarly, an efficient routing algorithm is an important component to save the energy of the sensor nodes which has direct relation with the lifetime of the network.

Therefore, in this paper, an attempt has been made to modify the Lion Optimization Algorithm for efficient node placement strategy in LWSN. A Jump and Redirect routing protocol has been used for data transfer between placed nodes. The presented approach has been compared for lifetime, end to end delay and throughput with four other techniques namely Lion Optimization Algorithm (LOA), Genetic Algorithm (GA), Ant Colony Optimization (ACO) and no optimization.

2 Related Work

In [2, 3] the classification of LWSN and major research challenges in LWSN have been discussed. The node placement and network lifetime optimization are an important research problem in the field of LWSN [4,5,6,7,8]. A large number of schemes have been proposed by the researchers for sensor node deployment and data transfer to increase the lifetime of LWSN [9,10,11,12,13,14,15,16,17,18,19].

The greedy approach has attracted researchers because of its simplicity and has been extensively used to solve various optimization problems [20]. The greedy approach presented in [20], showed the optimal sensor placement scheme (simple equidistance node deployment) in a pipeline, the primary intention was to enhance the lifetime of the network.

In [21] an exhaustive survey has been presented for road and pipeline monitoring using linear sensor network. Another comparative study has shown in [22] for the key factors which are involved in the monitoring the pipelines using Robots and WSN. In [23], a hybrid mechanism for the monitoring of water pipeline has been proposed, which uses real-time transient modelling and wave propagation to locate the position of leak. Another survey [24] has been presented for the pipeline monitoring using WSN.

Recently, meta-heuristic techniques have attracted the researchers to be used for node placement in WSNs. Meta heuristic techniques are primarily classified into two categories: a. single solution-based population based meta heuristics [25]. Following features makes the use of Meta-heuristic optimization methods increasing day by day for designing various applications [25]

  1. (i)

    Depend on basic ideas and are easy to execute.

  2. (ii)

    Can sidestep neighbourhood optima.

  3. (iii)

    These can be used in an extensive variety of issues covering diverse controls.

A particle swarm optimization (PSO) based clustering algorithm for mobile sink in WSN has been proposed, in which the virtual clustering techniques is performed during routing process. The primary parameters considered are residual energy and position of the nodes [26]. Another improved algorithm using ACO has been proposed for mobile sink in WSN which is used to calculate the cluster head distance [27].

One of the major sub class of meta heuristic approaches is Nature-inspired technique which is a population-based approach. In recent years, a new nature inspired meta heuristic technique named as Lion Optimization Algorithm (LOA) has been proposed in [28]. Recently a new meta-heuristic optimization method known as Lightning Attachment Procedure Optimization (LAPO) has been proposed by Foroughi [29], which is based on the lightning procedure of cloud in zigzag direction.

Now-a-days nature inspired techniques are very common as the solution in various applications. Recently [30, 31] have implemented some meta heuristic (nature inspired) techniques for node deployment, data transfer and maximize the lifetime for LWSN to monitoring of oil/gas/water pipelines. In [30], GA and ACO has been implemented and compared with No Optimization (Greedy Approach) technique and shows that ACO works better than other two approaches. In [31], a LAO algorithm has been implemented and compared with CAO, GA, No Optimization. Results shows that the proposed approach works better than the other three. LOA is inspired with the hunting nature of lion.

In the present exposition, LOA has been modified with the use of Lightning Attachment Procedure Optimization (LAPO) [29] to solve the node/base station placement and network lifetime optimization of an LWSN. The objectives of the optimization problem are to maximize the coverage, connectivity and prolonged network lifetime. The extensive simulation experiments comparing the proposed approach with the closest work [30, 31] have also been presented in the paper which show the effectiveness of the proposed schemes.

3 Problem Statement

Given a straight pipeline segment carrying oil/gas/water as shown in Fig. 1. These straight pipelines are placed in crisscross manner such that they are making a structure as described in Fig. 2. The length of pipeline varies from few meters to several kilometres. For security of the pipeline and to save the resources (oil/gas/water) a sensor network needs to setup. Primary objective of setting up the sensor network is to deploy the sensors along the pipeline in a way so that the lifetime of network can be maximized, sense the parameters and send the sensed data to nearest base station at earliest without delay. So Hence, the scenario is that a pipeline having length L ended with base station at each end. Sensor Nodes S (S1, S2, S3, …. Sn) are being deployed on the pipelines. As sensor nodes have some restrictions in terms of limited battery power, limited range, so the objective is to place these nodes in such a way that lifetime and throughput can be maximized, and delay can be reduced.

Fig. 1
figure 1

Single straight pipeline

Fig. 2
figure 2

Pipelines placed in criss-cross manner

There can be two cases:

  1. 1.

    Set up the sensor network for a new pipeline.

  2. 2.

    Set up the sensor network for existing pipeline.

This paper discussed the setup of a sensor network for new pipeline such that minimum numbers of sensor nodes are required (as per their range), still maximum area can be covered so that lifetime can be maximized. Also, the data can be transferred to the Base station with minimum delay.

4 Proposed Solution

Evolutionary approaches are well known for solving the various real-life problems among researchers. [20, 25] used Genetic Algorithm (GA), Ant Colony Optimization (ACO) and Lion Optimization Algorithm (LOA) for sensor deployment problem in LWSN and claimed that algorithms are efficient and effective on various parameters. In the proposed solution the hunting nature of lion has been modified with the help of lighting procedure in cloud. The advantage of using LAPO with LOA is that, in LOA sensors are being placed in a straight line. But after combining the two approaches, the sensors can be place straight as well as in zigzag manner [30], which will cover more area as compared to only LOA.For sending the data from sensor nodes to BS,Jump and redirect routing [16] mechanism is used.

4.1 Lion Optimization Algorithm (LOA)

Lion Optimization Algorithm is a populace based meta-heuristic approach proposed by M. Yazdani and F. Jolai [19]. The idea of this approach has been taken from the social and hunting behavior of lions. Lions are socially divided into two sets namely wanderers and pride (having both male and female lions). Wanderers are generally move and hunt either single or in pair while pride always move and hunt in groups. Here, set of lions are represented by \(\left[{s_{1},s_{2},s_{3}, \ldots s_{n}} \right]\). Initially, sensor nodes are deployed randomly in the hunting space, where sensors are being divided into two parts i.e. wanderers and prides. Every pride (cluster) is further divided into males and females [28]. Equation 1 is used to get the position of the quarry, which uses the position of falconers. Here, sensor nodes represent the number of lions (falconers) which consist of both categories i.e. pride and wanderers. The base station represents the quarry which is to be approached.

$$P_{quarry} = \sum {\raise0.7ex\hbox{${p_{falconers} \left({s_{1},s_{2},s_{3}, \ldots,s_{nv}} \right)}$} \!\mathord{\left/{\vphantom {{p_{falconers} \left({s_{1},s_{2},s_{3}, \ldots \ldots \ldots,s_{nv}} \right)} {number\,of\, falconers}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${number\,of\,falconers}$}}$$
(1)

Here \(P_{falconers}\,and\,p_{quarry}\) are the position of falconers and quarry respectively. Initially the falconers are chosen arbitrarily and after that Eqs. (2), (3) and (4) are used to update the position (right, left and center)of quarry and falconers.

$$p_{quarry}^{\prime} = p_{quarry} + rand*precentage_{i} *\left({p_{quarry} - P_{falconer}} \right)$$
(2)
$$P_{falconer}^{\prime} = \left\{{\begin{array}{lll} {rand*\left({2*p_{quarry} - P_{falconer}} \right) + p_{quarry}} \hfill & {if} \hfill & {\left({2*p_{quarry} - P_{falconer}} \right) < p_{quarry}} \hfill \\ {rand*p_{quarry} + \left({2*p_{quarry} - P_{falconer}} \right)} \hfill & {if} \hfill & {\left({2*p_{quarry} - P_{falconer}} \right) > p_{quarry}} \hfill \\ \end{array}} \right.$$
(3)
$$P_{falconer}^{\prime} = \left\{{\begin{array}{lll} {rand*P_{falconer} + p_{quarry}} \hfill & {if} \; {P_{falconer} < p_{quarry}} \hfill \\ {rand*p_{quarry} + P_{falconer}} \hfill & {if} \; {P_{falconer} > p_{quarry}} \hfill \\ \end{array}} \right.$$
(4)

Here random numbers are generated between 0 and 1 is using random function(rand).

The size of pride is changed in every iteration with the help of tournament process by using Eq. (5).

$$Size_{p}^{i} = \hbox{max} \left({2, ceil\left({{\raise0.7ex\hbox{${inol_{i}}$} \!\mathord{\left/{\vphantom {{inol_{i}} 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}} \right)} \right)\quad {\text{i}} = 1,2,3,4, \ldots, {\text{N}}$$
(5)

where \(inol_{i}\) is defined as the number of lions in ith pride who improved fitness in previous iteration can be calculated using Eq. (6).

$$inol_{i} = \mathop \sum \limits_{j = 1}^{n} sucess\left({j,iter,N} \right)\quad {\text{i}} = 1,2,3 \ldots, {\text{N}}$$
(6)

Here the \(sucess\left({j,iter,N} \right)\) calculates the success of jth lion in group N at iteration iter, denoted by Eq. (7)

$$sucess\left({j,iter,N} \right) = \left\{{\begin{array}{ll} 1 \hfill & {best_{j,n}^{iter} < best_{j,n}^{iter - 1}} \hfill \\ 0 \hfill & {best_{j,n}^{iter} = best_{j,n}^{iter - 1}} \hfill \\ \end{array}} \right.$$
(7)

To avoid local optima, wanderers moves arbitrarily in search of new space (explorative search). The movement of the ith wanderers in the jth group is represented by Eq. (8)

$$nomad_{ij}^{lion;} = \left\{{\begin{array}{ll} {nomad_{ij}^{lion}} \hfill & if \; rand > pr_{i} \hfill \\ {rand} \hfill & {else} \hfill \\ \end{array}} \right.$$
(8)

Here, the probability generated for ith nomad represented as \(pr_{i}\) can be given by Eq. (9)

$$pr_{i} = 0.1 + \hbox{min} \left({0.5,\frac{{nomad_{i} - best_{nomad}}}{{best_{nomad}}}}\right)\quad i = 1,2,3 \ldots \;{\text{number of nomads}}$$
(9)

where \(best_{nomad}\, and\, nomad_{i}\) are the cost of current position of best nomad and ith nomad respectively.

Lions change their roles among themselves i.e. male lion of any pride or wanderer may beat the lion of other pride and can take their place in that pride. Some female lions also relocate themselves from one pride to another. Because of this movement of lions, the quantity of lions may vary time to time specifically in case of pride.

This concept of life exchanging among lions is used for optimal node placement in LWSNs.

4.2 Lightning Attachment Procedure Optimization (LAPO)

This optimization technique depicts the lightning nature of the clouds. The overall procedure is breakdown into four phases namely breakdown of air on surface, movement of lightning downwards, upward inception of leader and final jump. Figure 3 shows the starting point i.e. breakdown of air. Figure 4 shows the formation of upward leader and propagation through downward leader. The process of the algorithm initiates with the test points which are available on the cloud as well as on the ground. Any test point within the given search space can be defined by the Eq. (10)

$$C_{tp} = C_{\min} + rand \times (C_{\max} - C_{\min})$$
(10)

Here Cmax and Cmin are the upper and lower limit of the search space respectively. rand is the random function to generate the random value between 0 and 1. The fitness function is used to compute the electric field for the given test point by using Eq. (11)

$$F(C_{tp}) = fitness(C_{tp})$$
(11)
Fig. 3
figure 3

Different starting point of lightning in cloud [29]

Fig. 4
figure 4

The upward leader formation and propagation through the downward leader [29]

This charge points can be of small positive charge which is placed on lower portion of the cloud. It can be high positive value placed at upper portion of the cloud or high negative value placed at lower part of cloud. The movement of charge is described by using Eq. (12)

$$C_{new}^{\prime} = C_{leader} + rand*\left({C_{avg} - C_{current}} \right)$$
(12)

This leads to the movement of charge towards the ground from the cloud in efficient manner. Figure 5 shows the movement of light used in the proposed work. The pseudo code of LAPO is given as:

figure d
Fig. 5
figure 5

Jumping of light in zig-zag manner

4.3 Node Deployment in LWSN Using Lightning-Based LOA

Figure 6 shows the final arrangement of nodes placed on pipelines after combining LAPO with LOA. A fitness function and node deployment algorithm for the network of pipelines using lightning-based LOA has been proposed in the following section.

Fig. 6
figure 6

Pipelines placed in crisscross manner using lightning-based LOA

4.3.1 Fitness Function Used for Node Deployment

Let L is the length of pipeline section and the minimum number of nodes (\(min_{No\_nodes}\), having communication range R) to be deploy on this pipeline section can be calculated as

$$min_{No\_nodes} = \frac{L}{2*R}$$
(13)

As per Eq. (13), the nodes will be deployed at a distance of 2*R. However, the optimization of sensor nodes is needed such that in case of any node failure the network remains connected. So, for this reason backup nodes are being used at a distance of 2*R. So,

$$No_{nodes} = \frac{L}{2*R} + \frac{L}{2*R} = \frac{L}{R}$$
(14)

If the nodes are being place at a distance of 2*R then in case of any node failure the communication will be break so, \(\frac{L}{2*R}\) are the additional sensor nodes used to backing up the communication, so that in case of any node failure network is still connected. Nodes which are nearest to the base station (Leader node) has the liability of sending its information and the information collected by other nodes to the base station. So, the node nearer to the base station plays an important role in communication as they will receive all the packets from other nodes and in case of any leader node failure can affect the network lifetime. So, as compare to the other nodes, the nodes near to the base station consumes large amount of energy. That’s why volunteer nodes are being placed nearer to the nodes closest to the base station. In between, the nodes which are sending the packets can experience the overflow of packets because of small size of buffer, due to which messages could be dropped.

This pipeline is optimized using the hybridization of LAPO with LOA. The corresponding fitness function F’ to get the optimized position of the sensor node based on the cost of processing in LWSN is as follow:

$${\text{f}}^{\prime} = {\raise0.7ex\hbox{${\alpha_{1}}$} \!\mathord{\left/{\vphantom {{\alpha_{1}} {dist}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${dist}$}} + \alpha_{2} *delay + \alpha_{3} *drop_{ratio}$$
(15)

Such that

$$\alpha_{1} + \alpha_{2} + \alpha_{3} = 1$$

The three parameters considered for fitness functions are:

  1. (a)

    dist is distance between two adjacent nodes.

  2. (b)

    delay is the delay between two ends.

  3. (c)

    drop_ratio is relation of the total packetslost/total packets sent.

The purpose of this fitness function is to place the node at utmost distance having minimum drop_ratio and delay. The optimization function can be executed in two situations; one normal and another if the nearest node of the current node is ignored.

The average of the two functions in of both the scenarios is used as the decision factor. Here, \(\alpha_{1} = 0.3, \alpha_{2} = 0.3, \alpha_{3} = 0.4\) taken based on simulations done.

Here distance dist has to be maximized to cover the maximum distance on the pipeline while the delay and drop_ratio has to be minimized to reduce the delay and the packet drop during transmission respectively. As much as distance is covered, maximum will be the connectivity and coverage. If the number of drop packets are less means, there will be less retransmission and there will be less load on the nodes for retransmission and the frequency of the dyeing node will be less and the network’s lifetime is directly depending on the life of the nodes. Lifetime is the total time, a network survived with given parameters and Normalized lifetime can be calculated as:

$$nle_{i} = \frac{{lifetime_{i} - { \hbox{min} }\left({lifetime} \right)}}{{\hbox{max} \left({lifetime} \right) - { \hbox{min} }\left({lifetime} \right)}}$$

where lifetime is the lifetime of ith scenario while max(lifetime) and min(lifetime) gives the maximum and minimum lifetime among different scenarios.

The algorithm used for node deployment is given below:

4.3.2 Algorithm Used for Node Deployment

Setup of pipeline comprises below mentioned fields:

  1. (a)

    Position of BS (Base Station).

  2. (b)

    Transmitting Range R.

  3. (c)

    Initial and Final co-ordinate of the medium in X plane/axis.

  4. (d)

    Initial and Final co-ordinate of the medium in Y plane/axis.

Pipeline setup (\(bs,r, xstart, xend, ystart, yend\)).

The algorithm proposed in this section is used for the setup a new pipeline with n number of nodes deployed on it with communication range as R and a base station BS on each end. Position of Base Station and sensor nodes will be decided by the proposed algorithm. This area for setting up the pipelines is (xEnd-xStart)*(yEnd-yStart).

Algorithm is shown as follows:

figure e

5 Performance Evaluation and Result Analysis

The algorithm described earlier has been implemented using MATLAB and analyzed over the different scenarios varying in terms of pipeline length and compared with different existing closest techniques i.e. no optimization, ACO, GA and LOA on various parameters namely end to end delay, throughput and the normalized lifetime. Table 1 shows the parameters used for simulation. Each sensor node has been allocated initial energy as 1 J, which is consumed during processing of data. Communication range of sensor nodes has been taken as 25 and 50 m. Maximum packets in a queue will be 50. Table 2 shows the other parameters taken for simulation as input variables like initial vector value, crossover probability, mutation probability etc. Tables 3, 4, 5, 6, 7 and 8 show the comparison of delay, throughput and lifetime among No optimization, ACO, GA, LOA and proposed technique, same has been shown graphically in Figs. 7, 8, 9, 10, 11 and 12.

Table 1 Parameters for simulation
Table 2 Parameters used for simulation
Table 3 Delay (range 25 m)
Table 4 Delay (range 50 m)
Table 5 Throughput (range 25 m)
Table 6 Throughput (range 50 m)
Table 7 Normalized lifetime (range 25 m)
Table 8 Normalized lifetime (range 50 m)
Fig. 7
figure 7

End-to-end delay (range 25 m)

Fig. 8
figure 8

End-to-end delay (range 50 m)

Fig. 9
figure 9

Throughput (range 25 m)

Fig. 10
figure 10

Throughput (range 50 m)

Fig. 11
figure 11

Normalized lifetime (range 25 m)

Fig. 12
figure 12

Normalized lifetime (range 50 m)

The results of simulation experiments shown in Tables 3,4, 5, 6, 7 and 8 and Figs. 7, 8, 9, 10, 11 and 12 show that the proposed approach (Lion Optimization with lightening) performs better in comparison to all the other approaches under consideration namely no optimization, ACO, GA and Lion optimization without lightening for all the parameters under consideration i.e., normalized life time, end to end delay and throughput. The improvement in performance is for all pipeline lengths.

The GA and ACO poses a great possibility of falling into local optimal, consequently might lead to an inconsistent outcome thus required more iteration to get the optimal solution. While the proposed approach uses the local as well as global optima and thus gives the optimal solution with minimum cost (fitness function) and takes less iteration. The LOA while combined with LAPO cover more area, as compare to the only LOA thus gives better results in terms of all the parameters. In case of proposed approach, the nodes can communicate in zig-zag manner also, due to this, there will be more area covered and less load on the nodes, because of this throughput will be more and lifetime will be increase. So, the proposed approach gives the better results than with the compared approaches.

6 Conclusion and Future Work

In this paper a pipeline monitoring system that uses LWSN for data exchange and effective communication for the protection of entire system has been proposed. The highlighted challenges in these pipelines such as node deployment and communication of data from source to destination have been is addressed with the help of an optimization scheme combining LOA and LAPO. With the help of extensive simulation experiments, the approach by the combination of LOA and LAPO has been shown to provide greater normalized lifetime, less delay and better throughput in comparison to other optimization techniques such as ACO, GA and LOA. As a future work, the combination of LOA and LAPO technique may be used to optimize node deployment on a network of existing pipelines in which the position of base station is fixed and only the position of nodes may be changed.