1 Introduction

Owing to the recent development, the WSNs have represented another new research in the field of Micro Electro Mechanical Systems (MEMS) that have a huge impact on the areas like civil, health, environment and military services. It comprises of thousands of sensor nodes that are deployed over some hostile and inhabitable harsh aspects of the environment for a limited period along with a common objective for providing a proper distributed sensing, communication service and storage. These sensor nodes present themselves in a specific manner that the end-users can use them as front-line observation.

Among all the sources of energy consumption in sensor nodes, the energy that has been used for wireless data communication has a very critical impact. Here the routing has crucial energy efficient technique employed in it to bring down the energy burden. The clustering of sensor nodes is an effective technique that is employed for conserving the energy of the sensor nodes. In case of clustering the network will be divided into groups that are smaller called as clusters. Every cluster has a leader which will be referred to as the Cluster Heads (CH) and they are responsible for the collection of local data within clusters and aggregating them and further send them to the remote BS either directly or by using the other CHs in other clusters. This BS is connected to that of public networks like the internet for the event and its public notification [2].

In case of Building Management (BM) area, the WSNs play a critical role in the energy management by means of seamlessly and continuously monitoring the energy use in the building that lays a foundation for efficiency of energy. The WSNs may also benefit the BM practices in many ways. For instance, the status of many major components is monitored by means of analyzing sensor data. There is an instant access of information in the jobsites and these are obtained by means of taking advantage of the on-board storage of data of the WSN devices. There are several BM systems that are used now for the automation of different tasks and they may be integrated for achieving a higher management efficiency using a web enabled platform. For further exploration the effective integration of the WSNs and also the Building Management Systems (BMS) makes WSN a provider of information service of all the automated control as well as processes of management. Also, the main benefits of all the additional on-board data storage capacity in sensor nodes have not been explored fully. The function may also be incorporated fully within the BM for improving efficiency of work [3].

The call for energy reduction made worldwide has been demonstrated by several international policies. These policies have been accelerating the energy saving techniques. It has been recognized that the energy consumption in buildings have accounted for about 40% of the worldwide energy use and also has a faster rate of growth than that of the transportation industry in terms of consumption of energy. The reduction of energy consumption for the buildings will need the local generation of energy and its awareness among the residents as well as the controlling devices that are inside the building. There are strong evidences that suggest that the occupants will be able to adapt their behavior actively to save energy along with suitable feedback, support and also incentives with no adverse impact on comfort [4].

Variety of systems are used by the technological area of BMS controls within an extended range of complexity and is patterned to control, monitor and optimize various functions and services that are provided in a building which includes ventilation, temperature monitoring, lighting, and managing electrical appliances. Through this, the atmosphere is made more comfortable, safe and efficient by the integration of systems such as lighting, security, telecommunication, air-conditioning and heating. This can be done effectively, only if these different systems communicate and integrate with each other properly. The basic aim of such a system is in achieving an optimal level of control of occupant comfort, at the same time minimizing energy use.

In order to achieve this goal, using the WSNs for auditing and controlling the equipment will represent a viable and a flexible solution for traditional Building Monitoring and Actuating Systems (BMAS), that need a retrofitting of the entire building and will be difficult in implementation. Contrastingly, the solutions which are based on the WSN for the purpose of monitoring the buildings and also for controlling equipment like the electrical equipment that are used for Heating, Ventilation and Cooling (HVAC), may be installed in the structures that are already in existence. This can ensure space monitoring in terms of usage and energy at the same time helping in the design of such techniques for actuation of intelligent device. For achieving this, the WSN based building will lead to the devising of a dedicated framework for the purpose of (1) management of a variety of networked entities, (2) profiling of energy spend and finally (3) developing applications to control consumption of energy.

Medical applications of the WSNs will aim at improving the current healthcare monitoring services for elderly, chronically ill and the children. There are many benefits that have been achieved in these systems. To start with, the capability of remote monitoring is considered important. In this the identification of conditions of emergency for patients at risk is easier as people having various degrees of the cognitive as well as physical abilities will be duly enabled to continue to have a much more independent as well as easier life. The small children and the babies are also cared for in a much more secure manner while their parents are not around. There is a decrease in the dependability of special care givers [5].

With regards to health care applications, the real-time system used is a soft real-time system, where certain amount of latency is allowed. Identification of emergency situations such as heart attacks or sudden falls where the first few seconds or minutes are vital in saving lives, without which these conditions might not be identified at all. So providing real time identification and taking action in the pervasive systems of healthcare will provide primary benefits.

