# Energy Efficient Management of Pipelines in Buildings Using Linear Wireless Sensor Networks
## 3 Proposed Solution
### Lion Optimization Algorithm  
The Lion Optimization Algorithm, first described by [PERSON] and [PERSON] [28] is a population-based meta-heuristic calculation. This calculation is based on the chasing and social conduct of the lion. Lions are arranged in two sorts of social associations, one is the pride and other is wanderers. The prides are gatherings of lions while the wanderers move sporadically either in pairs or independently. The behavior of a wanderer that moves independently describes the exploration search while the pride behavior represents the exploitation search. The use of both identifies a balance between the exploitation and exploration search, which suggest better convergence towards global optima. In LOA, every arrangement is set apart as a lion given as \(=~{}[s_{1},s_{2},s_{3},\ldots\ldots\ldots s_{n}]\). The cost capacity C is utilized to assess the expense of every lion. At first sensor node (SN) arrangements are produced haphazardly in pursuit space in which %\(P\) are the wanderers and rest are separated into c bunches of prides. The %i in every pride is females and the remainder are the males. The tertiary of the pride is characterized by the best gone-by position of every lion [28]. The chasing style of the pride is particular to trap the quarry. A couple of females from the pride assault the quarry while others move from region to region. The chasing individuals from the pride partition themselves into three gatherings, i.e., focus, left and right area. The gathering utilizes the resistance-based learning [29] to assault the quarry. The gathering with most extreme wellness worth is considered as the middle gathering and position of the quarry is identified with the position of chaser as appears in Equation (1):  
\[P_{quarry}=\sum\frac{p_{chusers}(s_{1},s_{2},s_{3},\ldots\ldots\ldots s_{nv})}{ number\ of\ chasers} \tag{1}\]  
Here, \(P_{quarry}\) and \(p_{chaser}\) are the position of the quarry and chaser respectively. During the hunting process, the chaser are elected randomly and position updating of the quarry and chaser (left, right and center section) is given by Equation (2) (where percentage \({}_{i}\) is the percentage of improvement in fitness of chaser), (3) and (4) respectively:  
\[{p_{quarry}}^{\prime}=p_{quarry}+rand*precentage_{i}*\left(p_{quarry}-P_{chaser}\right) \tag{2}\]  
\[P_{chaser}^{\prime}\]  
\[=\left\{ \begin{array}{l}rand*\left(2*p_{quarry}-P_{chaser}\right)+p_{quarry} \text{ {if }}\left(2*p_{quarry}-P_{chaser}\right)<p_{quarry}\\ rand*p_{quarry}+\left(2*p_{quarry}-P_{chaser}\right)\text{ {if }}\left(2*p_{quarry}-P_{ chaser}\right)>p_{quarry}\end{array} \right. \tag{3}\]  
\[P_{chaser}^{\prime}=\left\{ \begin{array}{l}rand*P_{chaser}+p_{quarry}\text{ {if }}P_{ chaser}<p_{quarry}\\ rand*p_{quarry}+\text{ {P}_{chaser}\text{ {if }}P_{chaser}>p_{quarry}\end{array} \right. \tag{4}\]  
The random function (rand) is used to generate a number between 0 and 1. Equation (3) is used to update the position of the chaser if it is in right or left section otherwise Equation (4) is used for the same. The remaining females (which are moving towards territory) update their position according to Equation (5):  
\[P_{female\_lion}^{\prime}=P_{female\_lion}+2*distance*\overset{\rightarrow}{R1 }+U(-1,1)*\tan(\theta)*distance*\overset{\rightarrow}{R2} \tag{5}\]Here, \(P_{female\_lion}\)', \(P_{female\_lion}\) is the updated and original position of the female lion respectively. The distance is the distance between the \(P_{female\_lion}\)' and the point selected by tournament strategy. \(\overset{\rightarrow}{R1}\) is the vector representing the start point, \(\overset{\rightarrow}{R2}\) is selected such that \(\overset{\rightarrow}{R1}\). \(\overset{\rightarrow}{R2}=0\) and \(\|\overset{\rightarrow}{R2}\|=1\). Theta (\(\theta\)) varies uniformly between \(-\pi/6\) to \(\pi/6\) radian to widen the area of current solution.