Developing any wireless healthcare application can offer many different challenges like reliable data transmission, fast detection of event and timely data delivery along with middleware and node computation. Also, the deploying of new technologies in case of the healthcare applications will make the privacy of the patient vulnerable. In case the vital signs of the patient are sensitive like that of any embarrassing disease any leakage of an individual data of disease can make them feel embarrassed. Sometimes exposure of the information on disease can also result in the person losing his job or difficult to get protection from insurance [6]. The wireless sensor networks further cover a varied range of applications of healthcare like the monitoring of physiological data, monitoring of activity in health-clubs and tracking of location for athletes and so on.

As a consequence, these medical sensor networks will share individual data with that of the physicians, with insurance companies, health coaches or even with family. So, an unauthorized collection of patient data used by the potential adversaries like the insurance agents for rival coaches, or political reasons or even personal enemies can lead to risks that is life threatening. A wireless healthcare also offers several advantages in patient monitoring but the privacy of such big concerns in case of healthcare applications may become a challenge [7]. Healthcare providers are subject to strict penalties both civil and criminal (either with fine or with imprisonment) of the Health Insurance Portability and Accountability Act (HIPAA) rules when not followed properly. So the security and privacy of the patient will be its central concern in case of healthcare applications.

Furthermore, the traditional systems of security which require unlimited resources to ensure they may not be applied directly to the resource constrained sensor nodes. As the wireless medical sensor networks and their requirements of security will be similar to that of the traditional networks that are availability, integrity, confidentially, freshness of data, non-repudiation, and authentication to ensure that the resource conscious security protocols will emerge as a critical issue in the applications of healthcare make use of the wireless medical sensor networks. It will have to be shown as a security mechanism that is well-planned and designed for the successful deployment of wireless application.

The Cluster-based routing architectures will be used widely in the WSN owing to the efficiency of energy and its load balancing. Normally, a cluster network will employ only a single hop routing in that cluster. This can bring down energy consumption for the communication by means of forwarding the node data to the CH though a hop. But when the distance of communication goes up, the single hop communication can consume further energy and can become a less efficient method in terms of energy. For that of a large network, in which the inter-node distance is critical, the multi-hop communication is considered to be an approach that is energy efficient [8].

The advantages of Clustering are: (1) Enables data aggregation at the level of the CH for discarding redundant data thereby reducing the consumption of energy by prevention of transmission of individual data from that of the sensor nodes. (2) This improves the network scalability to a significant level. (3) It conserves the bandwidth of communication as sensor nodes efficiently communicate only with their CHs thereby avoiding redundant message exchange between them. But the clustering process and their choice of CH has performed a crucial role in the network lifetime and its longevity. It further has the effect of the process of data routing in an efficient manner. So, proper care has to be exercised in the process of selection of CH [9].

A Low Energy Adaptive Clustering Hierarchy (LEACH) protocol is quite popular among the protocols of WSN and clustering. This will elect the CH on the basis of a probability distribution. A LEACH protocol will repeat in rounds that is two phase: a set up phase and a steady state phase. The election of a CH is periodically done in a manner that is randomized at the time of the setup phase. The steady state phase has been divided into several frames each into slots one for every live node. Every sensor node will thus send the data to CH and the gathered data to the BS. Using this approach, the LEACH will claim to balance the consumption of energy for the sensor nodes but does not guarantee a proper and uniform representation of CHs. With this approach, LEACH claims to balance energy consumption of the sensor nodes. The LEACH is however, considered a testing benchmark for the WSN clustering algorithms [10].

The problem of clustering in the WSN may be defined as: Given a set called G of the n nodes and also a sink node (or the BS) s, will be randomly positioned within the monitoring area. The main problem is finding a set of n ch nodes that are to be the CHs minimizing the energy of the non-CH nodes (the regular sensors) for transmitting their data to any CH, by minimization of the sum of squared distances among the non-CH nodes and that of the closest CH among each of the CH that is closest to the sink node [11]. The problem is that of a Non-deterministic Polynomial (NP)-hard one of a combinatorial optimization and is therefore unlikely to be an efficient algorithm. But for finding an optimal clustering in the WSN this being NP hard there is a need for efficient heuristics.

A crucial system for monitoring indoor environment is provided by WSN. In this a BMS that is based on WSNs is presented. A network which has its basis on clustering is proposed for the monitoring of the building, which can be inspired by LEACH method. A local cluster is formed by the conducting all nodes in a room, which is done through a configuration module of building management software. Node energy is not consumed through this cluster formation method. As packets cannot be transmitted by CHs directly to the sink node because of limited wireless communication range, these are represented by a multi-hop tree that is rooted to the sink node. For this work a hybrid that is optimized with the FSO-PSO multi-hop clustering in the WSN is proposed. The rest of the investigation is organized as below. Section 2 will discuss the related work. Section 3 will explain methods used for this work. Section 4 discusses the results for the experiment and Sect. 5 concludes the work.

2 Related work

The sensor nodes and their physical location will influence strongly the network performance from the point of view of accurate data sensing and also its reliablity in terms of communication. So the planning of deployment may be considered as an essential step in giving a viable infrastructure of network. Guinard et al. [12] made a presentation of a BMS that depends on the actuators and the wireless sensors. This has been accomplished by means of developing a WSN design as well as optimization software tool in order to support the system integrators and designers at the time of undertaking tasks that are difficult in the deployment of WSN for the building of energy management.

Kazmi et al. [13] further demonstrated the WSN technologies and their viabilities that lead to the increase in the possibility of services that are novel for the building of energy management. This will lead to several approaches that are proposed for the purpose of harnessing the WSNs for the management of energy and its conservation. The article further surveys some of the state-of-the-art Building Energy Management Systems (BEMS). There is a generic architecture that has been proposed post which there will be a detailed taxonomy of the current systems that are documented and identify the directions for research in future.

Špinar et al. [14] made a presentation of an IP-based WSN Building Monitoring and Diagnostic System (WSN-BMDS). The focus of this will be to obtain a higher degree of information on the building operation and the current BMSs which it can provide. The system further integrates a set of WSNs that are heterogeneous having an IEEE 802.11 backbone router with the Global Sensor Network (GSN) and its web server. The Sensing data will be stored in a database in its back office using a User Datagram Protocol (UDP) and this can be accessed over the internet by means of using the GSN. By means of this demonstration, the work will show that this WSN-BMDS will provide some accurate measurements of that of the air-temperature, the air-humidity, the light, and the consumption of energy for some rooms in the building in target.

Ko et al. [15] further presented certain representative applications in the domain of health care and also described the challenges of introducing to the WSNs owing to the needed level of its trustworthiness for ensuring the security and the privacy of such medical data. Such challenges can be exacerbated by a scarcity of resource which may be inherent in the platforms of WSNs and the authors outlined the systems of prototype that span the domains of applications from the physiological as well as the activity monitoring to that of a large scale behavioral and physiological investigation and also emphasize the challenges in ongoing research.

Lawrence et al. [16] further described the WSN personal health monitoring system and its development that was known as the Medical Mote Care that was a combination of both medical as well as environmental sensors. The Simple Network Management Protocol (SNMP) along with the Code Blue agents had been incorporated in this system as the Jaguar SX being its network platform and the models of Network management with its tools can provide a scalable and affordable solution to the health monitoring applications of the WSNs with timely alerts and their parameters that are breached. Such a work will be a part of a large grant that is aimed at the providing of healthcare for the elderly.

Chen et al. [17] made a presentation of a prototype of one smart gateway. This will be an interconnection and the services management platform mainly for WSN health care systems in the home environment. By means of building a bridge between that of the WSN and the public communication networks, which are compatible having an on-board decision system of data along with a lightweight database to make the decisions of the patients’ healthcare to get a low-power and a low cost system to get a fast emergency response time. The authors had also designed some new communication protocols among the WSN, the gateway and the remote servers. In addition to the Ethernet, the Wi-Fi and the Global System for Mobile (GSM) or the General Packet Radio Services (GPRS) communication module which have been integrated within the smart gateway to report as well as notify information to the care-givers. The authors further conducted experiments for the smart gateway by means of performing them along with a wireless home e-health care sensor network. The results have proved that this smart gateway design will be feasible and also have a low latency.

The cluster-based approaches are found to be popular in terms of energy efficiency and also energy saving. The CH will be responsible for the gathering of data from that of the cluster nodes and conveying the same to the BS. So the choice of the CH is extremely important for the improvement of the lifetime and the performance of the WSN. Anandamurugan and Abirami [18] presented a hybrid Shuffled Frog Leaping Algorithm (AASFLA) having anti-predator capabilities for avoiding local minima. Results prove that avoidance of the suboptimal solution as compared to SFLA and the PSO.

Azharuddin and Jana [19] made a proposal for a PSO-based scheme for solving the problem of hot spot that was caused using a multi-hop communication in a WSN that is cluster based. The scheme contained both routing and clustering algorithms that are efficient in terms of energy. In the routing phase the CH traffic overload will be distributed evenly but in the clustering phase, it can only take care of the CH the energy of which has been exhausted. Additionally, authors have also developed a scheme of distribution for preventing the CH from a quick death owing to depletion of energy.

Wang et al. [20] made a proposal of a PSO based clustering algorithm with a mobile sink for the WSN. Here, the virtual clustering technique has been performed at the time of routing using the PSO algorithm. The position of the nodes and their residual energy are used as parameters for choosing the CH. The position of the residual energy and the nodes are the primary parameters for selection of CH. A control strategy for the mobile sink and to collect the data from that of the CH has also been designed. The results of simulation prove that the consumption of energy is reduced.

Shankar et al. [21] has proposed a hybrid of the Harmony Search Algorithm (HSA) and the PSO algorithm for an energy efficient selection of CH for obtaining a global search that has fast convergence. This algorithm has exhibited a high efficiency in terms of search for the HAS and a dynamic PSO capability for improving the sensor node lifetime. This Hybrid algorithm has been evaluated in terms of performance by using the actual number of alive nodes, the throughput, the residual energy and the number of dead nodes. This proposed hybrid HSA–PSO algorithm has shown an improvement in that of the residual energy and the throughput by about 83.89 and 29.00%, respectively, than that of in the case of the PSO algorithm.

3 Methodology

Many of the problems in the WSN like the deployment of node, the localization, the energy aware clustering are considered as typical issue of optimization. The Conventional methods of analytic optimization require a large amount of memory and the resources as their computation for implementing on that of single sensor nodes. The techniques of optimization are inspired by nature in terms of efforts of computation. Here in this section, the FSO, the PSO and the FSO-PSO based multi-hop methods of clustering have been discussed.

Fish Swarm Optimization (FSO) The Artificial Fish (AF) swarm algorithm is that optimization algorithm that is based on the Animal Corporation. This is a concrete application that is based on the thoughts of swarm intelligence. The idea of the FSO will be to imitate the behaviour of the fish like preying, swarming and the one that follows the local fish search for reaching its global optimum. This is a random and a parallel search algorithm that has two parts which are variables and functions. The variables are: \(X=(x_1 ,x_2 ,...,x_n )\) which is its current position, the Step will be the moving step length, the Visual represents its visual distance, the try number will be the try number and \(\delta \) will be the crowd factor \((0< \delta < 1)\).

f(X) denotes the fitness value of food consistency in position X. In every step of the process of optimization, locations are found by AF with better fitness values in the problem search space through performing these three behaviors on the basis of the algorithm procedure. These functions will include the behaviour of the AF: the swarming, the preying, following [16].

Swarming behavior the Fish congregates naturally, avoiding their harm and they protect themselves. If \(x_i \) is the current state of the AF and, \(x_c\) the centre position and \(n_f\) the number of companions in its current neighbourhood \((d_{ij} < \hbox {Visual})\), n will be the total fish number. In case \(Y_c >Y_i \); and \(n_f /n<\delta \),that means that its companion centre has more food and not very crowded, by going a step forward to the companion centre. Else, this will execute its preying behaviour.

Preying behavior Normally, the fish that moves freely in water has a random behaviour but at the time of identifying food they move quickly towards the food and its direction. If \(x_i \) is the AF current state, choose a state \(x_j \) randomly in the visual distance and Y will be the food concentration (objective function value). In case \(Y_i >Y_j \); then the maximum problem, will go a step forward in this direction. Else, choose a state \(x_j \) randomly and judge if this can satisfy such a condition [17].

Following behaviour in case some fish can discover food, the other fish may arrive at this spot immediately by following their partners. If x is the current AF state, it may explore a companion \(x_j \) in this neighbourhood (\(d_{ij}<\) Visual), that has the highest\(Y_i \); If the \(Y_i >Y_j \) and \(n_f /n<\delta \), that means the companion \(x_j\) will state having higher food concentration the surroundings that are not that crowded and it goes a step forward to its companion \(x_j\). Otherwise, it will execute its preying behaviour.

Additionally, there is a bulletin board that is designed for recording the state of its best AF and its food concentration in the AF and its location. In every iteration, after the AFs perform all AFSAs and by moving them to new locations, comparison of the fitness value of best AF is done with the recorded location on the bulletin. On the bulletin, if the fitness value of the best AF is better than the location that is recorded, which takes place in the location of the best AF as the best one found so far.

In the proposed method, fitness function that has been used for each AF is the total of intra-cluster distances that is equal to the entire Euclidean distances between the nodes and the CH that is the nearest.

A node is elected by selecting CHs within each cluster and this requires less energy to transmit (to BS or the next hop CH close to the BS) to the CH for a specific transmission round. This is got by applying prey, swarm and following behaviors. A set of CHs is provided by each behavior. On the three sets the fitness equation is used in order to choose the optimal CH sets. Combination among others is represented by the smallest fitness. Then the optimized CHs candidate is broadcasted through the BS to the network.

Particle Swarm Optimization (PSO) This PSO algorithm, that was introduced originally based on the social as well as the cognitive behavior by Kennedy and Eberhart (1995), will solve the issues in various fields, mainly in engineering and computer science. The individuals known as particles will be flown through the search space that is multidimensional where each particle represents a probable solution to a multi-dimensional problem of optimization. The particle movement has been influenced by two factors by using an iteration to iteration and also a particle to particle [18].

As a result of the iteration-to- iteration information, any particle will store in memory a best solution that has been visited until now known as pbest and will experience an attraction to this solution as it keeps traversing through the search space of the solution. The result of the particle to particle interaction will be stored by the particle in its memory and the best solution that has been visited until now will be called gbest. The first as well as the second factors are known as the cognitive or the social factors. Once the iteration is complete both the pbest and the gbest will be updated for each of the particles and if a more dominating and a better solution in fitness terms is found. The same process will continue until such time the result desired is being converged or if an acceptable solution is not found inside the limits of computation.

For the n dimensional search space, an ith particle of swarm will be represented by the n-dimensional vector, \(X_i =(x_{i1} ,x_{i2} ,\ldots ,x_{in})\). The particle’s velocity will be represented by yet another n dimensional vector \(V_i =(v_{i1} ,v_{i2} ,\ldots ,v_{in})\) T. The best position that has been visited previously for the ith particle has been denoted as \(P_i =(p_{i1} ,p_{i2} ,\ldots ,p_{in})\) T. ‘g’ will be the index of the swarm’s best particle. The ith particle’s velocity has been updated using the Eq. (1):

$$\begin{aligned} v_{id} =v_{id} +c_1 r_1 (p_{id} -x_{id} )+c_2 r_2 (p_{gd} -x_{id} ) \end{aligned}$$
(1)

The position is updated by using (2):

$$\begin{aligned} x_{id} =x_{id} +v_{id} \end{aligned}$$
(2)

In which d = 1, 2...n; i = 1; 2...S, and S is the swarm size, \(\hbox {c}_{1}\) and \(\hbox {c}_{2}\) being the constants known as cognitive as well as social scaling parameters (normally \(\hbox {c}_{1} = \hbox {c}_{2}; \hbox {r}_{1}, \hbox {r}_{2}\) are the random numbers, that are uniformly distributed in [0, 1]). The Eqs. (1) and (2) will be the initial version of the PSO algorithm [19]. \(\hbox {V}_{\mathrm{max}}\), being the constant will be made use of for arbitrarily limiting the particles and their velocities to improve the search resolution. Also, the inertia weight had been developed for controlling both exploration and exploitation better. The motivation has been for eliminating the necessity of \(\hbox {V}_{max}\). Inclusion of inertia weight (w) to the PSO algorithm had been reported in 1998 and the update is (3):

$$\begin{aligned} v_{id} =w *v_{id} +c_1 r_1 (p_{id} -x_{id} )+c_2 r_2 (p_{gd} -x_{id} ) \end{aligned}$$
(3)

Eberhart and Shi (2000) had indicated a strategy that was optimal for initially setting w to 0.9 and further reduce it in a linear manner to 0.4 and allow an initial exploration that is followed by the acceleration toward any improved global optimum.

To produce energy-aware cluster, PSO approach is applied with optimal selection of CH. The cost of locating optimal position is ultimately reduced for the CH nodes. The implementation of PSO is done within cluster rather than BS that makes it a semi-distributed approach. The residual energy is the basis for the selection criteria of the objective unction, minimum average-distance from member nodes and head count of probable head nodes.

Proposed FSO–PSO based multihop clustering Although there are many advantages in using a classical LEACH distributed formation of cluster, the protocol will offer no guarantee regarding the placement as well as the actual number of the CH nodes. As the clusters are adaptive, getting a poor setup of clustering in a given round will not affect the performance greatly. The FSO and its operation have been based on an algorithm that has been controlled centrally and can produce better results in terms of clusters by means of dispersing the CH nodes. The nodes that have energy below average node energy will not be CHs for its present round [20].

A steady-state operation is broken as frames in which the nodes are sent to the data of the CH. By using the Time Division multiple Access (TDMA) schedule mechanism which is an efficient and low latency approach the data received by the CH can be used for performing data aggregation for enhancing a common signal and further reducing any uncorrelated noise among their signals. The data that results from this is being sent from the CH to its BS. The sleep mechanism has to be emphasised as while transmission they have to wake up. There are multiple clusters that make a parallel communication by using several Code Division multiple Access (CDMA) codes. In case the distance is not close among the BS and the CH nodes, the latter will choose to be closest to the other CH nodes for transferring the messages of data. By the end of such transmission, the BS will broadcast the end of communication in the present round and will further initiate the next round of communication.

This cluster has been formed by the sink or the BS based on centralized clustering for which the information is collected. Once this is received by the sensor nodes it will be sent along with the node id or the location (which is the distance from the BS in both the X and the Y position) and the loss of energy and the ratio of energy along with the current energy for sending it to the BS. Once this is done the BS will initiate the process of clustering in the following steps. Step 1. The conversion of this problem inside the space of PSO where the particle will have two dimensions like the position and the velocity of the particle. Step 2. This denotes the estimation of the value of fitness that makes use of the fitness function. The proposed function for the PSO based clustering will be the optimization of the average distance as well as the average energy of that of the member nodes and from the present CH as well as the headcount [21].

In this proposed approach of hybrid FSO-PSO algorithm which is a choice of the CH in that of multi-hop clustering. Fitness function is used in an analytical manner in the proposed hybrid FSO-PSO algorithm where the transmission energy is regarded quite important. The distance between the elements of transmission will use energy. The other elements like the remaining energy and the Energy Constraint (EC) will also be considered. In case a node has a lot of remainder energy and good signal strength it may be chosen as a CH. . The objective function of CH is given in Eq. (4):

$$\begin{aligned} q_1 =\left( {E_i } \right) ^{k_1 }*\left( {K_i } \right) ^{k_2 }*\left( {SE_i } \right) ^{k_3 } \end{aligned}$$
(4)

Wherein \(E_i \) denotes remaining energy, \(K_i \) denotes a set of neighbours, \(SE_i\) represents signal strength while \(\hbox {k}_{1}\), \(\hbox {k}_{2}, \hbox {k}_{3}\) denote weights controlling \(E_i ,K_i \) as well as \(SE_i \).

The metrics of energy restriction among paths and sink nodes are used and the EC measure will calculate the inferences of inter-flow and the variations in the rate of communication and the wireless link loss ratio [22]. It is given in Eq. (5):

$$\begin{aligned} IEC_{ij} (c)=ETT_{ij} (c)*|N_i (c)\cup N_j (c)| \end{aligned}$$
(5)

Wherein \(N_i (c)\)represents a set of neighbors of node I, C refers to channel c \(|N_i (c)\cup N_j (c)|\)denotes total nodes interfered with by communication activity between Node i as well as Node j over channel c. \(ETT_{ij} (c)\), expected transmission time, that calculates communication rate difference as well as link loss ratio

Attracted by the FSO and its potential there are plenty of improved algorithms that are based on the ordinary FSO that are proposed like the introduction of the taboo optimization operator, the jumping fish behavior and the fish memory behavior. In this, the speed inertia, the memory (or learning) of the individual particle, and the exchange of information and their sharing between particles, have been introduced to the FSO and the improvements in both FSO and PSO have been expressed as below [23]:

First, speed parameter is brought into the AFs. Taking swarm behaviour for instance, the formula for updated speed is represented as (6):

$$\begin{aligned} V_{t+1} =\omega V_t +rand\times \frac{Step\times (X_t^c -X_t )}{norm(X_t^c -X_t )} \end{aligned}$$
(6)

In which \(\omega \) will be the inertia weight; \(V_t \)the velocity vector of AF in t-th iterative process; the Step will be the largest mobile length of step; \(X_t^c \) the centre of the vector and the cluster behaviour; \(X_t \) will represent its current position vector for the AF in t-th iterative process; \(norm(X_t^c -X_t )\) indicates the distance among two position vector, and that of the rand \(\sim \) U (0, 1).

Secondly, the behaviour pattern and its memory will make AF in swimming as optimal position that reduces the blindness of fish in the process of search. The speed is as in (7):

$$\begin{aligned} V_{t+1}= & {} \omega V_t +rand\nonumber \\&\times \frac{Step\times [\xi _t (X_t^{pbest} -X_t )+\xi _{t-1} (X_{t-1}^{pbest} -X_{t-1} )]}{norm[\xi _t (X_t^{pbest} -X_t )+\xi _{t-1} (X_{t-1}^{pbest} -X_{t-1} )]}\nonumber \\ \end{aligned}$$
(7)

In which \(X_t^{pbest}\) will be an optimal position vector of AF on a bulletin board in t-th iterative process; \(X_{t-1}^{pbest} \) that represents an optimal position vector of AF on that of the bulletin board in t-1th iterative process.

Thirdly, behaviour pattern of communication has been introduced and this will make the AF in the swimming to be the optimal positon of the entire fish which will improve the process of search and reduce the blindness of the fish in this process. The velocity that is updated is as shown in (8):

$$\begin{aligned} V_{t+1}= & {} \omega V_t +rand \nonumber \\&\times \frac{Step\times [\xi _t (X_t^{gbest} -X_t )+\xi _{t-1} (X_{t-1}^{gbest} -X_{t-1} )]}{norm[\xi _t (X_t^{gbest} -X_t )+\xi _{t-1} (X_{t-1}^{gbest} -X_{t-1} )]}\nonumber \\ \end{aligned}$$
(8)

In which \(X_t^{gbest} \) will represent a current global extreme value point in population on the bulletin board as the t-th iterative process; \(X_{t-1}^{gbest} \) indicates the current global extreme and its value point on the t-1th iterative process. The vision and the step length are considered two critical parameters in the FSO and will have an effect on the result of optimization [24]. Here, this will define the maximum distance as well as the vision and the fish and its step length that makes two random fish that can appear in a D dimension search space. Also, this will define the maximum distance that is given as MaxD in formula (9):

$$\begin{aligned} MaxD=\sqrt{(x_{\max } -x_{\min } )^{2}\times D} \end{aligned}$$
(9)

In which \(x_{\max } \) and \(x_{\min } \), denote the upper as well as the lower bound of the range of optimization and the visual has been set to that of a linear gradient from the MaxD to 0.01 MaxD; this step will be set to a linear gradient from the MaxD/5 to 0. This specific process for the FSO-PSO has been shown as below:

Step (1) to initialize the speed and position of the fish, the location that is optimal for fish and its memory and their optimal positon parameters.

Step (2) test all four kinds of behaviour patterns and combinations including cluster or foraging, memory or foraging, communication or foraging and collision or foraging.

Step (3) choose an optimal combination of the behaviour model from the Step (2) and make a velocity update of the AF and its current location and

Step (4) in a specified number of such iterations are available, the optimization may end, else go to Step (2).

For medical BMS, the FSO-PSO based multihop cluster method proves to be inefficient because of the following reasons:

  1. 1.

    Sensor devices will have non-replaceable batter such as structural monitoring, fire sensors.

  2. 2.

    There are infinite energy source in certain medical devices as they are connected to AC sources. In this devices such as ECG, cardiac monitor are included.

  3. 3.

    Mobile sensors are included which are enabled in monitoring visitors, youngsters or old people.

A heterogeneous energy environment and mobility is produced the above scenario. Though conventional WSN networks may perform up to a certain extent, they might not prove to be efficient as some of the devices in the home maybe switched off and might not take place in the CH process and at the same time when they are switched ON they can be used effectively as CH without the energy being compromised in devises where battery cannot be replaced. These FSO–PSO devices with multihop cluster formation techniques are used by devices in the hospital which have AC power source as CH so that energy management is enhanced on the devices non-replaceable battery. The challenge involved in using sensors with mobility efficiently as the battery that is available is higher than non-replaceable devices.

The FSO–PSO algorithm flowchart is as in Fig. 1

Fig. 1
figure 1

Flowchart for FSO–PSO Algorithm

4 Results and discussion

A commercial modeling and simulation tool for various types of wireless networks is Optical Network Simulator (OPNET) Modeler Wireless Suite (OPNET). This is developed by OPNET Technologies, Inc. with its basis on the well-known OPNET Modeler. A fast discrete event simulation engine is used by the simulation environment that operates with a 32-bit/64-bit with fully parallel-simulation kernel, which is available for Windows and Linux. An object oriented modeling approach is provided by the OPNET Modeler and a modeling environment that is hierarchical. Although wireless sensor network do not have special routing protocols, various propagation and modulation techniques and ZigBee (802.15.4) MAC layer are provided. From the scratch, additional modules have to developed or customized. The simulations of wireless networks can be operated as a discrete event, hybrid or analytical, encompassing terrain, mobility and path-loss models. Because of the open-interface external object files, libraries and other simulators can be integrated to the OPNET modeler. Optionally a System-in-the-loop is available to interface simulations with live systems. Moreover, the OPNET Modeler Wireless Suite provides a grid computing support so that simulations can be executed in a distributed manner [31].

The simulation model is built in MATLAB, i.e. this is nothing but matrix laboratory. MATLAB was developed by Math Works Inc., which is a software package for numerical computation and visualization for high performance. The MATLAB provides premier software for scientists by having an interactive environment with numerous trustworthy and precise built-in mathematical functions including matrix algebra, complex arithmetic, linear systems, differential equations, signal processing, optimization, nonlinear systems, and many other types of scientific computations. The primary criteria which MATLAB very effective is its programing capability that is quite easy to learn and use that allows user-developed functions. FORTRAN algorithms and C codes through external interfaces also allow access. There are a number of optional toolboxes that are meant for special applications including signal processing, control systems design, system identification, statistics, neural networks, fuzzy logic, symbolic computations, and others. MATLAB has been enhanced by the very powerful Simulink program [32].

In this section, the FSO–PSO based multihop cluster and FSO–PSO device aware multihop cluster formation methods are used. The number of clusters formed, average end to end delay, average packet loss rate and percentage of nodes alive as shown in Tables 1, 2, 3 and 4 and Figs. 2, 3, 4, and 5.

Table 1 Number of clusters formed
Table 2 Average end to end delay
Table 3 Average packet loss rate
Table 4 Percentage of nodes alive
Fig. 2
figure 2

Number of clusters formed

From the Fig. 2, it can be observed that the FSO–PSO device aware multihop cluster formation has higher number of clusters formed by 2.81% for 200 number of nodes, by 3.92% for 400 number of nodes, by 2.27% for 600 number of nodes, by 2.76% for 800 number of nodes, by 2.57% for 1000 number of nodes and by 2.31% for 1200 number of nodes when compared with FSO–PSO based multihop cluster (Tables 5, 6).

Fig. 3
figure 3

Average end to end delay

From the Fig. 3, it can be observed that the FSO–PSO device aware multihop cluster formation has lower average end to end delay by 6.94% for 200 number of nodes, by 8% for 400 number of nodes, by 9.73% for 600 number of nodes, by 7.09% for 800 number of nodes, by 5.93% for 1000 number of nodes and by 7.96% for 1200 number of nodes when compared with FSO–PSO based multihop cluster.

Fig. 4
figure 4

Average packet loss rate

From the Fig. 4, it can be observed that the FSO–PSO device aware multihop cluster formation has lower average packet loss rate by 6.78% for 200 number of nodes, by 4.41% for 400 number of nodes, by 6.45% for 600 number of nodes, by 3.67% for 800 number of nodes, by 4.36% for 1000 number of nodes and by 7.38% for 1200 number of nodes when compared with FSO–PSO based multihop cluster.

Fig. 5
figure 5

Percentage of nodes alive

From the Fig. 5, it can be observed that the FSO–PSO device aware multihop cluster formation has higher percentage of nodes alive by 5.12% for 400 number of rounds, by 9.3% for 500 number of rounds, by 11.76% for 600 number of rounds, by 12.12% for 700 number of rounds, by 29.16% for 800 number of rounds, by 7.05% for 900 number of rounds and by 42.85% for 1000 number of rounds when compared with FSO–PSO based multihop cluster.

Table 5 Percentage improvement over FSO–PSO based multihop cluster and FSO–PSO device aware multihop cluster formation
Table 6 Percentage improvement over FSO–PSO based multihop cluster and FSO–PSO device aware multihop cluster formation

5 Conclusion

For the purpose of lifetime extension in WSNs this will be an algorithm that is energy efficient and cluster based In WSNs the Healthcare applications have been taken to be very promising in which the patients are monitored by using various wireless medical sensor networks. The wireless medical sensor networks and their healthcare research trends have their focus on the reliable communication of the patients, their mobility, their energy efficiency in terms of routing and so on. The Buildings will optimize energy intake and enhance security aside from bringing down the working expenses by using smart sensor nodes. The work has proposed a new intelligent algorithm for increasing lifetime. A new intelligent algorithm for multi-hop clustering and the fish swimming will have the speed of inertia which will expand the patterns of behaviour for fish in choosing the process of search and get a better convergence rate that that of the FSO–PSO, because this extended memory will be beneficial to the direction and the purpose of the search. The results have shown that this device aware multi-hop formation of cluster will have a higher number of clusters that are formed by about 2.81% for 200 number of the nodes, by about 3.92% for 400 number of the nodes, by about 2.27% for 600 number of the nodes, by about 2.76% for 800 number of the nodes, by about 2.57% for 1000 number of the nodes and by about 2.31% for 1200 number of the nodes when they are compared with that of the FSO–PSO based multi-hop cluster. This FSO–PSO multi-hop clustering has a much better scalability and a network lifetime will prolong further with an increasing network scale.

Future work should involve improving the computational complexity and implementing various other metaheuristic algorithms and also includes investigation on extending FSO–PSO in handling combinatorial optimization problems such as traveling salesman problem, QoS-aware service selection problem, real power line loss allocation problem and maximum power point tracking problem.